Skip to content

Commit f77e730

Browse files
authored
Merge pull request #358 from ProgrammingLife2017/develop
Final release
2 parents 4eff5d2 + ebf21eb commit f77e730

File tree

69 files changed

+4769
-2393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4769
-2393
lines changed

.idea/misc.xml

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ before_install:
44
- "export DISPLAY=:99.0"
55
- "sh -e /etc/init.d/xvfb start"
66
- sleep 3 # give xvfb some time to start
7-
script: "mvn clean test"
7+
script: mvn -Dtest=\!GuiControllerTest.java clean test
88
notifications:
99
email:
1010
on_success: never
@@ -14,4 +14,4 @@ jdk:
1414
addons:
1515
apt:
1616
packages:
17-
- oracle-java8-installer
17+
- oracle-java8-installer

ProgrammingLife.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
</content>
1313
<orderEntry type="inheritedJdk" />
1414
<orderEntry type="sourceFolder" forTests="false" />
15-
<orderEntry type="library" name="Maven: com.github.uphy:javafx-console:ce9860eb36" level="project" />
1615
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
1716
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
1817
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" />
1918
<orderEntry type="library" name="Maven: com.diffplug.durian:durian:3.4.0" level="project" />
19+
<orderEntry type="library" name="Maven: com.github.uphy:javafx-console:ce9860eb36" level="project" />
2020
<orderEntry type="library" name="Maven: org.mapdb:mapdb:3.0.4" level="project" />
2121
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.0.7" level="project" />
2222
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-runtime:1.0.7" level="project" />

documents/Architecturedesign.pdf

936 Bytes
Binary file not shown.

documents/Final Report.pdf

268 KB
Binary file not shown.

documents/ProductPlanning.pdf

13.2 KB
Binary file not shown.

documents/ProductVision.pdf

15 Bytes
Binary file not shown.
51.7 KB
Binary file not shown.

pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>nl.tudelft.contextproject</groupId>
88
<artifactId>ProgrammingLife</artifactId>
9-
<version>milestone4</version>
9+
<version>final</version>
1010
<packaging>jar</packaging>
1111

1212
<name>ProgrammingLife</name>
@@ -85,7 +85,6 @@
8585
<version>2.20</version>
8686
<configuration>
8787
<excludes>
88-
<!-- exclude tests here -->
8988
<exclude>**/GuiControllerTest.java</exclude>
9089
</excludes>
9190
</configuration>

src/main/java/programminglife/ProgrammingLife.java

+36-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
import javafx.scene.control.Alert;
99
import javafx.scene.control.Button;
1010
import javafx.scene.control.ButtonType;
11+
import javafx.scene.control.DialogPane;
1112
import javafx.scene.layout.AnchorPane;
1213
import javafx.stage.Modality;
1314
import javafx.stage.Stage;
1415
import javafx.stage.WindowEvent;
16+
import programminglife.gui.Alerts;
1517
import programminglife.gui.controller.GuiController;
1618
import programminglife.parser.Cache;
17-
import programminglife.utility.Alerts;
1819
import programminglife.utility.Console;
1920

2021
import java.io.File;
@@ -28,9 +29,12 @@
2829
public final class ProgrammingLife extends Application {
2930

3031
private static Stage primaryStage;
32+
private static boolean showCSS = false;
33+
private static AnchorPane root;
3134

3235
/**
3336
* Main method for the application.
37+
*
3438
* @param args argument
3539
*/
3640
public static void main(String[] args) {
@@ -40,7 +44,8 @@ public static void main(String[] args) {
4044
@Override
4145
public void start(Stage stage) throws IOException {
4246
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Basic_Gui.fxml"));
43-
AnchorPane root = loader.load();
47+
root = loader.load();
48+
root.getStylesheets().add("/LightTheme.css");
4449
primaryStage = stage;
4550
primaryStage.setTitle("Programming Life");
4651
primaryStage.setScene(new Scene(root));
@@ -49,8 +54,8 @@ public void start(Stage stage) throws IOException {
4954
close.setOnAction(event -> primaryStage.fireEvent(
5055
new WindowEvent(primaryStage, WindowEvent.WINDOW_CLOSE_REQUEST))
5156
);
52-
primaryStage.setMinWidth(600);
53-
primaryStage.setMinHeight(400);
57+
primaryStage.setMinWidth(1280);
58+
primaryStage.setMinHeight(720);
5459
primaryStage.sizeToScene();
5560
primaryStage.show();
5661
primaryStage.setMaximized(true);
@@ -65,6 +70,7 @@ public void start(Stage stage) throws IOException {
6570

6671
/**
6772
* Process command line arguments.
73+
*
6874
* @param guiCtrl the {@link GuiController}, needed for opening files
6975
* @throws IOException if a specified file cannot be opened
7076
*/
@@ -85,8 +91,14 @@ private void arguments(GuiController guiCtrl) throws IOException {
8591
* The event handler for when the application is closed.
8692
* It will give show a confirmation box if the user wants to exit the application.
8793
*/
88-
private EventHandler<WindowEvent> confirmCloseEventHandler = event -> {
94+
private final EventHandler<WindowEvent> confirmCloseEventHandler = event -> {
8995
Alert closeConfirmation = new Alert(Alert.AlertType.CONFIRMATION, "Do you really want to exit?");
96+
DialogPane pane = closeConfirmation.getDialogPane();
97+
if (ProgrammingLife.getShowCSS()) {
98+
pane.getStylesheets().add("/Alerts.css");
99+
} else {
100+
pane.getStylesheets().removeAll();
101+
}
90102
Button exitButton = (Button) closeConfirmation.getDialogPane().lookupButton(ButtonType.OK);
91103
exitButton.setText("Exit");
92104
closeConfirmation.setHeaderText("Confirm Exit");
@@ -104,11 +116,30 @@ private void arguments(GuiController guiCtrl) throws IOException {
104116
});
105117
};
106118

119+
/**
120+
* Toggles which styleSheets is used for the program.
121+
*/
122+
public static void toggleCSS() {
123+
showCSS = !showCSS;
124+
if (showCSS) {
125+
root.getStylesheets().remove("/LightTheme.css");
126+
root.getStylesheets().add("/DarkTheme.css");
127+
} else {
128+
root.getStylesheets().remove("/DarkTheme.css");
129+
root.getStylesheets().add("/LightTheme.css");
130+
}
131+
}
132+
107133
/**
108134
* Returns the Stage if called upon.
135+
*
109136
* @return stage
110137
*/
111138
public static Stage getStage() {
112139
return primaryStage;
113140
}
141+
142+
public static boolean getShowCSS() {
143+
return showCSS;
144+
}
114145
}

src/main/java/programminglife/controller/MiniMapController.java

-67
This file was deleted.

0 commit comments

Comments
 (0)