Skip to content

Commit

Permalink
Merge pull request #358 from ProgrammingLife2017/develop
Browse files Browse the repository at this point in the history
Final release
  • Loading branch information
YDutchy authored Jun 30, 2017
2 parents 4eff5d2 + ebf21eb commit f77e730
Show file tree
Hide file tree
Showing 69 changed files with 4,769 additions and 2,393 deletions.
26 changes: 26 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script: "mvn clean test"
script: mvn -Dtest=\!GuiControllerTest.java clean test
notifications:
email:
on_success: never
Expand All @@ -14,4 +14,4 @@ jdk:
addons:
apt:
packages:
- oracle-java8-installer
- oracle-java8-installer
2 changes: 1 addition & 1 deletion ProgrammingLife.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.github.uphy:javafx-console:ce9860eb36" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" />
<orderEntry type="library" name="Maven: com.diffplug.durian:durian:3.4.0" level="project" />
<orderEntry type="library" name="Maven: com.github.uphy:javafx-console:ce9860eb36" level="project" />
<orderEntry type="library" name="Maven: org.mapdb:mapdb:3.0.4" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.0.7" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-runtime:1.0.7" level="project" />
Expand Down
Binary file modified documents/Architecturedesign.pdf
Binary file not shown.
Binary file added documents/Final Report.pdf
Binary file not shown.
Binary file modified documents/ProductPlanning.pdf
Binary file not shown.
Binary file modified documents/ProductVision.pdf
Binary file not shown.
Binary file added documents/Sprintretrospective 8 - Blad1.pdf
Binary file not shown.
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>nl.tudelft.contextproject</groupId>
<artifactId>ProgrammingLife</artifactId>
<version>milestone4</version>
<version>final</version>
<packaging>jar</packaging>

<name>ProgrammingLife</name>
Expand Down Expand Up @@ -85,7 +85,6 @@
<version>2.20</version>
<configuration>
<excludes>
<!-- exclude tests here -->
<exclude>**/GuiControllerTest.java</exclude>
</excludes>
</configuration>
Expand Down
41 changes: 36 additions & 5 deletions src/main/java/programminglife/ProgrammingLife.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.DialogPane;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import programminglife.gui.Alerts;
import programminglife.gui.controller.GuiController;
import programminglife.parser.Cache;
import programminglife.utility.Alerts;
import programminglife.utility.Console;

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

private static Stage primaryStage;
private static boolean showCSS = false;
private static AnchorPane root;

/**
* Main method for the application.
*
* @param args argument
*/
public static void main(String[] args) {
Expand All @@ -40,7 +44,8 @@ public static void main(String[] args) {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/Basic_Gui.fxml"));
AnchorPane root = loader.load();
root = loader.load();
root.getStylesheets().add("/LightTheme.css");
primaryStage = stage;
primaryStage.setTitle("Programming Life");
primaryStage.setScene(new Scene(root));
Expand All @@ -49,8 +54,8 @@ public void start(Stage stage) throws IOException {
close.setOnAction(event -> primaryStage.fireEvent(
new WindowEvent(primaryStage, WindowEvent.WINDOW_CLOSE_REQUEST))
);
primaryStage.setMinWidth(600);
primaryStage.setMinHeight(400);
primaryStage.setMinWidth(1280);
primaryStage.setMinHeight(720);
primaryStage.sizeToScene();
primaryStage.show();
primaryStage.setMaximized(true);
Expand All @@ -65,6 +70,7 @@ public void start(Stage stage) throws IOException {

/**
* Process command line arguments.
*
* @param guiCtrl the {@link GuiController}, needed for opening files
* @throws IOException if a specified file cannot be opened
*/
Expand All @@ -85,8 +91,14 @@ private void arguments(GuiController guiCtrl) throws IOException {
* The event handler for when the application is closed.
* It will give show a confirmation box if the user wants to exit the application.
*/
private EventHandler<WindowEvent> confirmCloseEventHandler = event -> {
private final EventHandler<WindowEvent> confirmCloseEventHandler = event -> {
Alert closeConfirmation = new Alert(Alert.AlertType.CONFIRMATION, "Do you really want to exit?");
DialogPane pane = closeConfirmation.getDialogPane();
if (ProgrammingLife.getShowCSS()) {
pane.getStylesheets().add("/Alerts.css");
} else {
pane.getStylesheets().removeAll();
}
Button exitButton = (Button) closeConfirmation.getDialogPane().lookupButton(ButtonType.OK);
exitButton.setText("Exit");
closeConfirmation.setHeaderText("Confirm Exit");
Expand All @@ -104,11 +116,30 @@ private void arguments(GuiController guiCtrl) throws IOException {
});
};

/**
* Toggles which styleSheets is used for the program.
*/
public static void toggleCSS() {
showCSS = !showCSS;
if (showCSS) {
root.getStylesheets().remove("/LightTheme.css");
root.getStylesheets().add("/DarkTheme.css");
} else {
root.getStylesheets().remove("/DarkTheme.css");
root.getStylesheets().add("/LightTheme.css");
}
}

/**
* Returns the Stage if called upon.
*
* @return stage
*/
public static Stage getStage() {
return primaryStage;
}

public static boolean getShowCSS() {
return showCSS;
}
}
67 changes: 0 additions & 67 deletions src/main/java/programminglife/controller/MiniMapController.java

This file was deleted.

Loading

0 comments on commit f77e730

Please sign in to comment.