-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaneOrganizer.java
More file actions
41 lines (33 loc) · 1022 Bytes
/
PaneOrganizer.java
File metadata and controls
41 lines (33 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package andrieste;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
/**
* This is PaneOrganizer class. It organizes all the program's graphical panes, which
* is just the single game pane in this case.
*/
public class PaneOrganizer {
private BorderPane root;
/**
* Constructor. It initializes the root and creates the game.
*/
public PaneOrganizer() {
this.root = new BorderPane();
this.createGame();
}
/**
* This method creates the game pane, sets the style of it, and also adds the pane
* to the root's center. It them calls the constructor of the game class.
*/
private void createGame() {
Pane gamePane = new Pane();
gamePane.setStyle("-fx-background-color: linear-gradient(to bottom, #8968DB, #221B77);");
this.root.setCenter(gamePane);
new Game(gamePane);
}
/**
* returns the root of this class.
*/
public BorderPane getRoot() {
return this.root;
}
}