in progress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / ControlPanel.java
index f617f24..509e24d 100644 (file)
@@ -91,10 +91,12 @@ final class ControlPanel extends JPanel implements ActionListener {
     private List<String>         _click_to_names;
     private int                  _collapse_cb_item;
     private JCheckBox            _color_acc_species;
+    private JCheckBox            _color_acc_sequence;
     private JCheckBox            _color_according_to_annotation;
     private boolean              _color_branches;
-    private JCheckBox            _color_branches_cb;
+    private JCheckBox            _use_visual_styles_cb;
     private int                  _color_subtree_cb_item;
+    private int                  _change_node_font_item;
     // The settings from the conf file
     private final Configuration  _configuration;
     private int                  _copy_subtree_item;
@@ -116,14 +118,19 @@ final class ControlPanel extends JPanel implements ActionListener {
     private int                  _open_pdb_item;
     private int                  _open_seq_web_item;
     private int                  _open_tax_web_item;
+    private int                  _color_node_font_item;
     private JButton              _order;
     private boolean              _order_of_appearance;
     private int                  _paste_subtree_item;
     private int                  _reroot_cb_item;
     private JButton              _return_to_super_tree;
-    private JLabel               _search_found_label;
-    private JButton              _search_reset_button;
-    private JTextField           _search_tf;
+    // Search 
+    private JLabel               _search_found_label_0;
+    private JLabel               _search_found_label_1;
+    private JButton              _search_reset_button_0;
+    private JButton              _search_reset_button_1;
+    private JTextField           _search_tf_0;
+    private JTextField           _search_tf_1;
     private int                  _select_nodes_item;
     private Sequence             _selected_query_seq;
     private JCheckBox            _seq_relation_confidence_switch;
@@ -150,6 +157,7 @@ final class ControlPanel extends JPanel implements ActionListener {
     private JButton              _show_whole;
     private int                  _sort_descendents_item;
     private Map<String, Color>   _species_colors;
+    private Map<String, Color>   _sequence_colors;
     private int                  _subtree_cb_item;
     private int                  _swap_cb_item;
     private JButton              _uncollapse_all;
@@ -183,6 +191,19 @@ final class ControlPanel extends JPanel implements ActionListener {
     @Override
     public void actionPerformed( final ActionEvent e ) {
         try {
+            if ( e.getSource() == _color_acc_sequence ) {
+                if ( _color_acc_species != null  ) {
+                    _color_acc_species.setSelected( false );
+                }
+             }
+            else if ( e.getSource() == _color_acc_species ) {
+                if ( _color_acc_sequence != null  ) {
+                    _color_acc_sequence.setSelected( false );
+                }
+                
+            }
+            
+            
             final TreePanel tp = getMainPanel().getCurrentTreePanel();
             if ( tp == null ) {
                 return;
@@ -204,7 +225,8 @@ final class ControlPanel extends JPanel implements ActionListener {
                 displayedPhylogenyMightHaveChanged( true );
             }
             else if ( e.getSource() == _show_domain_architectures ) {
-                search();
+                search0();
+                search1();
                 displayedPhylogenyMightHaveChanged( true );
             }
             else if ( ( tp != null ) && ( tp.getPhylogeny() != null ) ) {
@@ -276,10 +298,18 @@ final class ControlPanel extends JPanel implements ActionListener {
                     _mainpanel.getCurrentTreePanel().increaseDomainStructureEvalueThreshold();
                     displayedPhylogenyMightHaveChanged( true );
                 }
-                else if ( e.getSource() == _search_tf ) {
-                    search();
+                else if ( e.getSource() == _search_tf_0 ) {
+                    search0();
+                    displayedPhylogenyMightHaveChanged( true );
+                }
+                else if ( e.getSource() == _search_tf_1 ) {
+                    search1();
                     displayedPhylogenyMightHaveChanged( true );
                 }
+                
+              
+                
+                
                 else {
                     displayedPhylogenyMightHaveChanged( true );
                 }
@@ -299,9 +329,13 @@ final class ControlPanel extends JPanel implements ActionListener {
     public JCheckBox getColorAccSpeciesCb() {
         return _color_acc_species;
     }
+    
+    public JCheckBox getColorAccSequenceCb() {
+        return _color_acc_sequence;
+    }
 
-    public JCheckBox getColorBranchesCb() {
-        return _color_branches_cb;
+    public JCheckBox getUseVisualStylesCb() {
+        return _use_visual_styles_cb;
     }
 
     public JCheckBox getDisplayAsPhylogramCb() {
@@ -521,10 +555,17 @@ final class ControlPanel extends JPanel implements ActionListener {
             case Configuration.color_according_to_species:
                 _color_acc_species = new JCheckBox( title );
                 _color_acc_species
-                        .setToolTipText( "To colorize taxonomy and sequence labels as a function of taxonomy" );
+                        .setToolTipText( "To colorize node labels as a function of taxonomy" );
                 addJCheckBox( _color_acc_species, ch_panel );
                 add( ch_panel );
                 break;
+            case Configuration.color_according_to_sequence:
+                _color_acc_sequence = new JCheckBox( title );
+                _color_acc_sequence
+                        .setToolTipText( "To colorize node labels as a function of sequence name" );
+                addJCheckBox( _color_acc_sequence, ch_panel );
+                add( ch_panel );
+                break;
             case Configuration.color_according_to_annotation:
                 _color_according_to_annotation = new JCheckBox( title );
                 _color_according_to_annotation
@@ -582,10 +623,11 @@ final class ControlPanel extends JPanel implements ActionListener {
                 addJCheckBox( getShowEventsCb(), ch_panel );
                 add( ch_panel );
                 break;
-            case Configuration.color_branches:
-                _color_branches_cb = new JCheckBox( title );
-                getColorBranchesCb().setToolTipText( "To use branch color values, if present" );
-                addJCheckBox( getColorBranchesCb(), ch_panel );
+            case Configuration.use_style:
+                _use_visual_styles_cb = new JCheckBox( title );
+                getUseVisualStylesCb()
+                        .setToolTipText( "To use visual styles (node colors, fonts) and branch colors, if present" );
+                addJCheckBox( getUseVisualStylesCb(), ch_panel );
                 add( ch_panel );
                 break;
             case Configuration.width_branches:
@@ -747,16 +789,28 @@ final class ControlPanel extends JPanel implements ActionListener {
         return getMainPanel().getOptions();
     }
 
-    JLabel getSearchFoundCountsLabel() {
-        return _search_found_label;
+    JLabel getSearchFoundCountsLabel0() {
+        return _search_found_label_0;
     }
 
-    JButton getSearchResetButton() {
-        return _search_reset_button;
+    JLabel getSearchFoundCountsLabel1() {
+        return _search_found_label_1;
     }
 
-    JTextField getSearchTextField() {
-        return _search_tf;
+    JButton getSearchResetButton0() {
+        return _search_reset_button_0;
+    }
+
+    JButton getSearchResetButton1() {
+        return _search_reset_button_1;
+    }
+
+    JTextField getSearchTextField0() {
+        return _search_tf_0;
+    }
+
+    JTextField getSearchTextField1() {
+        return _search_tf_1;
     }
 
     List<String> getSingleClickToNames() {
@@ -766,6 +820,10 @@ final class ControlPanel extends JPanel implements ActionListener {
     Map<String, Color> getSpeciesColors() {
         return _species_colors;
     }
+    
+    Map<String, Color> getSequenceColors() {
+        return _sequence_colors;
+    }
 
     boolean isAntialiasScreenText() {
         return true;
@@ -778,9 +836,13 @@ final class ControlPanel extends JPanel implements ActionListener {
     boolean isColorAccordingToTaxonomy() {
         return ( ( _color_acc_species != null ) && _color_acc_species.isSelected() );
     }
+    
+    boolean isColorAccordingToSequence() {
+        return ( ( _color_acc_sequence != null ) && _color_acc_sequence.isSelected() );
+    }
 
-    boolean isColorBranches() {
-        return ( ( ( getColorBranchesCb() != null ) && getColorBranchesCb().isSelected() ) || ( ( getColorBranchesCb() == null ) && _color_branches ) );
+    boolean isUseVisualStyles() {
+        return ( ( ( getUseVisualStylesCb() != null ) && getUseVisualStylesCb().isSelected() ) || ( ( getUseVisualStylesCb() == null ) && _color_branches ) );
     }
 
     boolean isDrawPhylogram() {
@@ -875,36 +937,57 @@ final class ControlPanel extends JPanel implements ActionListener {
         getIsDrawPhylogramList().remove( index );
     }
 
-    void search() {
+    void search0() {
         final MainPanel main_panel = getMainPanel();
         final Phylogeny tree = main_panel.getCurrentPhylogeny();
         if ( ( tree == null ) || tree.isEmpty() ) {
             return;
         }
-        String query = getSearchTextField().getText();
+        String query = getSearchTextField0().getText();
         if ( query != null ) {
             query = query.trim();
         }
+        if ( !ForesterUtil.isEmpty( query ) ) {
+            search0( main_panel, tree, query );
+        }
         else {
-            getSearchFoundCountsLabel().setVisible( false );
-            getSearchResetButton().setEnabled( false );
-            getSearchResetButton().setVisible( false );
-            searchReset();
+            getSearchFoundCountsLabel0().setVisible( false );
+            getSearchResetButton0().setEnabled( false );
+            getSearchResetButton0().setVisible( false );
+            searchReset0();
+        }
+    }
+
+    void search1() {
+        final MainPanel main_panel = getMainPanel();
+        final Phylogeny tree = main_panel.getCurrentPhylogeny();
+        if ( ( tree == null ) || tree.isEmpty() ) {
+            return;
+        }
+        String query = getSearchTextField1().getText();
+        if ( query != null ) {
+            query = query.trim();
         }
         if ( !ForesterUtil.isEmpty( query ) ) {
-            search( main_panel, tree, query );
+            search1( main_panel, tree, query );
         }
         else {
-            getSearchFoundCountsLabel().setVisible( false );
-            getSearchResetButton().setEnabled( false );
-            getSearchResetButton().setVisible( false );
-            searchReset();
+            getSearchFoundCountsLabel1().setVisible( false );
+            getSearchResetButton1().setEnabled( false );
+            getSearchResetButton1().setVisible( false );
+            searchReset1();
+        }
+    }
+
+    void searchReset0() {
+        if ( getMainPanel().getCurrentTreePanel() != null ) {
+            getMainPanel().getCurrentTreePanel().setFoundNodes0( null );
         }
     }
 
-    void searchReset() {
+    void searchReset1() {
         if ( getMainPanel().getCurrentTreePanel() != null ) {
-            getMainPanel().getCurrentTreePanel().setFoundNodes( null );
+            getMainPanel().getCurrentTreePanel().setFoundNodes1( null );
         }
     }
 
@@ -933,6 +1016,11 @@ final class ControlPanel extends JPanel implements ActionListener {
                     _color_acc_species.setSelected( state );
                 }
                 break;
+            case Configuration.color_according_to_sequence:
+                if ( _color_acc_sequence != null ) {
+                    _color_acc_sequence.setSelected( state );
+                }
+                break;
             case Configuration.color_according_to_annotation:
                 if ( _color_according_to_annotation != null ) {
                     _color_according_to_annotation.setSelected( state );
@@ -988,9 +1076,9 @@ final class ControlPanel extends JPanel implements ActionListener {
                     getShowEventsCb().setSelected( state );
                 }
                 break;
-            case Configuration.color_branches:
-                if ( getColorBranchesCb() != null ) {
-                    getColorBranchesCb().setSelected( state );
+            case Configuration.use_style:
+                if ( getUseVisualStylesCb() != null ) {
+                    getUseVisualStylesCb().setSelected( state );
                 }
                 break;
             case Configuration.width_branches:
@@ -1124,6 +1212,12 @@ final class ControlPanel extends JPanel implements ActionListener {
         else if ( action == _open_pdb_item ) {
             setActionWhenNodeClicked( NodeClickAction.OPEN_PDB_WEB );
         }
+        else if ( action == _color_node_font_item ) {
+            setActionWhenNodeClicked( NodeClickAction.COLOR_NODE_FONT );
+        }
+        else if ( action == _change_node_font_item ) {
+            setActionWhenNodeClicked( NodeClickAction.CHANGE_NODE_FONT );
+        }
         else {
             throw new RuntimeException( "unknown action: " + action );
         }
@@ -1161,8 +1255,12 @@ final class ControlPanel extends JPanel implements ActionListener {
         // }
     }
 
-    void setSearchFoundCountsOnLabel( final int counts ) {
-        getSearchFoundCountsLabel().setText( "Found: " + counts );
+    void setSearchFoundCountsOnLabel0( final int counts ) {
+        getSearchFoundCountsLabel0().setText( "Found: " + counts );
+    }
+
+    void setSearchFoundCountsOnLabel1( final int counts ) {
+        getSearchFoundCountsLabel1().setText( "Found: " + counts );
     }
 
     void setShowEvents( final boolean show_events ) {
@@ -1175,6 +1273,10 @@ final class ControlPanel extends JPanel implements ActionListener {
     void setSpeciesColors( final Map<String, Color> species_colors ) {
         _species_colors = species_colors;
     }
+    
+    void setSequenceColors( final Map<String, Color> sequence_colors ) {
+        _sequence_colors = sequence_colors;
+    }
 
     /* GUILHEM_END */
     /*
@@ -1195,7 +1297,8 @@ final class ControlPanel extends JPanel implements ActionListener {
         endClickToOptions();
         // Zoom and quick edit buttons
         addButtons();
-        setupSearchTools();
+        setupSearchTools0();
+        setupSearchTools1();
     }
 
     void setUpControlsForDomainStrucures() {
@@ -1234,33 +1337,33 @@ final class ControlPanel extends JPanel implements ActionListener {
         addJButton( _incr_domain_structure_evalue_thr, d2_panel );
     }
 
-    void setupSearchTools() {
+    void setupSearchTools0() {
         final String tip = "Enter text to search for. Use ',' for multiple searches (logical OR) and '+' for logical AND.";
-        final JLabel search_label = new JLabel( "Search:" );
+        final JLabel search_label = new JLabel( "Search (A):" );
         search_label.setFont( ControlPanel.jcb_bold_font );
         if ( !getConfiguration().isUseNativeUI() ) {
             search_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
         }
         add( search_label );
         search_label.setToolTipText( tip );
-        _search_found_label = new JLabel();
-        getSearchFoundCountsLabel().setVisible( false );
-        _search_found_label.setFont( ControlPanel.jcb_bold_font );
+        _search_found_label_0 = new JLabel();
+        getSearchFoundCountsLabel0().setVisible( false );
+        _search_found_label_0.setFont( ControlPanel.jcb_bold_font );
         if ( !getConfiguration().isUseNativeUI() ) {
-            _search_found_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+            _search_found_label_0.setForeground( getConfiguration().getGuiCheckboxTextColor() );
         }
-        _search_tf = new JTextField( 3 );
-        _search_tf.setToolTipText( tip );
-        _search_tf.setEditable( true );
+        _search_tf_0 = new JTextField( 3 );
+        _search_tf_0.setToolTipText( tip );
+        _search_tf_0.setEditable( true );
         if ( !getConfiguration().isUseNativeUI() ) {
-            _search_tf.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
-            _search_tf.setBackground( getConfiguration().getGuiCheckboxTextColor() );
-            _search_tf.setBorder( null );
-        }
-        _search_reset_button = new JButton();
-        getSearchResetButton().setText( "Reset" );
-        getSearchResetButton().setEnabled( false );
-        getSearchResetButton().setVisible( false );
+            _search_tf_0.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
+            _search_tf_0.setBackground( getConfiguration().getGuiCheckboxTextColor() );
+            _search_tf_0.setBorder( null );
+        }
+        _search_reset_button_0 = new JButton();
+        getSearchResetButton0().setText( "Reset" );
+        getSearchResetButton0().setEnabled( false );
+        getSearchResetButton0().setVisible( false );
         final JPanel s_panel_1 = new JPanel( new BorderLayout() );
         final JPanel s_panel_2 = new JPanel( new GridLayout( 1, 2, 0, 0 ) );
         s_panel_1.setBackground( getBackground() );
@@ -1271,7 +1374,7 @@ final class ControlPanel extends JPanel implements ActionListener {
 
             @Override
             public void keyReleased( final KeyEvent key_event ) {
-                search();
+                search0();
                 displayedPhylogenyMightHaveChanged( true );
             }
         };
@@ -1279,20 +1382,81 @@ final class ControlPanel extends JPanel implements ActionListener {
 
             @Override
             public void actionPerformed( final ActionEvent e ) {
-                searchReset();
-                setSearchFoundCountsOnLabel( 0 );
-                getSearchFoundCountsLabel().setVisible( false );
-                getSearchTextField().setText( "" );
-                getSearchResetButton().setEnabled( false );
-                getSearchResetButton().setVisible( false );
+                searchReset0();
+                setSearchFoundCountsOnLabel0( 0 );
+                getSearchFoundCountsLabel0().setVisible( false );
+                getSearchTextField0().setText( "" );
+                getSearchResetButton0().setEnabled( false );
+                getSearchResetButton0().setVisible( false );
                 displayedPhylogenyMightHaveChanged( true );
             }
         };
-        _search_reset_button.addActionListener( action_listener );
-        _search_tf.addKeyListener( key_adapter );
-        addJTextField( _search_tf, s_panel_1 );
-        s_panel_2.add( _search_found_label );
-        addJButton( _search_reset_button, s_panel_2 );
+        _search_reset_button_0.addActionListener( action_listener );
+        _search_tf_0.addKeyListener( key_adapter );
+        addJTextField( _search_tf_0, s_panel_1 );
+        s_panel_2.add( _search_found_label_0 );
+        addJButton( _search_reset_button_0, s_panel_2 );
+    }
+
+    void setupSearchTools1() {
+        final String tip = "Enter text to search for. Use ',' for multiple searches (logical OR) and '+' for logical AND.";
+        final JLabel search_label = new JLabel( "Search (B):" );
+        search_label.setFont( ControlPanel.jcb_bold_font );
+        if ( !getConfiguration().isUseNativeUI() ) {
+            search_label.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+        }
+        add( search_label );
+        search_label.setToolTipText( tip );
+        _search_found_label_1 = new JLabel();
+        getSearchFoundCountsLabel1().setVisible( false );
+        _search_found_label_1.setFont( ControlPanel.jcb_bold_font );
+        if ( !getConfiguration().isUseNativeUI() ) {
+            _search_found_label_1.setForeground( getConfiguration().getGuiCheckboxTextColor() );
+        }
+        _search_tf_1 = new JTextField( 3 );
+        _search_tf_1.setToolTipText( tip );
+        _search_tf_1.setEditable( true );
+        if ( !getConfiguration().isUseNativeUI() ) {
+            _search_tf_1.setForeground( getConfiguration().getGuiMenuBackgroundColor() );
+            _search_tf_1.setBackground( getConfiguration().getGuiCheckboxTextColor() );
+            _search_tf_1.setBorder( null );
+        }
+        _search_reset_button_1 = new JButton();
+        getSearchResetButton1().setText( "Reset" );
+        getSearchResetButton1().setEnabled( false );
+        getSearchResetButton1().setVisible( false );
+        final JPanel s_panel_1 = new JPanel( new BorderLayout() );
+        final JPanel s_panel_2 = new JPanel( new GridLayout( 1, 2, 0, 0 ) );
+        s_panel_1.setBackground( getBackground() );
+        add( s_panel_1 );
+        s_panel_2.setBackground( getBackground() );
+        add( s_panel_2 );
+        final KeyAdapter key_adapter = new KeyAdapter() {
+
+            @Override
+            public void keyReleased( final KeyEvent key_event ) {
+                search1();
+                displayedPhylogenyMightHaveChanged( true );
+            }
+        };
+        final ActionListener action_listener = new ActionListener() {
+
+            @Override
+            public void actionPerformed( final ActionEvent e ) {
+                searchReset1();
+                setSearchFoundCountsOnLabel1( 0 );
+                getSearchFoundCountsLabel1().setVisible( false );
+                getSearchTextField1().setText( "" );
+                getSearchResetButton1().setEnabled( false );
+                getSearchResetButton1().setVisible( false );
+                displayedPhylogenyMightHaveChanged( true );
+            }
+        };
+        _search_reset_button_1.addActionListener( action_listener );
+        _search_tf_1.addKeyListener( key_adapter );
+        addJTextField( _search_tf_1, s_panel_1 );
+        s_panel_2.add( _search_found_label_1 );
+        addJButton( _search_reset_button_1, s_panel_2 );
     }
 
     void showAnnotations() {
@@ -1305,6 +1469,9 @@ final class ControlPanel extends JPanel implements ActionListener {
         if ( _color_acc_species != null ) {
             _color_acc_species.setSelected( false );
         }
+        if ( _color_acc_sequence != null ) {
+            _color_acc_sequence.setSelected( false );
+        }
         _mainpanel.getCurrentTreePanel().repaint();
     }
 
@@ -1394,7 +1561,8 @@ final class ControlPanel extends JPanel implements ActionListener {
                         .getPhylogenyGraphicsType() );
             }
             getMainPanel().getCurrentTreePanel().updateSubSuperTreeButton();
-            getMainPanel().getControlPanel().search();
+            getMainPanel().getControlPanel().search0();
+            getMainPanel().getControlPanel().search1();
             getMainPanel().getControlPanel().updateDomainStructureEvaluethresholdDisplay();
             getSequenceRelationTypeBox().removeAllItems();
             for( final SequenceRelation.SEQUENCE_RELATION_TYPE type : getMainPanel().getCurrentPhylogeny()
@@ -1603,6 +1771,7 @@ final class ControlPanel extends JPanel implements ActionListener {
     private void init() {
         _draw_phylogram = new ArrayList<Boolean>();
         setSpeciesColors( new HashMap<String, Color>() );
+        setSequenceColors( new HashMap<String, Color>() );
         setAnnotationColors( new HashMap<String, Color>() );
     }
 
@@ -1610,10 +1779,64 @@ final class ControlPanel extends JPanel implements ActionListener {
         return getIsDrawPhylogramList().get( index );
     }
 
-    private void search( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
-        getSearchFoundCountsLabel().setVisible( true );
-        getSearchResetButton().setEnabled( true );
-        getSearchResetButton().setVisible( true );
+    private void search0( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
+        getSearchFoundCountsLabel0().setVisible( true );
+        getSearchResetButton0().setEnabled( true );
+        getSearchResetButton0().setVisible( true );
+        String[] queries = null;
+        List<PhylogenyNode> nodes = null;
+        if ( query_str.indexOf( ',' ) >= 0 ) {
+            queries = query_str.split( ",+" );
+        }
+        else {
+            queries = new String[ 1 ];
+            queries[ 0 ] = query_str.trim();
+        }
+        if ( ( queries != null ) && ( queries.length > 0 ) ) {
+            nodes = new ArrayList<PhylogenyNode>();
+            for( String query : queries ) {
+                if ( ForesterUtil.isEmpty( query ) ) {
+                    continue;
+                }
+                query = query.trim();
+                if ( query.indexOf( '+' ) >= 0 ) {
+                    nodes.addAll( PhylogenyMethods.searchDataLogicalAnd( query.split( "\\++" ),
+                                                                         tree,
+                                                                         getOptions().isSearchCaseSensitive(),
+                                                                         !getOptions().isMatchWholeTermsOnly(),
+                                                                         isShowDomainArchitectures() ) );
+                }
+                else {
+                    nodes.addAll( PhylogenyMethods.searchData( query,
+                                                               tree,
+                                                               getOptions().isSearchCaseSensitive(),
+                                                               !getOptions().isMatchWholeTermsOnly(),
+                                                               isShowDomainArchitectures() ) );
+                }
+            }
+            if ( getOptions().isInverseSearchResult() ) {
+                final List<PhylogenyNode> all = PhylogenyMethods.obtainAllNodesAsList( tree );
+                all.removeAll( nodes );
+                nodes = all;
+            }
+        }
+        if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
+            main_panel.getCurrentTreePanel().setFoundNodes0( new HashSet<Long>() );
+            for( final PhylogenyNode node : nodes ) {
+                main_panel.getCurrentTreePanel().getFoundNodes0().add( node.getId() );
+            }
+            setSearchFoundCountsOnLabel0( nodes.size() );
+        }
+        else {
+            setSearchFoundCountsOnLabel0( 0 );
+            searchReset0();
+        }
+    }
+
+    private void search1( final MainPanel main_panel, final Phylogeny tree, final String query_str ) {
+        getSearchFoundCountsLabel1().setVisible( true );
+        getSearchResetButton1().setEnabled( true );
+        getSearchResetButton1().setVisible( true );
         String[] queries = null;
         List<PhylogenyNode> nodes = null;
         if ( query_str.indexOf( ',' ) >= 0 ) {
@@ -1652,15 +1875,15 @@ final class ControlPanel extends JPanel implements ActionListener {
             }
         }
         if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
-            main_panel.getCurrentTreePanel().setFoundNodes( new HashSet<Long>() );
+            main_panel.getCurrentTreePanel().setFoundNodes1( new HashSet<Long>() );
             for( final PhylogenyNode node : nodes ) {
-                main_panel.getCurrentTreePanel().getFoundNodes().add( node.getId() );
+                main_panel.getCurrentTreePanel().getFoundNodes1().add( node.getId() );
             }
-            setSearchFoundCountsOnLabel( nodes.size() );
+            setSearchFoundCountsOnLabel1( nodes.size() );
         }
         else {
-            setSearchFoundCountsOnLabel( 0 );
-            searchReset();
+            setSearchFoundCountsOnLabel1( 0 );
+            searchReset1();
         }
     }
 
@@ -1723,6 +1946,24 @@ final class ControlPanel extends JPanel implements ActionListener {
             }
             cb_index++;
         }
+        if ( _configuration.doDisplayClickToOption( Configuration.color_node_font ) ) {
+            _color_node_font_item = cb_index;
+            addClickToOption( Configuration.color_node_font,
+                              _configuration.getClickToTitle( Configuration.color_node_font ) );
+            if ( default_option == Configuration.color_node_font ) {
+                selected_index = cb_index;
+            }
+            cb_index++;
+        }
+        if ( _configuration.doDisplayClickToOption( Configuration.change_node_font ) ) {
+            _change_node_font_item = cb_index;
+            addClickToOption( Configuration.change_node_font,
+                              _configuration.getClickToTitle( Configuration.change_node_font ) );
+            if ( default_option == Configuration.change_node_font ) {
+                selected_index = cb_index;
+            }
+            cb_index++;
+        }
         if ( _configuration.doDisplayClickToOption( Configuration.color_subtree ) ) {
             _color_subtree_cb_item = cb_index;
             addClickToOption( Configuration.color_subtree, _configuration.getClickToTitle( Configuration.color_subtree ) );
@@ -1905,6 +2146,18 @@ final class ControlPanel extends JPanel implements ActionListener {
             setCheckbox( Configuration.display_internal_data,
                          _configuration.doCheckOption( Configuration.display_internal_data ) );
         }
+        
+        
+        if ( _configuration.doDisplayOption( Configuration.color_according_to_sequence ) ) {
+            addCheckbox( Configuration.color_according_to_sequence,
+                         _configuration.getDisplayTitle( Configuration.color_according_to_sequence ) );
+            setCheckbox( Configuration.color_according_to_sequence,
+                         _configuration.doCheckOption( Configuration.color_according_to_sequence ) );
+        }
+        
+        
+        
+        
         if ( _configuration.doDisplayOption( Configuration.color_according_to_species ) ) {
             addCheckbox( Configuration.color_according_to_species,
                          _configuration.getDisplayTitle( Configuration.color_according_to_species ) );
@@ -1917,9 +2170,9 @@ final class ControlPanel extends JPanel implements ActionListener {
             setCheckbox( Configuration.color_according_to_annotation,
                          _configuration.doCheckOption( Configuration.color_according_to_annotation ) );
         }
-        if ( _configuration.doDisplayOption( Configuration.color_branches ) ) {
-            addCheckbox( Configuration.color_branches, _configuration.getDisplayTitle( Configuration.color_branches ) );
-            setCheckbox( Configuration.color_branches, _configuration.doCheckOption( Configuration.color_branches ) );
+        if ( _configuration.doDisplayOption( Configuration.use_style ) ) {
+            addCheckbox( Configuration.use_style, _configuration.getDisplayTitle( Configuration.use_style ) );
+            setCheckbox( Configuration.use_style, _configuration.doCheckOption( Configuration.use_style ) );
         }
         if ( _configuration.doDisplayOption( Configuration.width_branches ) ) {
             addCheckbox( Configuration.width_branches, _configuration.getDisplayTitle( Configuration.width_branches ) );
@@ -2068,6 +2321,8 @@ final class ControlPanel extends JPanel implements ActionListener {
         SHOW_DATA,
         SORT_DESCENDENTS,
         SUBTREE,
-        SWAP;
+        SWAP,
+        CHANGE_NODE_FONT,
+        COLOR_NODE_FONT;
     }
 }