@Override
    public void mouseReleased(MouseEvent e) {
        switch (global) {
            case EditMode:
                if (e.getButton() == MouseEvent.BUTTON1) {
                    switch (mode) {
                        case EditPoly:
                            if (grabbed != null) {
                                grabbed.x = e.getX();
                                grabbed.y = e.getY();
                                if (selected != null) {
                                    selected.generatePoly();
                                }
                                grabbed = null;

                            }
                            break;

                    }
                }
                break;
        }
        //this.repaint();
    }