NAME CORRECTION "feather" -> "FEATHER" and UPDATE

LaticeApplicationConsole, LaticeApplicationWindow
master
Mathis 2022-05-03 16:38:26 +02:00
parent b72112ad8d
commit ed18f8f5c9
3 changed files with 35 additions and 6 deletions

View File

@ -19,6 +19,7 @@ public class LaticeApplicationConsole {
for (Color color : Color.values()) { for (Color color : Color.values()) {
for (Shape shape : Shape.values()) { for (Shape shape : Shape.values()) {
Tile tile = new Tile(color, shape); Tile tile = new Tile(color, shape);
System.out.println(color.getStringColor() + shape.getStringShape()+ ".png");
listOfTile.add(tile); listOfTile.add(tile);

View File

@ -1,6 +1,6 @@
package latice.application; package latice.application;
import java.io.File; import java.util.ArrayList;
import javafx.application.Application; import javafx.application.Application;
import javafx.geometry.Insets; import javafx.geometry.Insets;
@ -10,21 +10,22 @@ import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font; import javafx.scene.text.Font;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import javafx.stage.Stage; import javafx.stage.Stage;
import latice.model.Color; import latice.model.Color;
import latice.model.Deck;
import latice.model.Rack;
import latice.model.Shape; import latice.model.Shape;
import latice.model.Tile; import latice.model.Tile;
public class LaticeApplicationWindow extends Application{ 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); ImageView imageView = new ImageView(image);
Tile blueBird = new Tile(Color.BLUE, Shape.BIRD); Tile blueBird = new Tile(Color.NAVYBLUE, Shape.BIRD);
Tile greenLeaf = new Tile(Color.GREEN, Shape.LEAF); Tile greenLeaf = new Tile(Color.GREEN, Shape.FEATHER);
Tile redFlower = new Tile(Color.RED, Shape.FLOWER); Tile redFlower = new Tile(Color.RED, Shape.FLOWER);
public static void main(String[] args) { public static void main(String[] args) {
@ -44,7 +45,26 @@ public class LaticeApplicationWindow extends Application{
//Image //Image
root.setCenter(imageView); root.setCenter(imageView);
//--------------------------------------------------------------------------------------
//Deck
ArrayList<Tile> listOfTile = new ArrayList<Tile>();
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 //Rack
//Without Image
HBox rack = new HBox(); HBox rack = new HBox();
rack.setSpacing(10); rack.setSpacing(10);
@ -61,6 +81,14 @@ public class LaticeApplicationWindow extends Application{
rack.setAlignment(Pos.CENTER); rack.setAlignment(Pos.CENTER);
root.setBottom(rack); 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); Scene scene = new Scene(root, 1280, 720);

View File

@ -4,7 +4,7 @@ public enum Shape {
BIRD("bird"), BIRD("bird"),
DOLPHIN("dolphin"), DOLPHIN("dolphin"),
FLOWER("flower"), FLOWER("flower"),
feather("feather"), FEATHER("feather"),
GECKO("gecko"), GECKO("gecko"),
TURTLE("turtle"); TURTLE("turtle");