package com.owen.tetris.ui;

import javax.swing.*;
import java.awt.*;

/**
 * Created by mike on 15/12/13.
 */
public class PanelGame extends JPanel {

    private Layer layer1 = new Layer(128, 32, 320, 576);

    public PanelGame() {
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

        layer1.createWindow(g);

//        Image img = new ImageIcon("graphics/window/Window2.png").getImage();
//
//
//        int x = 32;
//        int y = 32;
//        int w = 256;
//        int h = 128;
//        int size = 7;
//        int imgW = img.getWidth(null);
//        int imgH = img.getHeight(null);
//
//        g.drawImage(img, x, y, x + size, y + size, 0, 0, size, size, null);
//        g.drawImage(img, x + size, y, x + w - size, y + size, size, 0, imgW - size, size, null);
//        g.drawImage(img, x + w - size, y, x + w, y + size, imgW - size, 0, imgW, size, null);
//        g.drawImage(img, x, y + size, x + size, y + h - size, 0, size, size, imgH - size, null);
//        g.drawImage(img, x + size, y + size, x + w - size, y + h - size, size, size, imgW - size, imgH - size, null);
//        g.drawImage(img, x + w - size, y + size, x + w, y + h - size, imgW - size, size, imgW, imgH - size, null);
//        g.drawImage(img, x, y + h - size, x + size, y + h, 0, imgH - size, size, imgH, null);
//        g.drawImage(img, x + size, y + h - size, x + w - size, y + h, size, imgH - size, imgW - size, imgH, null);
//        g.drawImage(img, x + w - size, y + h - size, x + w, y + h, imgW - size, imgH - size, imgW, imgH, null);
    }


}

@@ -162,23 +162,25 @@
 te Layer
+%5B%5D
  layer
-1
+s
  = new L
@@ -187,1095 +187,452 @@
 ayer
-(128, 32, 320, 576);%0A%0A    public PanelGame()
+%5B%5D
  %7B%0A    
-%7D%0A%0A
     
-@Override%0A    protected void paintComponent(Graphics g) %7B%0A        super.paintComponent(g);%0A%0A        layer1.createWindow(g);%0A%0A//        Image img = new ImageIcon(%22graphics/window/Window2.png%22).getImage();%0A//%0A//%0A//        int x = 32;%0A//        int y = 32;%0A//        int w = 256;%0A//        int h = 128;%0A//        int size = 7;%0A//        int imgW = img.getWidth(null);%0A//        int imgH = img.getHeight(null);%0A//%0A//        g.drawImage(img, x, y, x + size, y + size, 0, 0, size, size, null);%0A//        g.drawImage(img, x + size, y, x + w - size, y + size, size, 0, imgW - size, size, null);%0A//        g.drawImage(img, x + w - size, y, x + w, y + size, imgW - size, 0, imgW, size, null);%0A//        g.drawImage(img, x, y + size, x + size, y + h - size, 0, size, size, imgH - size, null);%0A//        g.drawImage(img, x + size, y + size, x + w - size, y + h - size, size, size, imgW - size, imgH - size, null);%0A//        g.drawImage(img, x + w - size, y + size, x + w, y + h - size, imgW - size, size, imgW, imgH - size, null);%0A//
+    new Layer(40, 32, 334, 279),%0A            new Layer(40, 343, 334, 279),%0A            new Layer(414, 32, 334, 590),%0A            new Layer(788, 32, 334, 124),%0A            new Layer(788, 188, 176, 148),%0A            new Layer(964, 188, 158, 148),%0A            new Layer(788, 368, 334, 200)%0A    %7D;%0A%0A    public PanelGame() %7B%0A    %7D%0A%0A    @Override%0A    protected void paintComponent(Graphics g) %7B%0A        super.paintComponent(g);%0A%0A
         
 g.dr
@@ -631,324 +631,98 @@
     
-g.drawImage(img, x, y + h - size, x + size, y + h, 0, imgH - size, size, imgH, null);%0A//        g.drawImage(img, x + size, y + h - size, x + w - size, y + h, size, imgH - size, imgW - size, imgH, null);%0A//        g.drawImage(img, x + w - size, y + h - size, x + w, y + h, imgW - size, imgH - size, imgW, imgH, null);
+for (int i = 0; i %3C layers.length; i++) %7B%0A            layers%5Bi%5D.createWindow(g);%0A        %7D
 %0A   

create Layer Arrays