From 0d2af94629bb51b07bfd784220aa19ea25038784 Mon Sep 17 00:00:00 2001 From: cmzmasek Date: Sun, 3 Aug 2014 10:55:14 +0000 Subject: [PATCH] fixing vector size issue... --- forester/java/src/org/forester/archaeopteryx/TreePanel.java | 5 +++++ .../archaeopteryx/phylogeny/data/RenderableVector.java | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index 24cb223..d58befb 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -623,6 +623,11 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee sum += getFontMetricsForLargeDefaultFont().stringWidth( node.getNodeData().getBinaryCharacters() .getGainedCharactersAsStringBuffer().toString() ); } + + if ( getControlPanel().isShowVectorData() && node.getNodeData().getVector() != null && node.getNodeData().getVector().size() > 0 ) { + sum += RenderableVector.VECTOR_DEFAULT_WIDTH + 10; + } + if ( sum >= max_length ) { setLongestExtNodeInfo( max_length ); return; diff --git a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java index cc0d772..a25af65 100644 --- a/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java +++ b/forester/java/src/org/forester/archaeopteryx/phylogeny/data/RenderableVector.java @@ -43,8 +43,8 @@ import org.forester.util.ForesterUtil; public final class RenderableVector implements RenderablePhylogenyData { - final static public int DEFAULT_HEIGHT = 12; - final static public int DEFAULT_WIDTH = 120; + final static int VECTOR_DEFAULT_HEIGHT = 12; + final static public int VECTOR_DEFAULT_WIDTH = 120; private double _rendering_factor_width = 1.0; private List _values; private final Rectangle2D _rectangle = new Rectangle2D.Float(); @@ -116,7 +116,7 @@ public final class RenderableVector implements RenderablePhylogenyData { final boolean to_pdf ) { final double y = y1; final double start = x1 + 20.0; - final double width = ( double ) DEFAULT_WIDTH / _values.size(); + final double width = ( double ) VECTOR_DEFAULT_WIDTH / _values.size(); for( int i = 0; i < _values.size(); ++i ) { g.setColor( calculateColor( _values.get( i ) ) ); _rectangle.setFrame( start + ( i * width ), y - 0.5, width, getRenderingHeight() ); @@ -149,7 +149,7 @@ public final class RenderableVector implements RenderablePhylogenyData { } private Color calculateColor( final double v ) { - return ForesterUtil.calcColor( v, _min, _max, _mean, Color.MAGENTA, Color.GREEN, Color.WHITE ); + return ForesterUtil.calcColor( v, _min, _max, _mean, Color.BLUE, Color.RED, Color.WHITE ); } private double getRenderingHeight() { @@ -162,7 +162,7 @@ public final class RenderableVector implements RenderablePhylogenyData { if ( _instance == null ) { _instance = new RenderableVector(); } - _instance.setRenderingHeight( DEFAULT_HEIGHT ); + _instance.setRenderingHeight( VECTOR_DEFAULT_HEIGHT ); _instance._values = values; _instance._configuration = configuration; if ( stats.getN() > 0 ) { -- 1.7.10.2