package code;

import code.service.LevelParser;

import java.io.FileNotFoundException;

/**
 * Created by eric on 10/26/15.
 */
public class Main {
    public static void main(String[] arg) {
        try {
            LevelParser.parse("./src/main/resources/level1.json");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}

@@ -40,16 +40,279 @@
 lParser;
+%0Aimport javafx.application.Application;%0Aimport javafx.scene.Group;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.control.Label;%0Aimport javafx.scene.layout.StackPane;%0Aimport javafx.scene.paint.Color;%0Aimport javafx.scene.shape.Rectangle;%0Aimport javafx.stage.Stage;
 %0A%0Aimport
@@ -344,16 +344,17 @@
 ption;%0A%0A
+%0A
 /**%0A * C
@@ -403,17 +403,114 @@
 ss Main 
-%7B
+extends Application %7B%0A    private double sceneWidth = 1024;%0A    private double sceneHeight = 768;%0A
 %0A    pub
@@ -542,16 +542,17 @@
 ng%5B%5D arg
+s
 ) %7B%0A    
@@ -718,13 +718,1559 @@
    %7D
+%0A%0A        launch(args);%0A    %7D%0A%0A    @Override%0A    public void start(Stage stage) throws Exception %7B%0A        stage.setTitle(%22Chips Challenge - Created by Eric Pfeiffer%22);%0A%0A        Group root = new Group();%0A%0A        int n = 10;%0A        int m = 10;%0A%0A        double gridWidth = sceneWidth / n;%0A        double gridHeight = sceneHeight / m;%0A%0A        MyNode%5B%5D%5B%5D playfield = new MyNode%5Bn%5D%5Bm%5D;%0A%0A        // initialize playfield%0A        for (int i = 0; i %3C n; i++) %7B%0A            for (int j = 0; j %3C m; j++) %7B%0A%0A                // create node%0A                MyNode node = new MyNode(%22Item %22 + i + %22/%22 + j, i * gridWidth, j * gridHeight, gridWidth, gridHeight);%0A%0A                // add node to group%0A                root.getChildren().add(node);%0A%0A                // add to playfield for further reference using an array%0A                playfield%5Bi%5D%5Bj%5D = node;%0A%0A            %7D%0A        %7D%0A%0A        Scene scene = new Scene(root, sceneWidth, sceneHeight);%0A        stage.setScene(scene);%0A        stage.show();%0A    %7D%0A%0A    public static class MyNode extends StackPane %7B%0A        public MyNode(String name, double x, double y, double width, double height) %7B%0A            // Create Rectangle%0A            Rectangle rectangle = new Rectangle(width, height);%0A            rectangle.setStroke(Color.BLACK);%0A            rectangle.setFill(Color.LIGHTBLUE);%0A%0A            // Create Label%0A            Label label = new Label(name);%0A%0A            // set Position%0A            setTranslateX(x);%0A            setTranslateY(y);%0A%0A            getChildren().addAll(rectangle, label);%0A        %7D
 %0A    %7D%0A%7D
 %0A
@@ -2268,9 +2268,8 @@
 %0A    %7D%0A%7D
-%0A

Add Grid to GUI