private JCheckBoxMenuItem _search_whole_words_only_cbmi;
private JCheckBoxMenuItem _inverse_search_result_cbmi;
private JCheckBoxMenuItem _search_with_regex_cbmi;
-
private JCheckBoxMenuItem _show_overview_cbmi;
private JMenuItem _choose_minimal_confidence_mi;
private JMenuItem _collapse_species_specific_subtrees;
getMainPanel().getControlPanel().search1();
}
else if ( o == _search_whole_words_only_cbmi ) {
+ if ( ( _search_with_regex_cbmi != null ) && _search_whole_words_only_cbmi.isSelected() ) {
+ _search_with_regex_cbmi.setSelected( false );
+ }
updateOptions( getOptions() );
getMainPanel().getControlPanel().search0();
getMainPanel().getControlPanel().search1();
getMainPanel().getControlPanel().search1();
}
else if ( o == _search_with_regex_cbmi ) {
+ if ( ( _search_whole_words_only_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+ _search_whole_words_only_cbmi.setSelected( false );
+ }
+ if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+ _search_case_senstive_cbmi.setSelected( true );
+ }
updateOptions( getOptions() );
getMainPanel().getControlPanel().search0();
getMainPanel().getControlPanel().search1();
_options_jmenu
.add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_CASE_SENSITIVE_LABEL ) );
_options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_TERMS_ONLY_LABEL ) );
-
-
-
- _options_jmenu
- .add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
-
-
-
-
-
+ _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
_options_jmenu
.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( MainFrame.INVERSE_SEARCH_RESULT_LABEL ) );
customizeJMenuItem( _choose_font_mi );
customizeRadioButtonMenuItem( _ext_node_dependent_cladogram_rbmi,
getOptions().getCladogramType() == CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
-
-
customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );
-
-
-
customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
&& _show_confidence_stddev_cbmi.isSelected() );
options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )
&& _search_whole_words_only_cbmi.isSelected() );
- options.setSearchWithRegex( ( _search_with_regex_cbmi != null )
- && _search_with_regex_cbmi.isSelected() );
-
+ options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );
options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )
&& _inverse_search_result_cbmi.isSelected() );
if ( ( _rectangular_type_cbmi != null ) && _rectangular_type_cbmi.isSelected() ) {
final boolean case_sensitive,\r
final boolean partial,\r
final boolean regex,\r
- final boolean search_domains\r
- ) {\r
+ final boolean search_domains ) {\r
final List<PhylogenyNode> nodes = new ArrayList<PhylogenyNode>();\r
if ( phy.isEmpty() || ( query == null ) ) {\r
return nodes;\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getScientificName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getScientificName(),\r
+ query,\r
+ case_sensitive,\r
+ partial,\r
+ regex ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
&& match( node.getNodeData().getTaxonomy().getIdentifier().getValue(),\r
query,\r
case_sensitive,\r
- partial ) ) {\r
+ partial,\r
+ regex ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy() && !node.getNodeData().getTaxonomy().getSynonyms().isEmpty() ) {\r
final List<String> syns = node.getNodeData().getTaxonomy().getSynonyms();\r
I: for( final String syn : syns ) {\r
- if ( match( syn, query, case_sensitive, partial ) ) {\r
+ if ( match( syn, query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break I;\r
}\r
}\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
}\r
if ( !match\r
&& match( node.getNodeData().getSequence().getAccession().getValue(),\r
query,\r
case_sensitive,\r
- partial ) ) {\r
+ partial,\r
+ regex ) ) {\r
match = true;\r
}\r
if ( search_domains && !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {\r
final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture();\r
I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) {\r
- if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial ) ) {\r
+ if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break I;\r
}\r
}\r
}\r
- //\r
if ( !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getAnnotations() != null ) ) {\r
for( final Annotation ann : node.getNodeData().getSequence().getAnnotations() ) {\r
- if ( match( ann.getDesc(), query, case_sensitive, partial ) ) {\r
+ if ( match( ann.getDesc(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( ann.getRef(), query, case_sensitive, partial ) ) {\r
+ if ( match( ann.getRef(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getCrossReferences() != null ) ) {\r
for( final Accession x : node.getNodeData().getSequence().getCrossReferences() ) {\r
- if ( match( x.getComment(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getComment(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( x.getSource(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getSource(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( x.getValue(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getValue(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break;\r
}\r
if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) {\r
Iterator<String> it = node.getNodeData().getBinaryCharacters().getPresentCharacters().iterator();\r
I: while ( it.hasNext() ) {\r
- if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+ if ( match( it.next(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break I;\r
}\r
}\r
it = node.getNodeData().getBinaryCharacters().getGainedCharacters().iterator();\r
I: while ( it.hasNext() ) {\r
- if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+ if ( match( it.next(), query, case_sensitive, partial, regex ) ) {\r
match = true;\r
break I;\r
}\r
if ( ForesterUtil.isEmpty( query ) ) {\r
continue;\r
}\r
- if ( match( node.getName(), query, case_sensitive, partial ) ) {\r
+ if ( match( node.getName(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getTaxonomyCode(),\r
+ query,\r
+ case_sensitive,\r
+ partial,\r
+ false ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getCommonName(),\r
+ query,\r
+ case_sensitive,\r
+ partial,\r
+ false ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
- && match( node.getNodeData().getTaxonomy().getScientificName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getTaxonomy().getScientificName(),\r
+ query,\r
+ case_sensitive,\r
+ partial,\r
+ false ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
&& match( node.getNodeData().getTaxonomy().getIdentifier().getValue(),\r
query,\r
case_sensitive,\r
- partial ) ) {\r
+ partial,\r
+ false ) ) {\r
match = true;\r
}\r
else if ( node.getNodeData().isHasTaxonomy()\r
&& !node.getNodeData().getTaxonomy().getSynonyms().isEmpty() ) {\r
final List<String> syns = node.getNodeData().getTaxonomy().getSynonyms();\r
I: for( final String syn : syns ) {\r
- if ( match( syn, query, case_sensitive, partial ) ) {\r
+ if ( match( syn, query, case_sensitive, partial, false ) ) {\r
match = true;\r
break I;\r
}\r
}\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
}\r
- if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial ) ) {\r
+ if ( !match\r
+ && node.getNodeData().isHasSequence()\r
+ && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
- && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) {\r
+ && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
}\r
if ( !match\r
&& match( node.getNodeData().getSequence().getAccession().getValue(),\r
query,\r
case_sensitive,\r
- partial ) ) {\r
+ partial,\r
+ false ) ) {\r
match = true;\r
}\r
if ( search_domains && !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {\r
final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture();\r
I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) {\r
- if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial ) ) {\r
+ if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break I;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getAnnotations() != null ) ) {\r
for( final Annotation ann : node.getNodeData().getSequence().getAnnotations() ) {\r
- if ( match( ann.getDesc(), query, case_sensitive, partial ) ) {\r
+ if ( match( ann.getDesc(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( ann.getRef(), query, case_sensitive, partial ) ) {\r
+ if ( match( ann.getRef(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break;\r
}\r
if ( !match && node.getNodeData().isHasSequence()\r
&& ( node.getNodeData().getSequence().getCrossReferences() != null ) ) {\r
for( final Accession x : node.getNodeData().getSequence().getCrossReferences() ) {\r
- if ( match( x.getComment(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getComment(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( x.getSource(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getSource(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break;\r
}\r
- if ( match( x.getValue(), query, case_sensitive, partial ) ) {\r
+ if ( match( x.getValue(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break;\r
}\r
if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) {\r
Iterator<String> it = node.getNodeData().getBinaryCharacters().getPresentCharacters().iterator();\r
I: while ( it.hasNext() ) {\r
- if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+ if ( match( it.next(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break I;\r
}\r
}\r
it = node.getNodeData().getBinaryCharacters().getGainedCharacters().iterator();\r
I: while ( it.hasNext() ) {\r
- if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+ if ( match( it.next(), query, case_sensitive, partial, false ) ) {\r
match = true;\r
break I;\r
}\r
private static boolean match( final String s,\r
final String query,\r
final boolean case_sensitive,\r
- final boolean partial ) {\r
- return match( s, query, case_sensitive, partial, false );\r
- }\r
-\r
- private static boolean match( final String s,\r
- final String query,\r
- final boolean case_sensitive,\r
final boolean partial,\r
final boolean regex ) {\r
- \r
if ( ForesterUtil.isEmpty( s ) || ForesterUtil.isEmpty( query ) ) {\r
return false;\r
}\r
}\r
}\r
catch ( final PatternSyntaxException e ) {\r
- throw e;\r
+ return false;\r
}\r
if ( p != null ) {\r
return p.matcher( my_s ).find();\r
}\r
else {\r
- throw new RuntimeException( "failed to create new pattern" );\r
+ return false;\r
}\r
}\r
else if ( partial ) {\r