special domain coloring
[jalview.git] / forester / java / src / org / forester / archaeopteryx / TreePanel.java
index ce136b5..df7306b 100644 (file)
@@ -173,7 +173,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
     private static final BasicStroke     STROKE_2                                           = new BasicStroke( 2f );
     private static final double          TWO_PI                                             = 2 * Math.PI;
     private final static int             WIGGLE                                             = 2;
-    private static final String          SHOW_ONLY_THIS_CONF_TYPE                           = "posterior probability";                                  //TODO remove me
+    private static final String          SHOW_ONLY_THIS_CONF_TYPE                           = null;                                                     //TODO remove me
     HashMap<Long, Short>                 _nodeid_dist_to_leaf                               = new HashMap<Long, Short>();
     final private Arc2D                  _arc                                               = new Arc2D.Double();
     private AffineTransform              _at;
@@ -255,6 +255,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
     private float                        _y_distance                                        = 0.0f;
     private int                          _length_of_longest_text;
     private int                          _longest_domain;
+    public final static boolean          SPECIAL_DOMAIN_COLORING                            = true;
     //  private Image                           offscreenImage;
     //  private Graphics                        offscreenGraphics;
     //  private Dimension                       offscreenDimension;
@@ -1045,7 +1046,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
     }
 
     final Color getTaxonomyBasedColor( final PhylogenyNode node ) {
-        if ( node.getNodeData().isHasTaxonomy() ) {
+        if ( node.isExternal() && node.getNodeData().isHasTaxonomy() ) {
             return calculateTaxonomyBasedColor( node.getNodeData().getTaxonomy() );
         }
         // return non-colorized color
@@ -1096,7 +1097,14 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                     && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {
                 RenderableDomainArchitecture rds = null;
                 if ( !( node.getNodeData().getSequence().getDomainArchitecture() instanceof RenderableDomainArchitecture ) ) {
-                    rds = new RenderableDomainArchitecture( node.getNodeData().getSequence().getDomainArchitecture() );
+                    if ( SPECIAL_DOMAIN_COLORING ) {
+                        rds = new RenderableDomainArchitecture( node.getNodeData().getSequence()
+                                .getDomainArchitecture(), node.getName() );
+                    }
+                    else {
+                        rds = new RenderableDomainArchitecture( node.getNodeData().getSequence()
+                                .getDomainArchitecture() );
+                    }
                     node.getNodeData().getSequence().setDomainArchitecture( rds );
                 }
                 else {