public static void mousePointReleased(MouseEvent e) {
        boolean isDelete = false;
        if (isClicked) {
            boolean isContained = false;
            //Проверка, отпускаем ли над областью точки
            for (Shapes.Point point : points) {
                isContained = point.equals(new Shapes.Point(e.getX(), e.getY()), 40);
                isDelete = isContained &&
                        point.equals(new Shapes.Point(e.getX(), e.getY()), 30) && isDragged != -2;
                if (isContained) break;
            }
            if (isDragged != -2) {
                if (!isContained) {
                    points.add(new Shapes.Point(e.getX(), e.getY()));
                    g.drawOval(e.getX() - 3, e.getY() - 3, 3, 3);
                } else if (isDragged > -1 && isDelete) {
                    points.remove(isDragged);
                }
            } else {
                points.add(new Shapes.Point(X0, Y0));
                g.drawOval(X0 - 3, Y0 - 3, 3, 3);
            }

            isDragged = -1;
            isClicked = false;
            clearImage();
            showPoints();
            jLabel1.repaint();
        }
        jButton2.setEnabled(points.size() > 2);
    }