work on data buffer for aLeaves MAFFT suite + clean up
[jalview.git] / forester / java / src / org / forester / archaeopteryx / phylogeny / data / RenderableDomainArchitecture.java
index df45fe5..ca0d111 100644 (file)
@@ -6,7 +6,7 @@
 // Copyright (C) 2008-2009 Christian M. Zmasek
 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
@@ -16,7 +16,7 @@
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -32,6 +32,7 @@ import java.awt.Graphics2D;
 import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 import java.io.Writer;
+import java.math.BigDecimal;
 import java.util.Map;
 import java.util.SortedMap;
 
@@ -135,7 +136,7 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
     }
 
     @Override
-    public SortedMap<Double, ProteinDomain> getDomains() {
+    public SortedMap<BigDecimal, ProteinDomain> getDomains() {
         return _domain_structure.getDomains();
     }
 
@@ -144,10 +145,12 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         return _domain_structure.getNumberOfDomains();
     }
 
+    @Override
     public Dimension getOriginalSize() {
         return new Dimension( _domain_structure.getTotalLength(), ForesterUtil.roundToInt( _rendering_height ) );
     }
 
+    @Override
     public Object getParameter() {
         return new Integer( _e_value_threshold_exp );
     }
@@ -156,8 +159,9 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         return _rendering_factor_width;
     }
 
+    @Override
     public Dimension getRenderingSize() {
-        return new Dimension( ForesterUtil.roundToInt( _domain_structure.getTotalLength() * _rendering_factor_width ),
+        return new Dimension( ForesterUtil.roundToInt( _domain_structure.getTotalLength() * getRenderingFactorWidth() ),
                               ForesterUtil.roundToInt( _rendering_height ) );
     }
 
@@ -171,6 +175,7 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         return _domain_structure.isEqual( data );
     }
 
+    @Override
     public void render( final double x1,
                         final double y1,
                         final Graphics2D g,
@@ -185,8 +190,8 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         for( int i = 0; i < _domain_structure.getDomains().size(); ++i ) {
             final ProteinDomain d = _domain_structure.getDomain( i );
             if ( d.getConfidence() <= Math.pow( 10, _e_value_threshold_exp ) ) {
-                final double xa = start + d.getFrom() * f;
-                final double xb = xa + d.getLength() * f;
+                final double xa = start + ( d.getFrom() * f );
+                final double xb = xa + ( d.getLength() * f );
                 if ( tree_panel.getMainPanel().getOptions().isShowDomainLabels() ) {
                     g.setFont( tree_panel.getMainPanel().getTreeFontSet().getSmallFont() );
                     g.setColor( getConfiguration().getDomainStructureFontColor() );
@@ -198,6 +203,7 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         }
     }
 
+    @Override
     public void setParameter( final double e_value_threshold_exp ) {
         _e_value_threshold_exp = ( int ) e_value_threshold_exp;
     }
@@ -206,6 +212,7 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         _rendering_factor_width = rendering_factor_width;
     }
 
+    @Override
     public void setRenderingHeight( final double rendering_height ) {
         _rendering_height = rendering_height;
     }