소스 검색

Added "Reset Mapping" button

Julian Ohl 7 년 전
부모
커밋
dfbf15d52e

+ 6 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainWindow.fxml

@@ -62,7 +62,7 @@
               <items>
                 <AnchorPane SplitPane.resizableWithParent="false">
                      <children>
-                        <VBox AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
+                        <VBox fx:id="leftSide" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                            <children>
                             <AnchorPane fx:id="topLeftAPane" VBox.vgrow="NEVER">
                                  <children>
@@ -99,6 +99,11 @@
                                        </children></VBox>
                                 </children>
                               </AnchorPane>
+                              <AnchorPane fx:id="resetMappingButtonAPane" prefHeight="25.0">
+                                 <children>
+                                    <Button fx:id="resetMappingButton" mnemonicParsing="false" prefHeight="25.0" text="Reset Mapping" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
+                                 </children>
+                              </AnchorPane>
                             <AnchorPane VBox.vgrow="ALWAYS">
                                  <children>
                                     <TableView fx:id="properties" editable="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">

+ 9 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java

@@ -177,9 +177,10 @@ public final class ButtonManager {
 		controller.undelete.disableProperty().set(false);
 		controller.updateMetricMI.disableProperty().set(true);
 
-		// hide metricbox/update button
+		// hide metricbox/update button/reset mapping button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
+		controller.leftSide.getChildren().remove(controller.resetMappingButtonAPane);
 
 		// Hide operator graph selection box
 		controller.opGraphSelectionBox.setVisible(false);
@@ -210,10 +211,11 @@ public final class ButtonManager {
 		controller.undelete.disableProperty().set(false);
 		controller.updateMetricMI.disableProperty().set(true);
 
-		// hide metricbox/update button
+		// hide metricbox/update button/reset mapping button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
-
+		controller.leftSide.getChildren().remove(controller.resetMappingButtonAPane);
+		
 		// show operator graph selection box
 		controller.opGraphSelectionBox.setVisible(true);
 	}
@@ -224,10 +226,11 @@ public final class ButtonManager {
 	public static void mappingAction(ActionEvent arg0) {
 		Main.getInstance().getGraphManager().deselectEdgeCreationNodes();
 
-		// show metricbox/update button
+		// show metricbox/update button/reset mapping button
 		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.MAPPING))) {
 			controller.rightSide.getChildren().add(2, controller.updateButtonAPane);
 			controller.metricbox.setVisible(true);
+			controller.leftSide.getChildren().add(1, controller.resetMappingButtonAPane);
 		}
 
 		switchfromSymbolLayer();
@@ -274,9 +277,10 @@ public final class ButtonManager {
 			showConnectionErrorMsg();
 		}
 
-		// hide metricbox/update button
+		// hide metricbox/update button/reset mapping button
 		controller.rightSide.getChildren().remove(controller.updateButtonAPane);
 		controller.metricbox.setVisible(false);
+		controller.leftSide.getChildren().remove(controller.resetMappingButtonAPane);
 
 		// Hide operator graph selection box
 		controller.opGraphSelectionBox.setVisible(false);

+ 17 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -161,7 +161,10 @@ public class GUIController implements Initializable {
 
 	@FXML
 	public Button updateMetricButton;
-
+	
+	@FXML
+	public Button resetMappingButton;
+	
 	// The items of the top left box in the symbol visualization layer
 	@FXML
 	public VBox symbolToolVBox;
@@ -174,6 +177,9 @@ public class GUIController implements Initializable {
 	@FXML
 	public ChoiceBox<String> mapViewChoiceBox;
 
+	@FXML
+	public VBox leftSide;
+	
 	@FXML
 	public VBox rightSide;
 
@@ -194,6 +200,9 @@ public class GUIController implements Initializable {
 	// The anchorpane of the metric update button
 	@FXML
 	public AnchorPane updateButtonAPane;
+	// The anchorpane of the reset mapping button
+	@FXML
+	public AnchorPane resetMappingButtonAPane;
 
 	/**
 	 * Initializes all the references to the UI elements specified in the FXML
@@ -481,6 +490,10 @@ public class GUIController implements Initializable {
 		// Update button initialization
 		updateMetricButton.setOnAction((event) -> MetricboxManager.updateMetrics());
 		rightSide.getChildren().remove(updateButtonAPane);
+		
+		// reset mapping button initialization
+		resetMappingButton.setOnAction((event) -> GraphDisplayManager.initMappingLayer(true));
+		leftSide.getChildren().remove(resetMappingButtonAPane);
 	}
 
 	/**
@@ -584,6 +597,7 @@ public class GUIController implements Initializable {
 		assert propertiesObjectColumn != null : "fx:id=\"propertiesObject\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert propertiesTypeColumn != null : "fx:id=\"propertiesType\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
+		assert leftSide != null : "fx:id=\"leftSide\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert rightSide != null : "fx:id=\"rightSide\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert opGraphSelectionBox != null : "fx:id=\"opGraphSelectionBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert consoleScrollPane != null : "fx:id=\"consoleScrollPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
@@ -594,9 +608,11 @@ public class GUIController implements Initializable {
 		assert metricBoxUpdateColumn != null : "fx:id=\"metricBoxUpdateColumn\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
 		assert updateMetricButton != null : "fx:id=\"updateMetricButton\" was not injected: check your FXML file 'MainWindow.fxml'.";
+		assert resetMappingButton != null : "fx:id=\"resetMappingButton\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
 		assert topLeftAPane != null : "fx:id=\"topLeftAPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert updateButtonAPane != null : "fx:id=\"updateButton\" was not injected: check your FXML file 'MainWindow.fxml'.";
+		assert resetMappingButtonAPane != null : "fx:id=\"resetMappingButtonAPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
 		assert symbolToolVBox != null : "fx:id=\"symbolToolVBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert edgesVisibleCheckbox != null : "fx:id=\"edgesVisibleCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";