(no commit message)
[jalview.git] / forester / java / src / org / forester / archaeopteryx / ArchaeopteryxE.java
index 2796e00..68671ef 100644 (file)
@@ -115,6 +115,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
     private JCheckBoxMenuItem           _search_case_senstive_cbmi;
     private JCheckBoxMenuItem           _search_whole_words_only_cbmi;
     private JCheckBoxMenuItem           _inverse_search_result_cbmi;
+    private JCheckBoxMenuItem           _search_with_regex_cbmi;
     private JCheckBoxMenuItem           _show_overview_cbmi;
     private JMenuItem                   _choose_minimal_confidence_mi;
     private JMenuItem                   _collapse_species_specific_subtrees;
@@ -251,6 +252,9 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
             getMainPanel().getControlPanel().search1();
         }
         else if ( o == _search_whole_words_only_cbmi ) {
+            if ( ( _search_with_regex_cbmi != null ) && _search_whole_words_only_cbmi.isSelected() ) {
+                _search_with_regex_cbmi.setSelected( false );
+            }
             updateOptions( getOptions() );
             getMainPanel().getControlPanel().search0();
             getMainPanel().getControlPanel().search1();
@@ -260,6 +264,17 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
             getMainPanel().getControlPanel().search0();
             getMainPanel().getControlPanel().search1();
         }
+        else if ( o == _search_with_regex_cbmi ) {
+            if ( ( _search_whole_words_only_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+                _search_whole_words_only_cbmi.setSelected( false );
+            }
+            if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+                _search_case_senstive_cbmi.setSelected( true );
+            }
+            updateOptions( getOptions() );
+            getMainPanel().getControlPanel().search0();
+            getMainPanel().getControlPanel().search1();
+        }
         else if ( o == _show_scale_cbmi ) {
             updateOptions( getOptions() );
         }
@@ -377,7 +392,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
      * has been selected by the user by clicking the "Return ..."
      * menu item. This method is expected to be called from Javascript or
      * something like it.
-     * 
+     *
      * @return current external node data as String
      */
     public String getCurrentExternalNodesDataBuffer() {
@@ -394,7 +409,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
 
     /**
      * This method returns the current phylogeny as a string in the chosen format
-     * 
+     *
      * @param format must be NH, NHX, NEXUS or PHYLOXML
      * @return the phylogeny string
      * @author Herve Menager
@@ -421,10 +436,10 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
     }
 
     /**
-     * This method returns a view of the current phylogeny in a chosen 
+     * This method returns a view of the current phylogeny in a chosen
      * graphics format, base64-encoded in a string so that in can be used
      * from javascript.
-     * 
+     *
      * @param format must be GraphicsExportType (gif, jpg, pdf, png, tif, bmp)
      * @return the phylogeny string
      * @author Herve Menager
@@ -594,10 +609,12 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
                 @Override
                 public void componentResized( final ComponentEvent e ) {
                     if ( getMainPanel().getCurrentTreePanel() != null ) {
-                        getMainPanel().getCurrentTreePanel()
-                                .calcParametersForPainting( getMainPanel().getCurrentTreePanel().getWidth(),
-                                                            getMainPanel().getCurrentTreePanel().getHeight(),
-                                                            getOptions().isAllowFontSizeChange() );
+                        getMainPanel().getCurrentTreePanel().calcParametersForPainting( getMainPanel()
+                                                                                        .getCurrentTreePanel()
+                                                                                        .getWidth(),
+                                                                                        getMainPanel()
+                                                                                        .getCurrentTreePanel()
+                                                                                        .getHeight() );
                     }
                 }
             } );
@@ -759,7 +776,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
         _options_jmenu
                 .add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_EXT ) );
         _options_jmenu
-                .add( _show_default_node_shapes_for_marked_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_EXT ) );
+                .add( _show_default_node_shapes_for_marked_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_MARKED ) );
         _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) );
         if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {
             _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) );
@@ -790,6 +807,8 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
         _options_jmenu
                 .add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_CASE_SENSITIVE_LABEL ) );
         _options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_TERMS_ONLY_LABEL ) );
+        _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
+        _search_with_regex_cbmi.setToolTipText( MainFrame.SEARCH_WITH_REGEX_TIP );
         _options_jmenu
                 .add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( MainFrame.INVERSE_SEARCH_RESULT_LABEL ) );
         customizeJMenuItem( _choose_font_mi );
@@ -823,6 +842,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
         customizeRadioButtonMenuItem( _ext_node_dependent_cladogram_rbmi,
                                       getOptions().getCladogramType() == CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
         customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
+        customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
         customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
@@ -1341,6 +1361,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
                 && _show_confidence_stddev_cbmi.isSelected() );
         options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )
                 && _search_whole_words_only_cbmi.isSelected() );
+        options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );
         options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )
                 && _inverse_search_result_cbmi.isSelected() );
         if ( ( _rectangular_type_cbmi != null ) && _rectangular_type_cbmi.isSelected() ) {