forked from jarolrod/java-solitaire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacesUpGameController.java
More file actions
96 lines (78 loc) · 2.83 KB
/
acesUpGameController.java
File metadata and controls
96 lines (78 loc) · 2.83 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package controllers;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.MenuBar;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.io.IOException;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import GUI.ExitWindow;
import code.AcesUpGame;
import GUI.AboutWindow;
public class acesUpGameController {
@FXML VBox scene;
@FXML MenuBar _gameMenu;
private AcesUpGame newGame = new AcesUpGame();
public void initialize() {
scene.getChildren().add(newGame);
scene.setMinHeight(900);
}
@FXML protected void freecellMenuClick() throws IOException {
boolean response = ExitWindow.display("Confirm", "Are you sure you would like to exit out of your current game and start a new Freecell Game?");
if (response) {
Stage main = (Stage) _gameMenu.getScene().getWindow();
Parent freecellFXML = FXMLLoader.load(getClass().getResource("/fxml/freecellGame.fxml"));
freecellFXML.getStylesheets().add("/stylesheets/freecellGame.css");
Scene freecellScene = new Scene(freecellFXML);
main.setScene(freecellScene);
main.show();
}
}
@FXML protected void bakersDozenMenuClick() throws IOException {
boolean response = ExitWindow.display("Confirm", "Are you sure you would like to exit out of your current game and start a new Baker's Dozen Game?");
if (response) {
Stage main = (Stage) _gameMenu.getScene().getWindow();
Parent bakersDozenFXML = FXMLLoader.load(getClass().getResource("/fxml/bakersDozenGame.fxml"));
bakersDozenFXML.getStylesheets().add("/stylesheets/bakersDozenGame.css");
Scene bakersDozenScene = new Scene(bakersDozenFXML);
main.setScene(bakersDozenScene);
main.show();
}
}
@FXML protected void acesUpMenuClick() throws IOException {
boolean response = ExitWindow.display("Confirm", "Are you sure you would like to exit out of your current game and start a new Baker's Dozen Game?");
if (response) {
Stage main = (Stage) _gameMenu.getScene().getWindow();
Parent acesUpFXML = FXMLLoader.load(getClass().getResource("/fxml/acesUpGame.fxml"));
acesUpFXML.getStylesheets().add("/stylesheets/acesUpGame.css");
Scene acesUpScene = new Scene(acesUpFXML);
main.setScene(acesUpScene);
main.show();
}
}
@FXML protected void exitMenuClick() {
boolean response = ExitWindow.display("Confirm", "Are you sure you want to quit your Baker's Dozen Game?");
if (response) {
Stage main = (Stage) _gameMenu.getScene().getWindow();
main.close();
}
}
@FXML protected void defaultSkin() {
newGame.defaultSkin();
}
@FXML protected void koiSkin() {
newGame.koiSkin();
}
@FXML protected void jungleSkin() {
newGame.jungleSkin();
}
@FXML protected void desertSkin() {
newGame.desertSkin();
}
@FXML protected void aboutMenuClick() {
AboutWindow.display();
}
@FXML protected void gameInfoMenuClick() {
}
}