diff --git a/corefx/src/main/java/com/core/Controller.java b/corefx/src/main/java/com/core/Controller.java index 3f7f1060..155d3d4e 100644 --- a/corefx/src/main/java/com/core/Controller.java +++ b/corefx/src/main/java/com/core/Controller.java @@ -46,6 +46,8 @@ public class Controller implements Initializable { private static final Logger logger = LogManager.getLogger(); @FXML private StackPane stackPane; @FXML private BorderPane borderPane; + @FXML private VBox top; + @FXML private VBox bottom; @FXML private SwingNode swingNode; @FXML private MenuItem saveXmlMenuItem; @FXML private JFXProgressBar progressBar; @@ -103,21 +105,19 @@ public class Controller implements Initializable { public void sessionStarted() { // configure and add mobility player - VBox vBox = (VBox) borderPane.getTop(); CoreNode node = mobilityDialog.getNode(); if (node != null) { MobilityConfig mobilityConfig = mobilityDialog.getMobilityScripts().get(node.getId()); if (mobilityConfig != null) { mobilityPlayer.show(node, mobilityConfig); - vBox.getChildren().add(mobilityPlayer); + bottom.getChildren().add(mobilityPlayer); } } saveXmlMenuItem.setDisable(false); } public void sessionStopped() { - VBox vBox = (VBox) borderPane.getTop(); - vBox.getChildren().remove(mobilityPlayer); + bottom.getChildren().remove(mobilityPlayer); saveXmlMenuItem.setDisable(true); } diff --git a/corefx/src/main/java/com/core/graph/CorePopupGraphMousePlugin.java b/corefx/src/main/java/com/core/graph/CorePopupGraphMousePlugin.java index 15a03993..5803e7bc 100644 --- a/corefx/src/main/java/com/core/graph/CorePopupGraphMousePlugin.java +++ b/corefx/src/main/java/com/core/graph/CorePopupGraphMousePlugin.java @@ -90,6 +90,8 @@ public class CorePopupGraphMousePlugin extends EditingPopupGraphMousePlugi case NodeType.EMANE: menuItems.add(createMenuItem("EMANE Settings", event -> controller.getNodeEmaneDialog().showDialog(node))); + menuItems.add(createMenuItem("Mobility", + event -> controller.getMobilityDialog().showDialog(node))); menuItems.add(createMenuItem("Link MDRs", event -> networkGraph.linkMdrs(node))); break; diff --git a/corefx/src/main/java/com/core/ui/GraphToolbar.java b/corefx/src/main/java/com/core/ui/GraphToolbar.java index 70b88f70..eb14d3dd 100644 --- a/corefx/src/main/java/com/core/ui/GraphToolbar.java +++ b/corefx/src/main/java/com/core/ui/GraphToolbar.java @@ -81,7 +81,7 @@ public class GraphToolbar extends VBox { pickingButton.setTooltip(new Tooltip("Pick/Move Nodes")); pickingButton.setOnAction(event -> { controller.getNetworkGraph().setMode(ModalGraphMouse.Mode.PICKING); - controller.getBorderPane().setBottom(null); + controller.getBottom().getChildren().remove(controller.getAnnotationToolbar()); controller.getBorderPane().setRight(null); setSelected(true, pickingButton); setSelected(false, editingButton, drawingButton, selectedEditButton); @@ -96,7 +96,7 @@ public class GraphToolbar extends VBox { editingButton.setTooltip(new Tooltip("Edit Graph")); editingButton.setOnAction(event -> { controller.getNetworkGraph().setMode(ModalGraphMouse.Mode.EDITING); - controller.getBorderPane().setBottom(null); + controller.getBottom().getChildren().remove(controller.getAnnotationToolbar()); controller.getBorderPane().setRight(null); setSelected(true, editingButton, selectedEditButton); setSelected(false, drawingButton, pickingButton); @@ -111,7 +111,7 @@ public class GraphToolbar extends VBox { drawingButton.setTooltip(new Tooltip("Annotate Graph")); drawingButton.setOnAction(event -> { controller.getNetworkGraph().setMode(ModalGraphMouse.Mode.ANNOTATING); - controller.getBorderPane().setBottom(controller.getAnnotationToolbar()); + controller.getBottom().getChildren().add(controller.getAnnotationToolbar()); controller.getBorderPane().setRight(null); setSelected(true, drawingButton); setSelected(false, editingButton, pickingButton, selectedEditButton); diff --git a/corefx/src/main/resources/fxml/main.fxml b/corefx/src/main/resources/fxml/main.fxml index 650d8a02..ee1ed044 100644 --- a/corefx/src/main/resources/fxml/main.fxml +++ b/corefx/src/main/resources/fxml/main.fxml @@ -14,7 +14,7 @@ - + @@ -70,6 +70,9 @@ + + +