import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
private int _paste_subtree_item;
private int _reroot_cb_item;
private JButton _return_to_super_tree;
- // Search
+ // Search
private JLabel _search_found_label_0;
private JLabel _search_found_label_1;
private JButton _search_reset_button_0;
displayedPhylogenyMightHaveChanged( true );
}
else if ( e.getSource() == _decr_domain_structure_evalue_thr ) {
- _mainpanel.getCurrentTreePanel().decreaseDomainStructureEvalueThreshold();
+ _mainpanel.getCurrentTreePanel().decreaseDomainStructureEvalueThresholdExp();
+ search0();
+ search1();
displayedPhylogenyMightHaveChanged( true );
}
else if ( e.getSource() == _incr_domain_structure_evalue_thr ) {
- _mainpanel.getCurrentTreePanel().increaseDomainStructureEvalueThreshold();
+ _mainpanel.getCurrentTreePanel().increaseDomainStructureEvalueThresholdExp();
+ search0();
+ search1();
displayedPhylogenyMightHaveChanged( true );
}
else if ( e.getSource() == _search_tf_0 ) {
/**
* Indicates what action should be execute when a node is clicked
- *
+ *
* @return the click-on action
*/
NodeClickAction getActionWhenNodeClicked() {
_sequence_colors = sequence_colors;
}
- /* GUILHEM_END */
- /*
- * Set up the controls from the config settings. 11/26/05
- */
void setupControls() {
// The tree display options:
setupDisplayCheckboxes();
_mainpanel.getCurrentTreePanel().validate();
_mainpanel.validate();
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
_mainpanel.getCurrentTreePanel().resetPreferredSize();
_mainpanel.adjustJScrollPane();
_mainpanel.getCurrentTreePanel().repaint();
_mainpanel.getCurrentTreePanel().validate();
_mainpanel.validate();
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
_mainpanel.getCurrentTreePanel().resetPreferredSize();
_mainpanel.adjustJScrollPane();
_mainpanel.getCurrentTreePanel().repaint();
if ( tree_panel != null ) {
tree_panel.validate();
tree_panel.calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
void updateDomainStructureEvaluethresholdDisplay() {
if ( _domain_structure_evalue_thr_tf != null ) {
_domain_structure_evalue_thr_tf.setText( "10^"
- + getMainPanel().getCurrentTreePanel().getDomainStructureEvalueThreshold() );
+ + getMainPanel().getCurrentTreePanel().getDomainStructureEvalueThresholdExp() );
}
}
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( ",+" );
}
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;
}
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,
getOptions().isSearchCaseSensitive(),
!getOptions().isMatchWholeTermsOnly(),
getOptions().isSearchWithRegex(),
- isShowDomainArchitectures() ) );
+ isShowDomainArchitectures(),
+ tp != null ? Math.pow( 10, tp
+ .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 ) ) {
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( ",+" );
}
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;
}
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,
getOptions().isSearchCaseSensitive(),
!getOptions().isMatchWholeTermsOnly(),
getOptions().isSearchWithRegex(),
- isShowDomainArchitectures() ) );
+ isShowDomainArchitectures(),
+ tp != null ? Math.pow( 10, tp
+ .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 ) ) {
_get_ext_desc_data = cb_index;
if ( !ForesterUtil.isEmpty( getConfiguration().getLabelForGetExtDescendentsData() ) ) {
addClickToOption( Configuration.get_ext_desc_data, getConfiguration()
- .getLabelForGetExtDescendentsData() );
+ .getLabelForGetExtDescendentsData() );
}
else {
- String s = ";";
- switch ( getConfiguration().getExtDescNodeDataToReturn() ) {
- case NODE_NAME:
- s = "Node Names";
- break;
- case SEQUENCE_ACC:
- s = "Sequence Accessors";
- break;
- case SEQUENCE_MOL_SEQ:
- s = "Molecular Sequence";
- break;
- case SEQUENCE_MOL_SEQ_FASTA:
- s = "Molecular Sequence (Fasta)";
- break;
- case SEQUENCE_NAME:
- s = "Sequence Names";
- break;
- case GENE_NAME:
- s = "Gene Names";
- break;
- case SEQUENCE_SYMBOL:
- s = "Sequence Symbols";
- break;
- case TAXONOMY_CODE:
- s = "Taxonomy Codes";
- break;
- case TAXONOMY_COMM0N_NAME:
- s = "Taxonomy Common Names";
- break;
- case TAXONOMY_SCIENTIFIC_NAME:
- s = "Scientific Names";
- break;
- case UNKNOWN:
- s = "User Selected Data";
- break;
- default:
- throw new IllegalStateException( "dont know how to deal with "
- + getConfiguration().getExtDescNodeDataToReturn() );
- }
- 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;