public void paint(Graphics g) {

        Graphics2D g2d = (Graphics2D) g;
        int lw = getWidth() - 1;
        int lh = getHeight() - 1;
        int rw = GraphicField.SPACE_BETWEEN * 2;
        int rh = GraphicField.SPACE_BETWEEN * 2;

        BasicStroke pen = new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER);

        Color color = Color.red;

        if (isSelected) {
            color = Color.green;
        }

        g2d.setPaint(new GradientPaint(lw, lh, Color.white, lw / 4, lh / 4, color, true));
        g2d.fillRoundRect(0, 0, lw, lh, rw, rh);
        g2d.setColor(color);
        g2d.drawRoundRect(0, 0, lw, lh, rw, rh);

        if (!isClean && !isZero) {
            g2d.setStroke(pen);
            g2d.setColor(Color.black);
            g2d.drawLine(SPACE, SPACE, getWidth() - SPACE, getHeight() - SPACE);  // TODO вот так например можно изменять размер рисуемых фигур
            g2d.drawLine(getWidth() - SPACE, SPACE, SPACE, getHeight() - SPACE);
        } else if (!isClean) {
            g2d.setStroke(pen);
            g2d.setColor(Color.black);
            g2d.drawOval(SPACE, SPACE, getWidth() - 2 * SPACE, getHeight() - 2 * SPACE);
        }

    }