Inference tab disabled and node frames now appear center of Aptx
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainFrame.java
index a06adaf..7bd6765 100644 (file)
@@ -40,10 +40,10 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 
 import javax.swing.Box;
-import javax.swing.JApplet;
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JFileChooser;
 import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
 import javax.swing.JLabel;
 import javax.swing.JMenu;
 import javax.swing.JMenuBar;
@@ -82,7 +82,7 @@ import org.forester.util.ForesterConstants;
 import org.forester.util.ForesterUtil;
 import org.forester.util.WindowsUtils;
 
-public abstract class MainFrame extends JFrame implements ActionListener {
+public abstract class MainFrame extends JInternalFrame implements ActionListener {
 
     final static NHFilter            nhfilter                                = new NHFilter();
     final static NHXFilter           nhxfilter                               = new NHXFilter();
@@ -113,10 +113,10 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     static final String              OPTIONS_HEADER                          = "Options";
     static final String              SEARCH_SUBHEADER                        = "Search:";
     static final String              DISPLAY_SUBHEADER                       = "Display:";
-    static final String              SEARCH_TERMS_ONLY_LABEL                 = "Match Complete Terms Only";
-    static final String              SEARCH_REGEX_LABEL                      = "Search with Regular Expressions";
-    static final String              SEARCH_CASE_SENSITIVE_LABEL             = "Case Sensitive";
-    static final String              INVERSE_SEARCH_RESULT_LABEL             = "Negate Result";
+    static final String              SEARCH_TERMS_ONLY_LABEL                 = "Words";
+    static final String              SEARCH_REGEX_LABEL                      = "Regex";
+    static final String              SEARCH_CASE_SENSITIVE_LABEL             = "Match Case";
+    static final String              INVERSE_SEARCH_RESULT_LABEL             = "Inverse";
     static final String              COLOR_BY_TAXONOMIC_GROUP                = "Colorize by Taxonomic Group";
     static final String              DISPLAY_SCALE_LABEL                     = "Scale";
     static final String              NON_LINED_UP_CLADOGRAMS_LABEL           = "Non-Lined Up Cladogram";
@@ -274,6 +274,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     JMenuItem                        _about_item;
     JMenuItem                        _help_item;
     JMenuItem                        _website_item;
+    JMenuItem                        _aptxjs_website_item;
     JMenuItem                        _mailing_list_item;
     JMenuItem                        _phyloxml_website_item;
     JMenuItem                        _phyloxml_ref_item;
@@ -327,14 +328,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     @Override
     public void actionPerformed( final ActionEvent e ) {
         final Object o = e.getSource();
-        boolean is_applet = false;
-        JApplet applet = null;
-        if ( getCurrentTreePanel() != null ) {
-            is_applet = getCurrentTreePanel().isApplet();
-            if ( is_applet ) {
-                applet = getCurrentTreePanel().obtainApplet();
-            }
-        }
+      
         if ( o == _exit_item ) {
             close();
         }
@@ -505,6 +499,9 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             showWhole();
         }
         else if ( o == _search_case_senstive_cbmi ) {
+            if ( ( _search_with_regex_cbmi != null ) && _search_case_senstive_cbmi.isSelected() ) {
+                _search_with_regex_cbmi.setSelected( false );
+            }
             updateOptions( getOptions() );
             getMainPanel().getControlPanel().search0();
             getMainPanel().getControlPanel().search1();
@@ -527,7 +524,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 _search_whole_words_only_cbmi.setSelected( false );
             }
             if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
-                _search_case_senstive_cbmi.setSelected( true );
+                _search_case_senstive_cbmi.setSelected( false );
             }
             updateOptions( getOptions() );
             getMainPanel().getControlPanel().search0();
@@ -604,7 +601,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _help_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.APTX_DOC_SITE, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.APTX_DOC_SITE );
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -612,7 +609,15 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _website_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.APTX_WEB_SITE, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.APTX_WEB_SITE);
+            }
+            catch ( final IOException e1 ) {
+                ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
+            }
+        }
+        else if ( o == _aptxjs_website_item ) {
+            try {
+                AptxUtil.openWebsite( AptxConstants.APTX_JS_WEB_SITE);;
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -620,7 +625,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _mailing_list_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.APTX_MAILING_LIST, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.APTX_MAILING_LIST );
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -628,7 +633,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _phyloxml_website_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.PHYLOXML_WEB_SITE, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.PHYLOXML_WEB_SITE );
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -636,7 +641,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _aptx_ref_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.APTX_REFERENCE_URL, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.APTX_REFERENCE_URL );
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -644,7 +649,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }
         else if ( o == _phyloxml_ref_item ) {
             try {
-                AptxUtil.openWebsite( AptxConstants.PHYLOXML_REFERENCE_URL, is_applet, applet );
+                AptxUtil.openWebsite( AptxConstants.PHYLOXML_REFERENCE_URL );
             }
             catch ( final IOException e1 ) {
                 ForesterUtil.printErrorMessage( AptxConstants.PRG_NAME, e1.toString() );
@@ -1185,6 +1190,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         _help_jmenu.add( _help_item = new JMenuItem( "Documentation" ) );
         _help_jmenu.addSeparator();
         _help_jmenu.add( _website_item = new JMenuItem( "Archaeopteryx Home" ) );
+        _help_jmenu.add( _aptxjs_website_item = new JMenuItem( "NEW! Archaeopteryx online version: Archaeopteryx.js" ) );
         _help_jmenu.add( _mailing_list_item = new JMenuItem( "Mailing List" ) );
         _aptx_ref_item = new JMenuItem( "Archaeopteryx Reference" ); //TODO need to add this...
         _help_jmenu.add( _phyloxml_website_item = new JMenuItem( "phyloXML Home" ) );
@@ -1193,6 +1199,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         _help_jmenu.add( _about_item = new JMenuItem( "About" ) );
         customizeJMenuItem( _help_item );
         customizeJMenuItem( _website_item );
+        customizeJMenuItem( _aptxjs_website_item );
         customizeJMenuItem( _mailing_list_item );
         customizeJMenuItem( _phyloxml_website_item );
         customizeJMenuItem( _aptx_ref_item );