public synchronized void paste(RootedTree destTree, PhyloNode destNode)
{
if (isEmpty())
throw new Error("Called TreeClipboard.paste() with empty clipboard");
// Translate the newick string into a RooteTree.
PhyloTree tree = new PhyloTree();
TreeIO.parseNewickString(tree, newickString);
// Add the clone's vertices and edges to the destination tree.
synchronized (destTree)
{
Graphs.addGraph(destTree, tree);
// Insert the clone's root vertex into the midpoint above destNode.
if (destTree.getParentOf(destNode) == null)
{
destTree.addEdge(destNode, tree.getRoot());
} else
{
Object internalVertex = destTree.createAndAddVertex("");
destTree.insertNodeBetween(destTree.getParentOf(destNode),
destNode, internalVertex);
destTree.addEdge(internalVertex, tree.getRoot());
}
if (origTree != null)
{
if (origVertex.getState() == PhyloNode.CUT)