X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FControlPanel.java;h=3bd8738f852461aa3d804fe66349158a5a6eb757;hb=8d6e81da091d432309f2f7034cf93dbc5ba5e82a;hp=c68b51ad9806e6544b08dd521fde082b999712c4;hpb=d7cffe43f06ee91484ca0d5fba57b9bc78fdb0f7;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java index c68b51a..3bd8738 100644 --- a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java +++ b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java @@ -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; @@ -291,10 +292,14 @@ final class ControlPanel extends JPanel implements ActionListener { } else if ( e.getSource() == _decr_domain_structure_evalue_thr ) { _mainpanel.getCurrentTreePanel().decreaseDomainStructureEvalueThresholdExp(); + search0(); + search1(); displayedPhylogenyMightHaveChanged( true ); } else if ( e.getSource() == _incr_domain_structure_evalue_thr ) { _mainpanel.getCurrentTreePanel().increaseDomainStructureEvalueThresholdExp(); + search0(); + search1(); displayedPhylogenyMightHaveChanged( true ); } else if ( e.getSource() == _search_tf_0 ) { @@ -1302,7 +1307,6 @@ final class ControlPanel extends JPanel implements ActionListener { _sequence_colors = sequence_colors; } - void setupControls() { // The tree display options: setupDisplayCheckboxes(); @@ -1800,7 +1804,7 @@ final class ControlPanel extends JPanel implements ActionListener { getSearchResetButton0().setEnabled( true ); getSearchResetButton0().setVisible( true ); String[] queries = null; - List nodes = null; + Set nodes = null; if ( ( query_str.indexOf( ',' ) >= 0 ) && !getOptions().isSearchWithRegex() ) { queries = query_str.split( ",+" ); } @@ -1809,18 +1813,22 @@ final class ControlPanel extends JPanel implements ActionListener { queries[ 0 ] = query_str.trim(); } if ( ( queries != null ) && ( queries.length > 0 ) ) { - nodes = new ArrayList(); + nodes = new HashSet(); for( String query : queries ) { if ( ForesterUtil.isEmpty( query ) ) { continue; } query = query.trim(); - if ( ( query.indexOf( '+' ) >= 0 ) && !getOptions().isSearchWithRegex() ) { + final TreePanel tp = getMainPanel().getCurrentTreePanel(); + if ( ( query.indexOf( '+' ) > 0 ) && !getOptions().isSearchWithRegex() ) { nodes.addAll( PhylogenyMethods.searchDataLogicalAnd( query.split( "\\++" ), tree, getOptions().isSearchCaseSensitive(), !getOptions().isMatchWholeTermsOnly(), - isShowDomainArchitectures() ) ); + isShowDomainArchitectures(), + tp != null ? Math.pow( 10, + tp.getDomainStructureEvalueThresholdExp() ) + : 0 ) ); } else { nodes.addAll( PhylogenyMethods.searchData( query, @@ -1828,13 +1836,16 @@ final class ControlPanel extends JPanel implements ActionListener { getOptions().isSearchCaseSensitive(), !getOptions().isMatchWholeTermsOnly(), getOptions().isSearchWithRegex(), - isShowDomainArchitectures() ) ); + isShowDomainArchitectures(), + tp != null ? Math.pow( 10, tp + .getDomainStructureEvalueThresholdExp() ) : 0 ) ); } } if ( getOptions().isInverseSearchResult() ) { final List all = PhylogenyMethods.obtainAllNodesAsList( tree ); all.removeAll( nodes ); - nodes = all; + nodes = new HashSet(); + nodes.addAll( all ); } } if ( ( nodes != null ) && ( nodes.size() > 0 ) ) { @@ -1855,7 +1866,7 @@ final class ControlPanel extends JPanel implements ActionListener { getSearchResetButton1().setEnabled( true ); getSearchResetButton1().setVisible( true ); String[] queries = null; - List nodes = null; + Set nodes = null; if ( ( query_str.indexOf( ',' ) >= 0 ) && !getOptions().isSearchWithRegex() ) { queries = query_str.split( ",+" ); } @@ -1864,18 +1875,22 @@ final class ControlPanel extends JPanel implements ActionListener { queries[ 0 ] = query_str.trim(); } if ( ( queries != null ) && ( queries.length > 0 ) ) { - nodes = new ArrayList(); + nodes = new HashSet(); for( String query : queries ) { if ( ForesterUtil.isEmpty( query ) ) { continue; } query = query.trim(); - if ( ( query.indexOf( '+' ) >= 0 ) && !getOptions().isSearchWithRegex() ) { + final TreePanel tp = getMainPanel().getCurrentTreePanel(); + if ( ( query.indexOf( '+' ) > 0 ) && !getOptions().isSearchWithRegex() ) { nodes.addAll( PhylogenyMethods.searchDataLogicalAnd( query.split( "\\++" ), tree, getOptions().isSearchCaseSensitive(), !getOptions().isMatchWholeTermsOnly(), - isShowDomainArchitectures() ) ); + isShowDomainArchitectures(), + tp != null ? Math.pow( 10, + tp.getDomainStructureEvalueThresholdExp() ) + : 0 ) ); } else { nodes.addAll( PhylogenyMethods.searchData( query, @@ -1883,13 +1898,16 @@ final class ControlPanel extends JPanel implements ActionListener { getOptions().isSearchCaseSensitive(), !getOptions().isMatchWholeTermsOnly(), getOptions().isSearchWithRegex(), - isShowDomainArchitectures() ) ); + isShowDomainArchitectures(), + tp != null ? Math.pow( 10, tp + .getDomainStructureEvalueThresholdExp() ) : 0 ) ); } } if ( getOptions().isInverseSearchResult() ) { final List all = PhylogenyMethods.obtainAllNodesAsList( tree ); all.removeAll( nodes ); - nodes = all; + nodes = new HashSet(); + nodes.addAll( all ); } } if ( ( nodes != null ) && ( nodes.size() > 0 ) ) { @@ -2034,12 +2052,11 @@ 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 { - final String s = getOptions().getExtDescNodeDataToReturn().toString(); - final String label = _configuration.getClickToTitle( Configuration.get_ext_desc_data ) + " " + s; - addClickToOption( Configuration.get_ext_desc_data, label ); + addClickToOption( Configuration.get_ext_desc_data, + getConfiguration().getClickToTitle( Configuration.get_ext_desc_data ) ); } if ( default_option == Configuration.get_ext_desc_data ) { selected_index = cb_index;