public Point getKnobFromIndex(int index) {

        switch (index) {
            case 0:
                return new Point(((Rectangle) shape).x + ((Rectangle) shape).width, ((Rectangle) shape).y + ((Rectangle) shape).height);

            case 1:
                return new Point(((Rectangle) shape).x, ((Rectangle) shape).y + ((Rectangle) shape).height);

            case 2:
                return new Point(((Rectangle) shape).x, ((Rectangle) shape).y);

            case 3:
                return new Point(((Rectangle) shape).x + ((Rectangle) shape).width, ((Rectangle) shape).y);

            default:
                return null;

        }

    }