Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Use dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rauks committed Nov 29, 2013
1 parent 951b602 commit 92aa885
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
14 changes: 14 additions & 0 deletions BigBrother-Gui/nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,13 @@ is divided into following sections:
<param name="call.target" value="jar"/>
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-jar.properties}"/>
<param location="${project.JavaFX-Dialog}" name="call.subproject"/>
<param location="${project.JavaFX-Dialog}/build.xml" name="call.script"/>
<param name="call.target" value="jar"/>
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-jar.properties}"/>
<param location="${project.TreeChart}" name="call.subproject"/>
Expand Down Expand Up @@ -1397,6 +1404,13 @@ is divided into following sections:
<param name="call.target" value="clean"/>
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-clean.properties}"/>
<param location="${project.JavaFX-Dialog}" name="call.subproject"/>
<param location="${project.JavaFX-Dialog}/build.xml" name="call.script"/>
<param name="call.target" value="clean"/>
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-clean.properties}"/>
<param location="${project.TreeChart}" name="call.subproject"/>
Expand Down
4 changes: 2 additions & 2 deletions BigBrother-Gui/nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ build.xml.script.CRC32=2c02c2d7
build.xml.stylesheet.CRC32=[email protected]
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=40d27e65
nbproject/build-impl.xml.script.CRC32=13067fac
nbproject/build-impl.xml.data.CRC32=48c3833f
nbproject/build-impl.xml.script.CRC32=6e8b5bf7
nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
5 changes: 4 additions & 1 deletion BigBrother-Gui/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jar.compress=false
javac.classpath=\
${reference.BigBrother.jar}:\
${reference.TreeChart.jar}:\
${javafx.classpath.extension}
${javafx.classpath.extension}:\
${reference.JavaFX-Dialog.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
Expand Down Expand Up @@ -108,8 +109,10 @@ meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
project.BigBrother=../BigBrother
project.JavaFX-Dialog=../../JavaFX-Dialog/JavaFX-Dialog
project.TreeChart=../TreeChart
reference.BigBrother.jar=${project.BigBrother}/dist/BigBrother.jar
reference.JavaFX-Dialog.jar=${project.JavaFX-Dialog}/dist/JavaFX-Dialog.jar
reference.TreeChart.jar=${project.TreeChart}/dist/TreeChart.jar
run.classpath=\
${dist.jar}:\
Expand Down
8 changes: 8 additions & 0 deletions BigBrother-Gui/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>JavaFX-Dialog</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>TreeChart</foreign-project>
<artifact-type>jar</artifact-type>
Expand Down
6 changes: 4 additions & 2 deletions BigBrother-Gui/src/bigbrother/gui/BigBrotherGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
public class BigBrotherGui extends Application {

@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("BigBrotherGui.fxml"));
public void start(Stage stage) throws Exception {FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("BigBrotherGui.fxml"));
Parent root = (Parent) fxmlLoader.load();
BigBrotherGuiController controller = fxmlLoader.<BigBrotherGuiController>getController();
controller.setStage(stage);

Scene scene = new Scene(root);

Expand Down
16 changes: 16 additions & 0 deletions BigBrother-Gui/src/bigbrother/gui/BigBrotherGuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;
import javafx.util.Callback;
import net.kirauks.javafx.dialog.Dialog;

/**
* FXML Controller class
Expand Down Expand Up @@ -109,6 +111,7 @@ public void handle(WorkerStateEvent t) {
if(scanner.encouredError()){
BigBrotherGuiController.this.bottomMessage.setTextFill(Color.DARKORANGE);
BigBrotherGuiController.this.bottomMessage.setText("Exploration incomplète : Certaines classes n'ont pas pu être chargées.");
new Dialog("Exploration incomplète : Certaines classes n'ont pas pu être chargées.", null, Dialog.DialogType.WARNING, Dialog.DialogOptions.OK, BigBrotherGuiController.this.getStage()).showAndWait();
}

TreeViewTask accordionBuilder = new TreeViewTask(scanner.getClasses(), scanner.getJarName());
Expand All @@ -126,6 +129,7 @@ public void handle(WorkerStateEvent t) {
public void handle(WorkerStateEvent t) {
BigBrotherGuiController.this.bottomMessage.setTextFill(Color.DARKORANGE);
BigBrotherGuiController.this.bottomMessage.setText("Erreur de construction de la liste des packages.");
new Dialog("Erreur de construction de la liste des packages.", null, Dialog.DialogType.ERROR, Dialog.DialogOptions.OK, BigBrotherGuiController.this.getStage()).showAndWait();

BigBrotherGuiController.this.progressBar.setProgress(1d);
BigBrotherGuiController.this.loading.set(false);
Expand Down Expand Up @@ -322,6 +326,9 @@ public void handle(WorkerStateEvent t) {
BigBrotherGuiController.this.scrollPane.setContent(treeChart.getTreePane());
BigBrotherGuiController.this.bottomMessage.setTextFill(treeChart.getMessageColor());
BigBrotherGuiController.this.bottomMessage.setText(treeChart.getMessage());
if(!treeChart.getMessage().isEmpty()){
new Dialog(treeChart.getMessage(), null, Dialog.DialogType.WARNING, Dialog.DialogOptions.OK, BigBrotherGuiController.this.getStage()).showAndWait();
}

BigBrotherGuiController.this.cleanAriane();
BigBrotherGuiController.this.buildAriane(classe);
Expand All @@ -335,6 +342,7 @@ public void handle(WorkerStateEvent t) {
public void handle(WorkerStateEvent t) {
BigBrotherGuiController.this.bottomMessage.setTextFill(Color.DARKRED);
BigBrotherGuiController.this.bottomMessage.setText("Erreur de construction de l'arbre.");
new Dialog("Erreur de construction de l'arbre.", null, Dialog.DialogType.WARNING, Dialog.DialogOptions.OK, BigBrotherGuiController.this.getStage()).showAndWait();

BigBrotherGuiController.this.progressBar.setProgress(1.0d);
BigBrotherGuiController.this.loading.set(false);
Expand Down Expand Up @@ -414,4 +422,12 @@ public void unloadTreeChart(){
this.elementName.setText("Element");
this.scrollPane.setContent(new Pane());
}

private Stage stage;
public void setStage(Stage stage){
this.stage = stage;
}
public Stage getStage(){
return this.stage;
}
}

0 comments on commit 92aa885

Please sign in to comment.