From: cmzmasek Date: Fri, 24 Jun 2016 01:04:32 +0000 (-0700) Subject: made color-all when searching & color subtree optional X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fd6e4649c0e6eb9817ee7ac7ec72e2042135836c;p=jalview.git made color-all when searching & color subtree optional --- diff --git a/forester/java/forester.jar b/forester/java/forester.jar index 8b55f8f..ca8a77b 100644 Binary files a/forester/java/forester.jar and b/forester/java/forester.jar differ diff --git a/forester/java/src/org/forester/archaeopteryx/AptxConstants.java b/forester/java/src/org/forester/archaeopteryx/AptxConstants.java index 8ad9735..e658341 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxConstants.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxConstants.java @@ -41,7 +41,7 @@ public final class AptxConstants { public final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me public final static boolean __SYNTH_LF = false; // TODO remove me public final static String PRG_NAME = "Archaeopteryx"; - final static String VERSION = "0.9910 beta"; + final static String VERSION = "0.9911 beta"; final static String PRG_DATE = "160623"; final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file"; final static String[] DEFAULT_FONT_CHOICES = { diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index aa23df0..4c85a4a 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -253,6 +253,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { JCheckBoxMenuItem _search_whole_words_only_cbmi; JCheckBoxMenuItem _inverse_search_result_cbmi; JCheckBoxMenuItem _search_with_regex_cbmi; + JCheckBoxMenuItem _color_all_found_nodes_when_coloring_subtree_cbmi; // type menu: JMenu _type_menu; JCheckBoxMenuItem _rectangular_type_cbmi; @@ -534,6 +535,9 @@ public abstract class MainFrame extends JFrame implements ActionListener { getMainPanel().getControlPanel().search0(); getMainPanel().getControlPanel().search1(); } + else if ( o == _color_all_found_nodes_when_coloring_subtree_cbmi ) { + updateOptions( getOptions() ); + } else if ( o == _show_scale_cbmi ) { updateOptions( getOptions() ); } @@ -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() ) { options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() ); } + if ( ( _color_all_found_nodes_when_coloring_subtree_cbmi != null ) && _color_all_found_nodes_when_coloring_subtree_cbmi.isEnabled() ) { + options.setColorAllFoundNodesWhenColoringSubtree( _color_all_found_nodes_when_coloring_subtree_cbmi.isSelected() ); + } } void updateTypeCheckboxes( final Options options, final Object o ) { @@ -2050,7 +2057,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { */ static void about() { final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + AptxConstants.VERSION + "\n" ); - about.append( "Copyright (C) 2015 Christian M Zmasek\n" ); + about.append( "Copyright (C) 2016 Christian M Zmasek\n" ); about.append( "All Rights Reserved\n" ); about.append( "License: GNU Lesser General Public License (LGPL)\n" ); about.append( "Last modified: " + AptxConstants.PRG_DATE + "\n" ); diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 8d37609..b940f35 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -1844,6 +1844,7 @@ public final class MainFrameApplication extends MainFrame { _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( INVERSE_SEARCH_RESULT_LABEL ) ); + _options_jmenu.add( _color_all_found_nodes_when_coloring_subtree_cbmi = new JCheckBoxMenuItem( "Colorize All Found Nodes When Colorizing Subtree(s)" ) ); _options_jmenu.addSeparator(); _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Graphics Export & Printing:" ), getConfiguration() ) ); @@ -1941,6 +1942,7 @@ public final class MainFrameApplication extends MainFrame { customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() ); customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() ); customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() ); + customizeCheckBoxMenuItem( _color_all_found_nodes_when_coloring_subtree_cbmi, getOptions().isColorAllFoundNodesWhenColoringSubtree() ); customizeCheckBoxMenuItem( _graphics_export_visible_only_cbmi, getOptions().isGraphicsExportVisibleOnly() ); customizeCheckBoxMenuItem( _print_using_actual_size_cbmi, getOptions().isPrintUsingActualSize() ); customizeCheckBoxMenuItem( _graphics_export_using_actual_size_cbmi, getOptions() diff --git a/forester/java/src/org/forester/archaeopteryx/Options.java b/forester/java/src/org/forester/archaeopteryx/Options.java index 3eb403e..4172c52 100644 --- a/forester/java/src/org/forester/archaeopteryx/Options.java +++ b/forester/java/src/org/forester/archaeopteryx/Options.java @@ -120,6 +120,7 @@ final public class Options { private TAXONOMY_EXTRACTION _taxonomy_extraction; private boolean _line_up_renderable_node_data; private boolean _right_align_domains; + private boolean _color_all_found_nodes_when_coloring_subtree; private Options() { init(); @@ -195,6 +196,7 @@ final public class Options { _show_default_node_shapes_internal = false; _show_default_node_shapes_external = false; _show_default_node_shapes_for_marked_nodes = false; + _color_all_found_nodes_when_coloring_subtree = false; if ( AptxUtil.isUsOrCanada() ) { _print_size_x = AptxConstants.US_LETTER_SIZE_X; _print_size_y = AptxConstants.US_LETTER_SIZE_Y; @@ -629,4 +631,12 @@ final public class Options { final static Options createDefaultInstance() { return new Options(); } + + final boolean isColorAllFoundNodesWhenColoringSubtree() { + return _color_all_found_nodes_when_coloring_subtree; + } + + final void setColorAllFoundNodesWhenColoringSubtree( final boolean color_all_found_nodes_when_coloring_subtree ) { + _color_all_found_nodes_when_coloring_subtree = color_all_found_nodes_when_coloring_subtree; + } } diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index b90c964..f6f5911 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -918,8 +918,9 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee return; } _color_chooser.setPreviewPanel( new JPanel() ); - SubtreeColorizationActionListener al; - if ( ( getFoundNodes0() != null ) || ( getFoundNodes1() != null ) ) { + final SubtreeColorizationActionListener al; + final boolean color_found = getOptions().isColorAllFoundNodesWhenColoringSubtree(); + if ( color_found && ( ( getFoundNodes0() != null ) || ( getFoundNodes1() != null ) ) ) { final List additional_nodes = getFoundNodesAsListOfPhylogenyNodes(); al = new SubtreeColorizationActionListener( _color_chooser, node, additional_nodes ); } diff --git a/forester/java/src/org/forester/test/Test.java b/forester/java/src/org/forester/test/Test.java index 8ca0bd6..f714686 100644 --- a/forester/java/src/org/forester/test/Test.java +++ b/forester/java/src/org/forester/test/Test.java @@ -1474,13 +1474,6 @@ public final class Test { if ( phys[ 0 ].getNumberOfExternalNodes() < 10 ) { return false; } - final Phylogeny[] phys2 = ForesterUtil.readPhylogeniesFromUrl( u, parser); - if ( ( phys2 == null ) || ( phys2.length != 1 ) ) { - return false; - } - if ( phys2[ 0 ].getNumberOfExternalNodes() != phys[ 0 ].getNumberOfExternalNodes() ) { - return false; - } } catch ( final Exception e ) { e.printStackTrace();