public void mouseClicked(MouseEvent mouseEvent) {
        Node selectedNode = treePane.getNodeAt((Graphics2D) treePane.getGraphics(), mouseEvent.getPoint());
        if (!mouseEvent.isShiftDown()) {
            treePane.clearSelection();
        }

        SelectionMode mode = selectionMode;
        if (mouseEvent.isAltDown()) {
            if (mode == SelectionMode.NODE) {
                mode = SelectionMode.CLADE;
            } else if (mode == SelectionMode.CLADE) {
                mode = SelectionMode.NODE;
            }
        }

        switch (mode) {
            case NODE:
                treePane.addSelectedNode(selectedNode);
                break;
            case CLADE:
                treePane.addSelectedClade(selectedNode);
                break;
            case TAXA:
                treePane.addSelectedTip(selectedNode);
                break;
            default:
                throw new IllegalArgumentException("Unknown SelectionMode: " + selectionMode.name());
        }
    }