+ TaxonNode parent = taxonNode.getParent();
+ if (parent != null){
+ parent.removeChildNode(taxonNode);
+ }
+ taxonNodes.remove(taxonNode);
+
+ }
+
+ public void removeTaxonNode(TaxonNode taxonNode, boolean deleteChildren){
+ TaxonNode parent = taxonNode.getParent();
+ //taxonNode.setTaxon(null);
+ if ((!taxonNode.getChildNodes().isEmpty() && deleteChildren) || (taxonNode.getChildNodes().isEmpty()) ){
+
+ taxonNode.delete();
+
+ } else if (!taxonNode.isTopmostNode()){
+ Set<TaxonNode> children = taxonNode.getChildNodes();
+ Iterator<TaxonNode> childrenIterator = children.iterator();
+ while (childrenIterator.hasNext()){
+ TaxonNode childNode = childrenIterator.next();
+ childrenIterator.remove();
+ parent.addChildNode(childNode, null, null, null);
+
+ }
+ //parent.removeChildNode(taxonNode);
+ taxonNode.delete();
+ } else if (taxonNode.isTopmostNode()){
+
+ }
+