@Override
    public void mouseReleased(MouseEvent e)
    {
        super.mouseReleased(e);
        Vertex chosenPoint = chooseVertex(e);
        if (e.getButton() == MouseEvent.BUTTON1)
            addPoint(draggedToX, draggedToY);
        else if (e.getButton() == MouseEvent.BUTTON2)
            toggleWallMode(chosenPoint);
        else if (e.getButton() == MouseEvent.BUTTON3)
            closeLoop();
        vertices.buildGraph();
        gui.repaint();
    }