in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Mon, 13 Oct 2014 19:40:19 +0000 (19:40 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Mon, 13 Oct 2014 19:40:19 +0000 (19:40 +0000)
forester/java/src/org/forester/archaeopteryx/Configuration.java
forester/java/src/org/forester/archaeopteryx/TreePanel.java

index da1bdc4..7d6aff2 100644 (file)
@@ -254,6 +254,7 @@ public final class Configuration {
     private int                             _vector_data_width                                     = 120;
     private boolean                         _line_up_renderable_node_data                          = true;
     private boolean                         _right_align_domains                                   = false;
+    private boolean                         _allow_thick_strokes                                   = false;
     static {
         for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) {
             if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) {
@@ -1523,6 +1524,9 @@ public final class Configuration {
         else if ( key.equals( "right_align_domain_architectures" ) ) {
             setRightLineUpDomains( parseBoolean( ( String ) st.nextElement() ) );
         }
+        else if ( key.equals( "allow_thick_strokes" ) ) {
+            _allow_thick_strokes = parseBoolean( ( String ) st.nextElement() );
+        }
         else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
             // yet retrieved!
             int key_index = -1;
@@ -1792,4 +1796,8 @@ public final class Configuration {
     private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
         _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
     }
+
+    public boolean isAllowThickStrokes() {
+        return _allow_thick_strokes;
+    }
 }
index 15fe777..0f04f1e 100644 (file)
@@ -165,6 +165,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                                                                                                         12 );
     private static final float           ROUNDED_D                                          = 8;
     private final static long            serialVersionUID                                   = -978349745916505029L;
+    private static final BasicStroke     STROKE_0025                                        = new BasicStroke( 0.025f );
     private static final BasicStroke     STROKE_005                                         = new BasicStroke( 0.05f );
     private static final BasicStroke     STROKE_01                                          = new BasicStroke( 0.1f );
     private static final BasicStroke     STROKE_025                                         = new BasicStroke( 0.25f );
@@ -5421,6 +5422,9 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
     }
 
     private final void setupStroke( final Graphics2D g ) {
+        if ( getYdistance() < 0.0001 ) {
+            g.setStroke( STROKE_0025 );
+        }
         if ( getYdistance() < 0.001 ) {
             g.setStroke( STROKE_005 );
         }
@@ -5436,7 +5440,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
         else if ( getYdistance() < 2 ) {
             g.setStroke( STROKE_075 );
         }
-        else if ( getYdistance() < 20 ) {
+        else if ( ( getYdistance() < 20 ) || !getConfiguration().isAllowThickStrokes() ) {
             g.setStroke( STROKE_1 );
         }
         else {