diff --git a/corefx/src/main/java/com/core/Controller.java b/corefx/src/main/java/com/core/Controller.java index 37487f0f..5d9255ce 100644 --- a/corefx/src/main/java/com/core/Controller.java +++ b/corefx/src/main/java/com/core/Controller.java @@ -19,6 +19,7 @@ import javafx.embed.swing.SwingNode; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; +import javafx.scene.control.MenuItem; import javafx.scene.layout.BorderPane; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; @@ -42,15 +43,10 @@ import java.util.concurrent.Executors; @Data public class Controller implements Initializable { private static final Logger logger = LogManager.getLogger(); - - @FXML - private StackPane stackPane; - - @FXML - private BorderPane borderPane; - - @FXML - private SwingNode swingNode; + @FXML private StackPane stackPane; + @FXML private BorderPane borderPane; + @FXML private SwingNode swingNode; + @FXML private MenuItem saveXmlMenuItem; private Application application; private Stage window; @@ -118,11 +114,13 @@ public class Controller implements Initializable { vBox.getChildren().add(mobilityPlayer); } } + saveXmlMenuItem.setDisable(false); } public void sessionStopped() { VBox vBox = (VBox) borderPane.getTop(); vBox.getChildren().remove(mobilityPlayer); + saveXmlMenuItem.setDisable(true); } public void deleteNode(CoreNode node) { diff --git a/corefx/src/main/java/com/core/ui/GraphToolbar.java b/corefx/src/main/java/com/core/ui/GraphToolbar.java index 0952a663..003e0211 100644 --- a/corefx/src/main/java/com/core/ui/GraphToolbar.java +++ b/corefx/src/main/java/com/core/ui/GraphToolbar.java @@ -244,7 +244,6 @@ public class GraphToolbar extends VBox { boolean result = controller.getCoreClient().start(); if (result) { - controller.sessionStarted(); Toast.success("Session Started"); setRunButton(true); } @@ -259,7 +258,6 @@ public class GraphToolbar extends VBox { try { boolean result = controller.getCoreClient().stop(); if (result) { - controller.sessionStopped(); Toast.success("Session Stopped"); setRunButton(false); } @@ -271,6 +269,7 @@ public class GraphToolbar extends VBox { public void setRunButton(boolean isRunning) { if (isRunning) { Platform.runLater(() -> { + controller.sessionStarted(); pickingButton.fire(); editingButton.setDisable(true); runButton.pseudoClassStateChanged(START_CLASS, false); @@ -281,6 +280,7 @@ public class GraphToolbar extends VBox { }); } else { Platform.runLater(() -> { + controller.sessionStopped(); editingButton.setDisable(false); runButton.pseudoClassStateChanged(START_CLASS, true); runButton.pseudoClassStateChanged(STOP_CLASS, false); diff --git a/corefx/src/main/resources/fxml/main.fxml b/corefx/src/main/resources/fxml/main.fxml index 538293d9..ab8f3640 100644 --- a/corefx/src/main/resources/fxml/main.fxml +++ b/corefx/src/main/resources/fxml/main.fxml @@ -20,7 +20,7 @@ - +