Ver código fonte

added Tooltips and ampping loading

jascha Bohne 8 anos atrás
pai
commit
d2a9290894

+ 1 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/metrics/ScopvizGraphOperator.java

@@ -6,7 +6,7 @@ import de.tu_darmstadt.informatik.tk.scopviz.main.MyGraph;
 
 public interface ScopvizGraphOperator {
 
-	/**
+	/**Metric
 	 * Returns true if the GraphOperator requires the Setup() to be called 
 	 * if this is false setup() will not be called.
 	 */

+ 7 - 2
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java

@@ -122,6 +122,7 @@ public final class ButtonManager {
 
 		setBorderStyle((Button) arg0.getSource());
 
+		controller.getOpenButton().setText("Open...");
 	}
 
 	/**
@@ -135,7 +136,8 @@ public final class ButtonManager {
 		GraphDisplayManager.switchActiveGraph();
 
 		setBorderStyle((Button) arg0.getSource());
-
+		
+		controller.getOpenButton().setText("Open...");
 	}
 
 	/**
@@ -150,13 +152,14 @@ public final class ButtonManager {
 
 		setBorderStyle((Button) arg0.getSource());
 
+		controller.getOpenButton().setText("Open Mapping...");
 	}
 
 	/**
 	 * Handler for the Symbol Representation Layer switch Button.
 	 */
 	public static void symbolRepAction(ActionEvent arg0) {
-
+		
 		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL))) {
 
 			// add a copy of the underlay graph to the the symbol layer
@@ -171,6 +174,8 @@ public final class ButtonManager {
 
 		GraphDisplayManager.switchActiveGraph();
 		setBorderStyle((Button) arg0.getSource());
+		
+		controller.getOpenButton().setText("Open...");
 	}
 
 	/**

+ 18 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -32,6 +32,7 @@ import javafx.scene.control.MenuItem;
 import javafx.scene.control.TableColumn;
 import javafx.scene.control.TableRow;
 import javafx.scene.control.TableView;
+import javafx.scene.control.Tooltip;
 import javafx.scene.control.cell.PropertyValueFactory;
 import javafx.scene.control.cell.TextFieldTableCell;
 import javafx.scene.layout.Pane;
@@ -249,6 +250,19 @@ public class GUIController implements Initializable {
 		mappingButton.setOnAction((event) -> ButtonManager.mappingAction(event));
 		symbolRepButton.setOnAction((event) -> ButtonManager.symbolRepAction(event));
 
+		Tooltip tip = new Tooltip();
+		tip.setText("Underlay");
+		underlayButton.setTooltip(tip);
+		tip = new Tooltip();
+		tip.setText("Operator");
+		operatorButton.setTooltip(tip);
+		tip = new Tooltip();
+		tip.setText("Mapping");
+		mappingButton.setTooltip(tip);
+		tip = new Tooltip();
+		tip.setText("Geographical Visualization");
+		symbolRepButton.setTooltip(tip);
+		
 		ArrayList<Button> layerButtons = new ArrayList<Button>();
 		layerButtons.add(underlayButton);
 		layerButtons.add(operatorButton);
@@ -395,4 +409,8 @@ public class GUIController implements Initializable {
 		assert stackPane != null : "fx:id=\"stackPane\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert swingNodeWorldView != null : "fx:id=\"swingNodeWorldView\" was not injected: check your FXML file 'MainWindow.fxml'.";
 	}
+	
+	MenuItem getOpenButton(){
+		return open;
+	}
 }

+ 5 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MenuBarManager.java

@@ -2,6 +2,7 @@ package de.tu_darmstadt.informatik.tk.scopviz.ui;
 
 import de.tu_darmstadt.informatik.tk.scopviz.io.GraphMLExporter;
 import de.tu_darmstadt.informatik.tk.scopviz.main.GraphManager;
+import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import javafx.event.ActionEvent;
 import javafx.scene.control.Alert;
@@ -35,7 +36,11 @@ public final class MenuBarManager {
 	 * Handler for the "open" MenuItem.
 	 */
 	public static final void openAction(ActionEvent event) {
+		if (GraphDisplayManager.getCurrentLayer()==Layer.MAPPING){
+		GraphDisplayManager.readMapping();	
+		} else {
 		GraphDisplayManager.addGraph(Main.getInstance().getPrimaryStage(), true);
+		}
 	}
 
 	/**