if ( phy == null || phy.getNumberOfExternalNodes() < 2 ) {\r
return;\r
}\r
- List<PhylogenyNode> nodes = null;\r
+ List<PhylogenyNode> nodes = new ArrayList<PhylogenyNode>();\r
if ( ( getCurrentTreePanel().getFoundNodes0() != null ) || ( getCurrentTreePanel().getFoundNodes1() != null ) ) {\r
- nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes();\r
+ final List<PhylogenyNode> all_selected_nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes();\r
+ for( final PhylogenyNode n : all_selected_nodes ) {\r
+ if ( n.isExternal() ) {\r
+ nodes.add( n );\r
+ }\r
+ }\r
}\r
+ \r
String function = "Retain";\r
if ( delete ) {\r
function = "Delete";\r