public void drawLayer(Graphics g, int grid_size, boolean connected, int gx, int gy) {
        if (displayable) {
            for (int i = 0; i < gx; i++) {
                for (int j = 0; j < gy; j++) {
                    if (colorArr[i][j] != null) {
                        g.setColor(colorArr[i][j]);
                        if (connected) {
                            g.fillRect((i * grid_size) + 1, (j * grid_size) + 1, grid_size, grid_size);
                        } else {
                            g.fillRect((i * grid_size) + 1, (j * grid_size) + 1, grid_size - 1, grid_size - 1);
                        }
                    }
                }
            }
        }
    }