import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyMethods;
+import org.forester.phylogeny.PhylogenyMethods.DESCENDANT_SORT_PRIORITY;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Sequence;
import org.forester.phylogeny.data.SequenceRelation;
private int _subtree_cb_item;
private int _color_subtree_cb_item;
private int _open_seq_web_item;
+ private int _sort_descendents_item;
private int _open_tax_web_item;
private int _cut_subtree_item;
private int _copy_subtree_item;
showWhole();
}
else if ( e.getSource() == _order ) {
- tp.getPhylogeny().orderAppearance( _order_of_appearance );
+ DESCENDANT_SORT_PRIORITY pri = DESCENDANT_SORT_PRIORITY.TAXONOMY;
+ if ( ( !isShowTaxonomyScientificNames() && !isShowTaxonomyCode() && !isShowTaxonomyCommonNames() ) ) {
+ if ( ( isShowSequenceAcc() || isShowGeneNames() || isShowGeneSymbols() ) ) {
+ pri = DESCENDANT_SORT_PRIORITY.SEQUENCE;
+ }
+ else if ( isShowNodeNames() ) {
+ pri = DESCENDANT_SORT_PRIORITY.NODE_NAME;
+ }
+ }
+ PhylogenyMethods.orderAppearance( tp.getPhylogeny().getRoot(), _order_of_appearance, true, pri );
_order_of_appearance = !_order_of_appearance;
+ tp.setNodeInPreorderToNull();
+ tp.getPhylogeny().externalNodesHaveChanged();
+ tp.getPhylogeny().hashIDs();
+ tp.getPhylogeny().recalculateNumberOfExternalDescendants( true );
+ tp.resetNodeIdToDistToLeafMap();
+ tp.setEdited( true );
displayedPhylogenyMightHaveChanged( false );
}
else if ( e.getSource() == _uncollapse_all ) {
else if ( action == _open_seq_web_item ) {
setActionWhenNodeClicked( NodeClickAction.OPEN_SEQ_WEB );
}
+ else if ( action == _sort_descendents_item ) {
+ setActionWhenNodeClicked( NodeClickAction.SORT_DESCENDENTS );
+ }
else if ( action == _blast_item ) {
if ( !Constants.__RELEASE && !Constants.__SNAPSHOT_RELEASE ) {
setActionWhenNodeClicked( NodeClickAction.BLAST );
}
cb_index++;
}
+ if ( _configuration.doDisplayClickToOption( Configuration.sort_descendents ) ) {
+ _sort_descendents_item = cb_index;
+ addClickToOption( Configuration.sort_descendents,
+ _configuration.getClickToTitle( Configuration.sort_descendents ) );
+ if ( default_option == Configuration.sort_descendents ) {
+ selected_index = cb_index;
+ }
+ cb_index++;
+ }
if ( _configuration.doDisplayClickToOption( Configuration.color_subtree ) ) {
_color_subtree_cb_item = cb_index;
addClickToOption( Configuration.color_subtree, _configuration.getClickToTitle( Configuration.color_subtree ) );
PASTE_SUBTREE,
ADD_NEW_NODE,
EDIT_NODE_DATA,
+ SORT_DESCENDENTS,
BLAST;
}
}