working main screen
parent
b568c967c6
commit
2e34cb91b4
|
@ -58,6 +58,7 @@ public class LaticeApplicationWindow extends Application {
|
|||
ArrayList<Image> listTileImage = Rack.getRackTileImage();
|
||||
ArrayList<Tile> listOfTile = new ArrayList<Tile>();
|
||||
Map<Rectangle, Tile> assocRectangleTile = new HashMap<Rectangle, Tile>();
|
||||
static BorderPane rootLayout;
|
||||
|
||||
|
||||
public static int indexTileClicked;
|
||||
|
@ -261,8 +262,7 @@ public class LaticeApplicationWindow extends Application {
|
|||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
Scene scene = new Scene(root, 1280, 720);
|
||||
setRootLayout(root);
|
||||
|
||||
primaryStage.setResizable(false);
|
||||
primaryStage.setTitle("Latice");
|
||||
|
@ -270,8 +270,12 @@ public class LaticeApplicationWindow extends Application {
|
|||
primaryStage.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void setRootLayout(BorderPane root) {
|
||||
rootLayout = root;
|
||||
}
|
||||
public static BorderPane getRootLayout() {
|
||||
return rootLayout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -288,5 +292,7 @@ public class LaticeApplicationWindow extends Application {
|
|||
public static void setIndexTileClicked(int indexTileClicked) {
|
||||
LaticeApplicationWindow.indexTileClicked = indexTileClicked;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@ package latice.controller;
|
|||
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.shape.Rectangle;
|
||||
import javafx.stage.Stage;
|
||||
import latice.application.LaticeApplicationWindow;
|
||||
|
||||
public class MainScreenController extends LaticeApplicationWindow{
|
||||
|
@ -20,7 +22,10 @@ public class MainScreenController extends LaticeApplicationWindow{
|
|||
@FXML
|
||||
public void playButtonClicked(MouseEvent event) {
|
||||
System.out.println("playButtonClicked");
|
||||
|
||||
Stage stage = (Stage) ((Node) event.getTarget()).getScene().getWindow();
|
||||
BorderPane root = getRootLayout();
|
||||
Scene scene = new Scene(root, 1280, 720);
|
||||
stage.setScene(scene);
|
||||
}
|
||||
// Event Listener on Rectangle[#rulesButton].onMouseClicked
|
||||
@FXML
|
||||
|
|
Loading…
Reference in New Issue