private int _paste_subtree_item;
private int _add_new_node_item;
private int _edit_node_data_item;
+ private int _get_ext_desc_data;
private int _blast_item;
// zooming and quick tree manipulation buttons:
private JButton _zoom_in_x;
_order_of_appearance = !_order_of_appearance;
tp.setNodeInPreorderToNull();
tp.getPhylogeny().externalNodesHaveChanged();
- tp.getPhylogeny().hashIDs();
+ tp.getPhylogeny().clearHashIdToNodeMap();
tp.getPhylogeny().recalculateNumberOfExternalDescendants( true );
tp.resetNodeIdToDistToLeafMap();
tp.setEdited( true );
}
void displayedPhylogenyMightHaveChanged( final boolean recalc_longest_ext_node_info ) {
- if ( ( _mainpanel != null ) && ( _mainpanel.getCurrentPhylogeny() != null ) ) {
+ if ( ( _mainpanel != null )
+ && ( ( _mainpanel.getCurrentPhylogeny() != null ) && !_mainpanel.getCurrentPhylogeny().isEmpty() ) ) {
if ( getOptions().isShowOverview() ) {
_mainpanel.getCurrentTreePanel().updateOvSizes();
}
else if ( action == _edit_node_data_item ) {
setActionWhenNodeClicked( NodeClickAction.EDIT_NODE_DATA );
}
+ else if ( action == _get_ext_desc_data ) {
+ setActionWhenNodeClicked( NodeClickAction.GET_EXT_DESC_DATA );
+ }
else {
throw new RuntimeException( "unknown action: " + action );
}
}
cb_index++;
}
+ if ( _configuration.doDisplayClickToOption( Configuration.get_ext_desc_data ) ) {
+ _get_ext_desc_data = cb_index;
+ addClickToOption( Configuration.get_ext_desc_data,
+ _configuration.getClickToTitle( Configuration.get_ext_desc_data ) );
+ if ( default_option == Configuration.get_ext_desc_data ) {
+ selected_index = cb_index;
+ }
+ cb_index++;
+ }
if ( getOptions().isEditable() ) {
if ( _configuration.doDisplayClickToOption( Configuration.cut_subtree ) ) {
_cut_subtree_item = cb_index;
* Fit entire tree into window.
*/
void showWhole() {
- if ( _mainpanel.getCurrentScrollPane() == null ) {
+ if ( ( _mainpanel.getCurrentScrollPane() == null ) || _mainpanel.getCurrentTreePanel().getPhylogeny().isEmpty() ) {
return;
}
getCurrentTreePanel().updateSetOfCollapsedExternalNodes();
tp.updateSetOfCollapsedExternalNodes();
t.recalculateNumberOfExternalDescendants( false );
tp.setNodeInPreorderToNull();
- t.hashIDs();
+ t.clearHashIdToNodeMap();
showWhole();
}
}
ADD_NEW_NODE,
EDIT_NODE_DATA,
SORT_DESCENDENTS,
+ GET_EXT_DESC_DATA,
BLAST;
}
}