From ed18f8f5c92b7ba1106169e91749e6b5ff7f8d6f Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 3 May 2022 16:38:26 +0200 Subject: [PATCH] NAME CORRECTION "feather" -> "FEATHER" and UPDATE LaticeApplicationConsole, LaticeApplicationWindow --- .../application/LaticeApplicationConsole.java | 1 + .../application/LaticeApplicationWindow.java | 38 ++++++++++++++++--- src/main/java/latice/model/Shape.java | 2 +- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/main/java/latice/application/LaticeApplicationConsole.java b/src/main/java/latice/application/LaticeApplicationConsole.java index ad11012..90c96f0 100644 --- a/src/main/java/latice/application/LaticeApplicationConsole.java +++ b/src/main/java/latice/application/LaticeApplicationConsole.java @@ -19,6 +19,7 @@ public class LaticeApplicationConsole { for (Color color : Color.values()) { for (Shape shape : Shape.values()) { Tile tile = new Tile(color, shape); + System.out.println(color.getStringColor() + shape.getStringShape()+ ".png"); listOfTile.add(tile); diff --git a/src/main/java/latice/application/LaticeApplicationWindow.java b/src/main/java/latice/application/LaticeApplicationWindow.java index 9c8afa6..51e0be2 100644 --- a/src/main/java/latice/application/LaticeApplicationWindow.java +++ b/src/main/java/latice/application/LaticeApplicationWindow.java @@ -1,6 +1,6 @@ package latice.application; -import java.io.File; +import java.util.ArrayList; import javafx.application.Application; import javafx.geometry.Insets; @@ -10,21 +10,22 @@ import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; -import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; import latice.model.Color; +import latice.model.Deck; +import latice.model.Rack; import latice.model.Shape; import latice.model.Tile; public class LaticeApplicationWindow extends Application{ - Image image = new Image("C:/Users/cemal/saebut1/latice/src/main/resources/laticePlateau.png"); + Image image = new Image("laticePlateau.png"); ImageView imageView = new ImageView(image); - Tile blueBird = new Tile(Color.BLUE, Shape.BIRD); - Tile greenLeaf = new Tile(Color.GREEN, Shape.LEAF); + Tile blueBird = new Tile(Color.NAVYBLUE, Shape.BIRD); + Tile greenLeaf = new Tile(Color.GREEN, Shape.FEATHER); Tile redFlower = new Tile(Color.RED, Shape.FLOWER); public static void main(String[] args) { @@ -44,7 +45,26 @@ public class LaticeApplicationWindow extends Application{ //Image root.setCenter(imageView); + //-------------------------------------------------------------------------------------- + //Deck + ArrayList listOfTile = new ArrayList(); + + for (Color color : Color.values()) { + for (Shape shape : Shape.values()) { + Tile tile = new Tile(color, shape); + System.out.println(color.getStringColor() + shape.getStringShape()+ ".png"); + + listOfTile.add(tile); + + } + } + + Deck deck = new Deck(listOfTile); + + + //-------------------------------------------------------------------------------------- //Rack + //Without Image HBox rack = new HBox(); rack.setSpacing(10); @@ -61,6 +81,14 @@ public class LaticeApplicationWindow extends Application{ rack.setAlignment(Pos.CENTER); root.setBottom(rack); + //With Image + Rack rack2 = new Rack(deck); + HBox rackImage = rack2.createImageTileOfRack(); // TODO Create the deck + + + root.setBottom(rackImage); + + //-------------------------------------------------------------------------------------- Scene scene = new Scene(root, 1280, 720); diff --git a/src/main/java/latice/model/Shape.java b/src/main/java/latice/model/Shape.java index 29c750a..e6d7da5 100644 --- a/src/main/java/latice/model/Shape.java +++ b/src/main/java/latice/model/Shape.java @@ -4,7 +4,7 @@ public enum Shape { BIRD("bird"), DOLPHIN("dolphin"), FLOWER("flower"), - feather("feather"), + FEATHER("feather"), GECKO("gecko"), TURTLE("turtle");