public void setTree(RootedTree tree, Collection<Node> selectedNodes) {
        this.originalTree = tree;
        if (!originalTree.hasLengths()) {
            transformBranches = true;
        }

        Painter<?>[] pl = { taxonLabelPainter, nodeLabelPainter, branchLabelPainter };
        for( Painter<?> p : pl ) {
            if( p instanceof BasicLabelPainter ) {
                ((BasicLabelPainter)p).setTree(tree);
            }
        }


        selectedTaxa.clear();
        if( selectedNodes != this.selectedNodes ) {
            this.selectedNodes.clear();
        }
        if( selectedNodes != null ) {
            this.selectedNodes.addAll(selectedNodes);
        }

        setupTree();
    }