private void setupNodeOptions() {
        editButtons[0] = new Button("Set as Root");
        editButtons[1] = new Button("Set as End");

        for (int i = 0; i < editButtons.length; i++) {
            editButtons[i].setPreferredSize(new Dimension(80, 32));
            editButtons[i].setVisible(true);
            add(editButtons[i]);
        }

        // set as Root Node
        editButtons[0].addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (currentGraph.rootNode != null) {
                    currentGraph.rootNode.resetNode();
                }

                currentGraph.rootNode = selectedNode;

                if (currentGraph.rootNode != previousNode) {
                    previousNode = currentGraph.rootNode;
                    currentGraph.rootNode.setColour(Color.black);
                    currentGraph.rootNode.setasStart();
                } else if (currentGraph.rootNode == previousNode) {
                    if (previousNode == currentGraph.endNode) {
                        currentGraph.endNode.resetNode();
                        currentGraph.endNode = null;
                        currentGraph.rootNode.setColour(Color.black);
                        currentGraph.rootNode.setasStart();
                    } else {
                        currentGraph.rootNode.setColour(Color.black);
                        currentGraph.rootNode.setasStart();
                    }
                }

                repaint();
                hideNodeOptions();
            }
        });

        // set as Goal Node
        editButtons[1].addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (currentGraph.endNode != null) {
                    currentGraph.endNode.resetNode();
                }

                currentGraph.endNode = selectedNode;

                if (currentGraph.endNode != previousNode) {
                    previousNode = currentGraph.endNode;
                    currentGraph.endNode.setColour(Color.black);
                    currentGraph.endNode.setasEnd();
                } else if (currentGraph.endNode == previousNode) {
                    if (previousNode == currentGraph.rootNode) {
                        currentGraph.rootNode.resetNode();
                        currentGraph.rootNode = null;
                        currentGraph.endNode.setColour(Color.black);
                        currentGraph.endNode.setasEnd();
                    } else {
                        currentGraph.endNode.setColour(Color.black);
                        currentGraph.endNode.setasEnd();
                    }
                }

                repaint();
                hideNodeOptions();
            }
        });
    }