public void draw(Graphics2D g) {
        final int s = 30; // size of a cell
        g.setColor(BACKGROUND);
        g.fillRect(x * s, y * s, s, s);
        g.setFont(FONT);

        if (state == State.OPEN) {
            g.setColor(OPENED);
            g.fillRect(x * s, y * s, s, s);
            if (type == Type.MINE) {
                g.setColor(Color.BLACK);
                g.fillOval((x * s) + 8, ((y * s) + 9), s / 2, s / 2);
                g.setColor(Color.WHITE);
                g.fillOval((x * s) + 10, ((y * s) + 12), 5, 5);
            } else if (surroundingBombs > 0) {
                g.setColor(CELL_COLOURS[surroundingBombs]);
                g.drawString(String.valueOf(surroundingBombs), (x * s) + 8,
                        ((y * s) + s) - 4);
            }
        }
        if (type == Type.FLAGGED || type == Type.FLAGGED_MINE) {
            g.setColor(Color.RED);
            g.fillRect((x * s) + 8, ((y * s) + 6), 15, 5);
            g.setColor(Color.BLACK);
            g.fillRect((x * s) + 14, ((y * s) + 11), 3, 15);
        }

        g.setColor(Color.GRAY); // outline
        g.drawRect(x * s, y * s, s, s); // outline
    }