inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / phylogeny / data / RenderableDomainArchitecture.java
index 539dd65..afeef25 100644 (file)
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.archaeopteryx.phylogeny.data;
 
+import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Graphics2D;
+import java.awt.Stroke;
 import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 import java.io.Writer;
@@ -58,6 +60,7 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
     private final DomainArchitecture  _domain_structure;
     private final Rectangle2D         _rectangle                    = new Rectangle2D.Float();
     private final Configuration       _configuration;
+    private static final BasicStroke  STROKE_1                      = new BasicStroke( 1f );
 
     public RenderableDomainArchitecture( final DomainArchitecture domain_structure, final Configuration configuration ) {
         _domain_structure = domain_structure;
@@ -184,23 +187,26 @@ public final class RenderableDomainArchitecture extends DomainArchitecture imple
         final double f = getRenderingFactorWidth();
         final double y = y1 + ( _rendering_height / 2 );
         final double start = x1 + 20.0;
+        final Stroke s = g.getStroke();
+        g.setStroke( STROKE_1 );
         g.setColor( getConfiguration().getDomainStructureFontColor() );
         _rectangle.setFrame( start, y - 0.5, _domain_structure.getTotalLength() * f, 1 );
         g.fill( _rectangle );
         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() );
                     PhylogenyDataUtil.drawString( d.getName(), xa, y1
-                            + tree_panel.getMainPanel().getTreeFontSet()._fm_small.getAscent() + 6, g );
+                            + tree_panel.getMainPanel().getTreeFontSet().getFontMetricsSmall().getAscent() + 6, g );
                 }
                 drawDomain( xa, y1, xb - xa, _rendering_height, d.getName(), g, to_pdf );
             }
         }
+        g.setStroke( s );
     }
 
     @Override