@Override
    public void paint(Graphics g){
        iniciarVAr(this);
        BufferedImage image = new BufferedImage(maxX,maxY, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = (Graphics2D) image.createGraphics();
        paintCuadricula(g2);
        asignarV(g2);
        switch (polygonPaint) {
            case 0:
                line.paint(g2, draw);
                break;
            case 1:
                curv.paint(g2, draw);
                break;
            case 2:
                triangle.paint(g2, draw, fill);
                break;
            case 3:
                rectangle.paint(g2, draw, fill);
                break;
            case 4:
                cu.paint(g2, draw, fill);
                break;
            case 5:
                elipse.paint(g2, draw, fill);
                break;
            case 6:
                arc.paint(g2, draw, fill);
                break;
           
        }
        g.drawImage(image, 0, 0, this);
    }