made color-all when searching & color subtree optional
authorcmzmasek <cmzmasek@yahoo.com>
Fri, 24 Jun 2016 01:04:32 +0000 (18:04 -0700)
committercmzmasek <cmzmasek@yahoo.com>
Fri, 24 Jun 2016 01:04:32 +0000 (18:04 -0700)
forester/java/forester.jar
forester/java/src/org/forester/archaeopteryx/AptxConstants.java
forester/java/src/org/forester/archaeopteryx/MainFrame.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java
forester/java/src/org/forester/archaeopteryx/Options.java
forester/java/src/org/forester/archaeopteryx/TreePanel.java
forester/java/src/org/forester/test/Test.java

index 8b55f8f..ca8a77b 100644 (file)
Binary files a/forester/java/forester.jar and b/forester/java/forester.jar differ
index 8ad9735..e658341 100644 (file)
@@ -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                                          = { 
index aa23df0..4c85a4a 100644 (file)
@@ -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
@@ -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
@@ -2050,7 +2057,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
      */\r
     static void about() {\r
         final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + AptxConstants.VERSION + "\n" );\r
-        about.append( "Copyright (C) 2015 Christian M Zmasek\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: " + AptxConstants.PRG_DATE + "\n" );\r
index 8d37609..b940f35 100644 (file)
@@ -1844,6 +1844,7 @@ public final class MainFrameApplication extends MainFrame {
         _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );\r
         _search_with_regex_cbmi.setToolTipText( MainFrame.SEARCH_WITH_REGEX_TIP );\r
         _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) );\r
+        _options_jmenu.add( _color_all_found_nodes_when_coloring_subtree_cbmi = new JCheckBoxMenuItem( "Colorize All Found Nodes When Colorizing Subtree(s)" ) ); \r
         _options_jmenu.addSeparator();\r
         _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Graphics Export & Printing:" ),\r
                                                       getConfiguration() ) );\r
@@ -1941,6 +1942,7 @@ public final class MainFrameApplication extends MainFrame {
         customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );\r
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );\r
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );\r
+        customizeCheckBoxMenuItem( _color_all_found_nodes_when_coloring_subtree_cbmi, getOptions().isColorAllFoundNodesWhenColoringSubtree() ); \r
         customizeCheckBoxMenuItem( _graphics_export_visible_only_cbmi, getOptions().isGraphicsExportVisibleOnly() );\r
         customizeCheckBoxMenuItem( _print_using_actual_size_cbmi, getOptions().isPrintUsingActualSize() );\r
         customizeCheckBoxMenuItem( _graphics_export_using_actual_size_cbmi, getOptions()\r
index 3eb403e..4172c52 100644 (file)
@@ -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;
+    }
 }
index b90c964..f6f5911 100644 (file)
@@ -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<PhylogenyNode> additional_nodes = getFoundNodesAsListOfPhylogenyNodes();
             al = new SubtreeColorizationActionListener( _color_chooser, node, additional_nodes );
         }
index 8ca0bd6..f714686 100644 (file)
@@ -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();