public Tree extractSelectedTree() {
		DrawableNode ancestor = null;
		if (selectedNodes.size()==1) {
			DrawableNode node = selectedNodes.get(0);
			ancestor = node;
		}
		else {
			ancestor = findCommonAncestor(selectedNodes);
		}
		if (ancestor==null) {
			ErrorWindow.showErrorWindow(new NullPointerException("Could not find common ancestor of selected nodes"), SunFishFrame.getSunFishFrame().getLogger());
			return null;
		}
		DrawableNode newroot = ancestor.cloneWithDescendants();
		newroot.setParent(null);
		newroot.setDistToParent(Double.NaN);
	
		DrawableTree newTree = null;
		Constructor<?>[] conList = this.getClass().getConstructors();
		for(Constructor cons : conList) {
			if (cons.getParameterTypes().length==1 && cons.getParameterTypes()[0]==DrawableNode.class) {
				try {
					System.out.println("Invoking constructor for class " + this.getClass());
					newTree = (DrawableTree) cons.newInstance(new Object[] {newroot});
				} catch (Exception ex) {
					ErrorWindow.showErrorWindow(ex);
				}
			}
		}

		List<Node> tips = newTree.getAllTips();
		int removed = 0;
		for(Node tip : tips) {
			if ( ! ((DrawableNode)tip).isSelected() ) {
				newTree.removeNode(tip);
				removed++;
			}
		}
		
		return newTree;
	}