added a close button
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainFrame.java
index 0f4ae3e..4c85a4a 100644 (file)
@@ -94,8 +94,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     final static SequencesFileFilter seqsfilter                              = new SequencesFileFilter();\r
     final static DefaultFilter       defaultfilter                           = new DefaultFilter();\r
     static final String              USE_MOUSEWHEEL_SHIFT_TO_ROTATE          = "In this display type, use mousewheel + Shift to rotate [or A and S]";\r
-    static final String              PHYLOXML_REF_TOOL_TIP                   = Constants.PHYLOXML_REFERENCE;                                                                                                                                                //TODO //FIXME\r
-    static final String              APTX_REF_TOOL_TIP                       = Constants.APTX_REFERENCE;\r
+    static final String              PHYLOXML_REF_TOOL_TIP                   = AptxConstants.PHYLOXML_REFERENCE;                                                                                                                                                //TODO //FIXME\r
+    static final String              APTX_REF_TOOL_TIP                       = AptxConstants.APTX_REFERENCE;\r
     private static final long        serialVersionUID                        = 3655000897845508358L;\r
     final static Font                menu_font                               = new Font( Configuration.getDefaultFontFamilyName(),\r
                                                                                          Font.PLAIN,\r
@@ -253,6 +253,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     JCheckBoxMenuItem                _search_whole_words_only_cbmi;\r
     JCheckBoxMenuItem                _inverse_search_result_cbmi;\r
     JCheckBoxMenuItem                _search_with_regex_cbmi;\r
+    JCheckBoxMenuItem                _color_all_found_nodes_when_coloring_subtree_cbmi;\r
     // type menu:\r
     JMenu                            _type_menu;\r
     JCheckBoxMenuItem                _rectangular_type_cbmi;\r
@@ -534,6 +535,9 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             getMainPanel().getControlPanel().search0();\r
             getMainPanel().getControlPanel().search1();\r
         }\r
+        else if ( o == _color_all_found_nodes_when_coloring_subtree_cbmi ) {\r
+            updateOptions( getOptions() );\r
+        }\r
         else if ( o == _show_scale_cbmi ) {\r
             updateOptions( getOptions() );\r
         }\r
@@ -586,42 +590,42 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }\r
         else if ( o == _help_item ) {\r
             try {\r
-                AptxUtil.openWebsite( Constants.APTX_DOC_SITE, is_applet, applet );\r
+                AptxUtil.openWebsite( AptxConstants.APTX_DOC_SITE, is_applet, applet );\r
             }\r
             catch ( final IOException e1 ) {\r
-                ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );\r
             }\r
         }\r
         else if ( o == _website_item ) {\r
             try {\r
-                AptxUtil.openWebsite( Constants.APTX_WEB_SITE, is_applet, applet );\r
+                AptxUtil.openWebsite( AptxConstants.APTX_WEB_SITE, is_applet, applet );\r
             }\r
             catch ( final IOException e1 ) {\r
-                ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );\r
             }\r
         }\r
         else if ( o == _phyloxml_website_item ) {\r
             try {\r
-                AptxUtil.openWebsite( Constants.PHYLOXML_WEB_SITE, is_applet, applet );\r
+                AptxUtil.openWebsite( AptxConstants.PHYLOXML_WEB_SITE, is_applet, applet );\r
             }\r
             catch ( final IOException e1 ) {\r
-                ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );\r
             }\r
         }\r
         else if ( o == _aptx_ref_item ) {\r
             try {\r
-                AptxUtil.openWebsite( Constants.APTX_REFERENCE_URL, is_applet, applet );\r
+                AptxUtil.openWebsite( AptxConstants.APTX_REFERENCE_URL, is_applet, applet );\r
             }\r
             catch ( final IOException e1 ) {\r
-                ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );\r
             }\r
         }\r
         else if ( o == _phyloxml_ref_item ) {\r
             try {\r
-                AptxUtil.openWebsite( Constants.PHYLOXML_REFERENCE_URL, is_applet, applet );\r
+                AptxUtil.openWebsite( AptxConstants.PHYLOXML_REFERENCE_URL, is_applet, applet );\r
             }\r
             catch ( final IOException e1 ) {\r
-                ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );\r
             }\r
         }\r
         else if ( o == _write_to_pdf_item ) {\r
@@ -1268,10 +1272,10 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                                          + "[current values: "\r
                                                                          + getOptions().getPrintSizeX() + ", "\r
                                                                          + getOptions().getPrintSizeY() + "]\n"\r
-                                                                         + "[A4: " + Constants.A4_SIZE_X + ", "\r
-                                                                         + Constants.A4_SIZE_Y + "]\n" + "[US Letter: "\r
-                                                                         + Constants.US_LETTER_SIZE_X + ", "\r
-                                                                         + Constants.US_LETTER_SIZE_Y + "]",\r
+                                                                         + "[A4: " + AptxConstants.A4_SIZE_X + ", "\r
+                                                                         + AptxConstants.A4_SIZE_Y + "]\n" + "[US Letter: "\r
+                                                                         + AptxConstants.US_LETTER_SIZE_X + ", "\r
+                                                                         + AptxConstants.US_LETTER_SIZE_Y + "]",\r
                                                                  "Default Size for Graphics Export",\r
                                                                  JOptionPane.QUESTION_MESSAGE,\r
                                                                  null,\r
@@ -1970,6 +1974,9 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) {\r
             options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() );\r
         }\r
+        if ( ( _color_all_found_nodes_when_coloring_subtree_cbmi != null ) && _color_all_found_nodes_when_coloring_subtree_cbmi.isEnabled() ) {\r
+            options.setColorAllFoundNodesWhenColoringSubtree( _color_all_found_nodes_when_coloring_subtree_cbmi.isSelected() );\r
+        }\r
     }\r
 \r
     void updateTypeCheckboxes( final Options options, final Object o ) {\r
@@ -2049,11 +2056,11 @@ public abstract class MainFrame extends JFrame implements ActionListener {
      * Display the about box.\r
      */\r
     static void about() {\r
-        final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + Constants.VERSION + "\n" );\r
-        about.append( "Copyright (C) 2015 Christian M Zmasek\n" );\r
+        final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + AptxConstants.VERSION + "\n" );\r
+        about.append( "Copyright (C) 2016 Christian M Zmasek\n" );\r
         about.append( "All Rights Reserved\n" );\r
         about.append( "License: GNU Lesser General Public License (LGPL)\n" );\r
-        about.append( "Last modified: " + Constants.PRG_DATE + "\n" );\r
+        about.append( "Last modified: " + AptxConstants.PRG_DATE + "\n" );\r
         about.append( "Based on: " + ForesterUtil.getForesterLibraryInformation() + "\n" );\r
         about.append( "phyloXML version : " + ForesterConstants.PHYLO_XML_VERSION + "\n" );\r
         about.append( "phyloXML location: " + ForesterConstants.PHYLO_XML_LOCATION + "\n" );\r
@@ -2071,13 +2078,13 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         about.append( "[free memory: " + free_memory + "MB, total memory: " + total_memory + "MB]\n" );\r
         about.append( "[locale: " + Locale.getDefault() + "]\n" );\r
         about.append( "References:\n" );\r
-        about.append( Constants.PHYLOXML_REFERENCE_SHORT + "\n" );\r
+        about.append( AptxConstants.PHYLOXML_REFERENCE_SHORT + "\n" );\r
         about.append( "For more information & download:\n" );\r
-        about.append( Constants.APTX_WEB_SITE + "\n" );\r
+        about.append( AptxConstants.APTX_WEB_SITE + "\n" );\r
         about.append( "Documentation:\n" );\r
-        about.append( Constants.APTX_DOC_SITE + "\n" );\r
-        about.append( "Comments: " + Constants.AUTHOR_EMAIL );\r
-        JOptionPane.showMessageDialog( null, about, Constants.PRG_NAME, JOptionPane.PLAIN_MESSAGE );\r
+        about.append( AptxConstants.APTX_DOC_SITE + "\n" );\r
+        about.append( "Comments: " + AptxConstants.AUTHOR_EMAIL );\r
+        JOptionPane.showMessageDialog( null, about, AptxConstants.PRG_NAME, JOptionPane.PLAIN_MESSAGE );\r
     }\r
 \r
     static void chooseNodeSize( final Options options, final Component parent ) {\r
@@ -2210,7 +2217,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             tp.resetPreferredSize();\r
             tp.repaint();\r
         }\r
-        final String job_name = Constants.PRG_NAME;\r
+        final String job_name = AptxConstants.PRG_NAME;\r
         boolean error = false;\r
         String printer_name = null;\r
         try {\r
@@ -2482,7 +2489,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                     return null;\r
                 }\r
                 else {\r
-                    final File to = new File( file.getAbsoluteFile().toString() + Constants.BACKUP_FILE_SUFFIX );\r
+                    final File to = new File( file.getAbsoluteFile().toString() + AptxConstants.BACKUP_FILE_SUFFIX );\r
                     try {\r
                         ForesterUtil.copyFile( file, to );\r
                     }\r