in progress (special coloring is still true)
[jalview.git] / forester / java / src / org / forester / archaeopteryx / TreePanel.java
index 971afb3..c33ad4e 100644 (file)
@@ -136,6 +136,7 @@ import org.forester.util.TaxonomyUtil;
 
 public final class TreePanel extends JPanel implements ActionListener, MouseWheelListener, Printable {
 
+    public final static boolean          SPECIAL_DOMAIN_COLORING                            = true;
     final static Cursor                  ARROW_CURSOR                                       = Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR );
     final static Cursor                  CUT_CURSOR                                         = Cursor.getPredefinedCursor( Cursor.CROSSHAIR_CURSOR );
     final static Cursor                  HAND_CURSOR                                        = Cursor.getPredefinedCursor( Cursor.HAND_CURSOR );
@@ -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 {
@@ -1980,16 +1988,13 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
 
     final void sortDescendants( final PhylogenyNode node ) {
         if ( !node.isExternal() ) {
-            DESCENDANT_SORT_PRIORITY pri = DESCENDANT_SORT_PRIORITY.TAXONOMY;
-            if ( ( !getControlPanel().isShowTaxonomyScientificNames() && !getControlPanel().isShowTaxonomyCode() && !getControlPanel()
-                    .isShowTaxonomyCommonNames() ) ) {
-                if ( ( getControlPanel().isShowSequenceAcc() || getControlPanel().isShowSeqNames() || getControlPanel()
-                        .isShowSeqSymbols() ) ) {
-                    pri = DESCENDANT_SORT_PRIORITY.SEQUENCE;
-                }
-                else if ( getControlPanel().isShowNodeNames() ) {
-                    pri = DESCENDANT_SORT_PRIORITY.NODE_NAME;
-                }
+            DESCENDANT_SORT_PRIORITY pri = DESCENDANT_SORT_PRIORITY.NODE_NAME;
+            if ( getControlPanel().isShowTaxonomyScientificNames() || getControlPanel().isShowTaxonomyCode() ) {
+                pri = DESCENDANT_SORT_PRIORITY.TAXONOMY;
+            }
+            else if ( getControlPanel().isShowSeqNames() || getControlPanel().isShowSeqSymbols()
+                    || getControlPanel().isShowGeneNames() ) {
+                pri = DESCENDANT_SORT_PRIORITY.SEQUENCE;
             }
             PhylogenyMethods.sortNodeDescendents( node, pri );
             setNodeInPreorderToNull();
@@ -2468,6 +2473,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                 getControlPanel().getUseVisualStylesCb().setSelected( true );
             }
         }
+        setEdited( true );
         repaint();
     }
 
@@ -2522,6 +2528,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
             al = new NodeColorizationActionListener( _color_chooser, node );
         }
         final JDialog dialog = JColorChooser.createDialog( this, "Node colorization", true, _color_chooser, al, null );
+        setEdited( true );
         dialog.setVisible( true );
     }
 
@@ -2544,6 +2551,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
         }
         final JDialog dialog = JColorChooser
                 .createDialog( this, "Subtree colorization", true, _color_chooser, al, null );
+        setEdited( true );
         dialog.setVisible( true );
     }
 
@@ -4158,6 +4166,9 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
         if ( ( isInFoundNodes( node ) || isInCurrentExternalNodes( node ) )
                 || ( getOptions().isShowDefaultNodeShapesExternal() && node.isExternal() )
                 || ( getOptions().isShowDefaultNodeShapesInternal() && node.isInternal() )
+                || ( getOptions().isShowDefaultNodeShapesForMarkedNodes()
+                        && ( node.getNodeData().getNodeVisualData() != null ) && ( !node.getNodeData()
+                        .getNodeVisualData().isEmpty() ) )
                 || ( getControlPanel().isUseVisualStyles() && ( ( node.getNodeData().getNodeVisualData() != null ) && ( ( node
                         .getNodeData().getNodeVisualData().getNodeColor() != null )
                         || ( node.getNodeData().getNodeVisualData().getSize() != NodeVisualData.DEFAULT_SIZE )