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;
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();
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";
JCheckBoxMenuItem _right_line_up_domains_cbmi;
JCheckBoxMenuItem _line_up_renderable_data_cbmi;
JCheckBoxMenuItem _collapsed_with_average_height_cbmi;
+ JCheckBoxMenuItem _show_abbreviated_labels_for_collapsed_nodes_cbmi;
// _ print
JCheckBoxMenuItem _graphics_export_visible_only_cbmi;
JCheckBoxMenuItem _antialias_print_cbmi;
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;
@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();
}
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();
_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();
}
updateOptions( getOptions() );
}
+ else if ( o == _show_abbreviated_labels_for_collapsed_nodes_cbmi ) {
+ if ( _show_abbreviated_labels_for_collapsed_nodes_cbmi.isSelected() ) {
+ _show_abbreviated_labels_for_collapsed_nodes_cbmi.setSelected( true );
+ }
+ updateOptions( getOptions() );
+ }
else if ( o == _right_line_up_domains_cbmi ) {
if ( _right_line_up_domains_cbmi.isSelected() ) {
_line_up_renderable_data_cbmi.setSelected( true );
}
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() );
}
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() );
}
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() );
}
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() );
}
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() );
}
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() );
_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" ) );
_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 );
if ( ( _collapsed_with_average_height_cbmi != null ) && _collapsed_with_average_height_cbmi.isEnabled() ) {
options.setCollapsedWithAverageHeigh(_collapsed_with_average_height_cbmi.isSelected() );
}
+ if ( ( _show_abbreviated_labels_for_collapsed_nodes_cbmi != null ) && _show_abbreviated_labels_for_collapsed_nodes_cbmi.isEnabled() ) {
+ options.setShowAbbreviatedLabelsForCollapsedNodes(_show_abbreviated_labels_for_collapsed_nodes_cbmi.isSelected() );
+ }
}