Changed list to set in search0 and 1.
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 24 Dec 2014 23:57:58 +0000 (23:57 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 24 Dec 2014 23:57:58 +0000 (23:57 +0000)
forester/java/src/org/forester/archaeopteryx/Constants.java
forester/java/src/org/forester/archaeopteryx/ControlPanel.java

index 1eb96f3..1a517c6 100644 (file)
@@ -43,7 +43,7 @@ public final class Constants {
     public final static boolean ALLOW_DDBJ_BLAST                                              = false;
     public final static String  PRG_NAME                                                      = "Archaeopteryx";
     final static String         VERSION                                                       = "0.9903 beta";
-    final static String         PRG_DATE                                                      = "141223";
+    final static String         PRG_DATE                                                      = "141224";
     final static String         DEFAULT_CONFIGURATION_FILE_NAME                               = "_aptx_configuration_file";
     final static String[]       DEFAULT_FONT_CHOICES                                          = { "Arial", "Helvetica",
             "Verdana", "Tahoma", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans"  };
index 7cac388..3bd8738 100644 (file)
@@ -44,6 +44,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.swing.BorderFactory;
 import javax.swing.DefaultListCellRenderer;
@@ -571,7 +572,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             case Configuration.color_according_to_annotation:
                 _color_according_to_annotation = new JCheckBox( title );
                 _color_according_to_annotation
-                .setToolTipText( "To colorize sequence annotation labels as a function of sequence annotation" );
+                        .setToolTipText( "To colorize sequence annotation labels as a function of sequence annotation" );
                 addJCheckBox( _color_according_to_annotation, ch_panel );
                 add( ch_panel );
                 break;
@@ -628,7 +629,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             case Configuration.use_style:
                 _use_visual_styles_cb = new JCheckBox( title );
                 getUseVisualStylesCb()
-                .setToolTipText( "To use visual styles (node colors, fonts) and branch colors, if present" );
+                        .setToolTipText( "To use visual styles (node colors, fonts) and branch colors, if present" );
                 addJCheckBox( getUseVisualStylesCb(), ch_panel );
                 add( ch_panel );
                 break;
@@ -1161,13 +1162,13 @@ final class ControlPanel extends JPanel implements ActionListener {
                     getNodeDescPopupCb().setSelected( state );
                 }
                 break;
-                /* GUILHEM_BEG */
+            /* GUILHEM_BEG */
             case Configuration.show_relation_confidence:
                 if ( _seq_relation_confidence_switch != null ) {
                     _seq_relation_confidence_switch.setSelected( state );
                 }
                 break;
-                /* GUILHEM_END */
+            /* GUILHEM_END */
             default:
                 throw new AssertionError( "unknown checkbox: " + which );
         }
@@ -1577,7 +1578,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             }
             else {
                 getMainPanel().getMainFrame().setSelectedTypeInTypeMenu( getMainPanel().getCurrentTreePanel()
-                                                                         .getPhylogenyGraphicsType() );
+                        .getPhylogenyGraphicsType() );
             }
             getMainPanel().getCurrentTreePanel().updateSubSuperTreeButton();
             getMainPanel().getControlPanel().search0();
@@ -1635,7 +1636,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             treepanel.resetPreferredSize();
             getMainPanel().getCurrentScrollPane().getViewport().validate();
             sb.setValue( ForesterUtil.roundToInt( ( ( sb.getMaximum() - sb.getMinimum() ) / x )
-                                                  - ( sb.getVisibleAmount() / 2.0 ) ) );
+                    - ( sb.getVisibleAmount() / 2.0 ) ) );
         }
         else {
             final int x = sb.getMaximum() - sb.getMinimum() - sb.getVisibleAmount() - sb.getValue();
@@ -1660,7 +1661,7 @@ final class ControlPanel extends JPanel implements ActionListener {
         treepanel.resetPreferredSize();
         getMainPanel().getCurrentScrollPane().getViewport().validate();
         sb.setValue( ForesterUtil.roundToInt( ( ( sb.getMaximum() - sb.getMinimum() ) / x )
-                                              - ( sb.getVisibleAmount() / 2.0 ) ) );
+                - ( sb.getVisibleAmount() / 2.0 ) ) );
         treepanel.resetPreferredSize();
         treepanel.updateOvSizes();
     }
@@ -1685,7 +1686,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                 treepanel.resetPreferredSize();
                 getMainPanel().getCurrentScrollPane().getViewport().validate();
                 sb.setValue( ForesterUtil.roundToInt( ( ( sb.getMaximum() - sb.getMinimum() ) / x )
-                                                      - ( sb.getVisibleAmount() / 2.0 ) ) );
+                        - ( sb.getVisibleAmount() / 2.0 ) ) );
             }
             else {
                 final int x = sb.getMaximum() - sb.getMinimum() - sb.getVisibleAmount() - sb.getValue();
@@ -1714,7 +1715,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             treepanel.resetPreferredSize();
             getMainPanel().getCurrentScrollPane().getViewport().validate();
             sb.setValue( ForesterUtil.roundToInt( ( ( sb.getMaximum() - sb.getMinimum() ) / x )
-                                                  - ( sb.getVisibleAmount() / 2.0 ) ) );
+                    - ( sb.getVisibleAmount() / 2.0 ) ) );
             treepanel.resetPreferredSize();
             treepanel.updateOvSizes();
         }
@@ -1759,7 +1760,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                                                         cellHasFocus );
                 if ( ( value != null ) && ( value instanceof SequenceRelation.SEQUENCE_RELATION_TYPE ) ) {
                     ( ( DefaultListCellRenderer ) component ).setText( SequenceRelation
-                                                                       .getPrintableNameByType( ( SequenceRelation.SEQUENCE_RELATION_TYPE ) value ) );
+                            .getPrintableNameByType( ( SequenceRelation.SEQUENCE_RELATION_TYPE ) value ) );
                 }
                 return component;
             }
@@ -1803,7 +1804,7 @@ final class ControlPanel extends JPanel implements ActionListener {
         getSearchResetButton0().setEnabled( true );
         getSearchResetButton0().setVisible( true );
         String[] queries = null;
-        List<PhylogenyNode> nodes = null;
+        Set<PhylogenyNode> nodes = null;
         if ( ( query_str.indexOf( ',' ) >= 0 ) && !getOptions().isSearchWithRegex() ) {
             queries = query_str.split( ",+" );
         }
@@ -1812,7 +1813,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             queries[ 0 ] = query_str.trim();
         }
         if ( ( queries != null ) && ( queries.length > 0 ) ) {
-            nodes = new ArrayList<PhylogenyNode>();
+            nodes = new HashSet<PhylogenyNode>();
             for( String query : queries ) {
                 if ( ForesterUtil.isEmpty( query ) ) {
                     continue;
@@ -1827,7 +1828,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                          isShowDomainArchitectures(),
                                                                          tp != null ? Math.pow( 10,
                                                                                                 tp.getDomainStructureEvalueThresholdExp() )
-                                                                                 : 0 ) );
+                                                                                                : 0 ) );
                 }
                 else {
                     nodes.addAll( PhylogenyMethods.searchData( query,
@@ -1837,13 +1838,14 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                getOptions().isSearchWithRegex(),
                                                                isShowDomainArchitectures(),
                                                                tp != null ? Math.pow( 10, tp
-                                                                       .getDomainStructureEvalueThresholdExp() ) : 0 ) );
+                                                                                      .getDomainStructureEvalueThresholdExp() ) : 0 ) );
                 }
             }
             if ( getOptions().isInverseSearchResult() ) {
                 final List<PhylogenyNode> all = PhylogenyMethods.obtainAllNodesAsList( tree );
                 all.removeAll( nodes );
-                nodes = all;
+                nodes = new HashSet<PhylogenyNode>();
+                nodes.addAll( all );
             }
         }
         if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
@@ -1864,7 +1866,7 @@ final class ControlPanel extends JPanel implements ActionListener {
         getSearchResetButton1().setEnabled( true );
         getSearchResetButton1().setVisible( true );
         String[] queries = null;
-        List<PhylogenyNode> nodes = null;
+        Set<PhylogenyNode> nodes = null;
         if ( ( query_str.indexOf( ',' ) >= 0 ) && !getOptions().isSearchWithRegex() ) {
             queries = query_str.split( ",+" );
         }
@@ -1873,7 +1875,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             queries[ 0 ] = query_str.trim();
         }
         if ( ( queries != null ) && ( queries.length > 0 ) ) {
-            nodes = new ArrayList<PhylogenyNode>();
+            nodes = new HashSet<PhylogenyNode>();
             for( String query : queries ) {
                 if ( ForesterUtil.isEmpty( query ) ) {
                     continue;
@@ -1888,7 +1890,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                          isShowDomainArchitectures(),
                                                                          tp != null ? Math.pow( 10,
                                                                                                 tp.getDomainStructureEvalueThresholdExp() )
-                                                                                 : 0 ) );
+                                                                                                : 0 ) );
                 }
                 else {
                     nodes.addAll( PhylogenyMethods.searchData( query,
@@ -1898,13 +1900,14 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                getOptions().isSearchWithRegex(),
                                                                isShowDomainArchitectures(),
                                                                tp != null ? Math.pow( 10, tp
-                                                                       .getDomainStructureEvalueThresholdExp() ) : 0 ) );
+                                                                                      .getDomainStructureEvalueThresholdExp() ) : 0 ) );
                 }
             }
             if ( getOptions().isInverseSearchResult() ) {
                 final List<PhylogenyNode> all = PhylogenyMethods.obtainAllNodesAsList( tree );
                 all.removeAll( nodes );
-                nodes = all;
+                nodes = new HashSet<PhylogenyNode>();
+                nodes.addAll( all );
             }
         }
         if ( ( nodes != null ) && ( nodes.size() > 0 ) ) {
@@ -2049,7 +2052,7 @@ final class ControlPanel extends JPanel implements ActionListener {
             _get_ext_desc_data = cb_index;
             if ( !ForesterUtil.isEmpty( getConfiguration().getLabelForGetExtDescendentsData() ) ) {
                 addClickToOption( Configuration.get_ext_desc_data, getConfiguration()
-                        .getLabelForGetExtDescendentsData() );
+                                  .getLabelForGetExtDescendentsData() );
             }
             else {
                 addClickToOption( Configuration.get_ext_desc_data,