|
@@ -7,10 +7,8 @@ import org.graphstream.graph.Edge;
|
|
import de.tu_darmstadt.informatik.tk.scopviz.main.GraphManager;
|
|
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.Layer;
|
|
import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
|
|
import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
|
|
-import javafx.beans.value.ChangeListener;
|
|
|
|
import javafx.beans.value.ObservableValue;
|
|
import javafx.beans.value.ObservableValue;
|
|
import javafx.event.ActionEvent;
|
|
import javafx.event.ActionEvent;
|
|
-import javafx.event.EventHandler;
|
|
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.control.Button;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -48,42 +46,38 @@ public final class ButtonManager {
|
|
controller = guiController;
|
|
controller = guiController;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Handler for zoom in Button
|
|
* Handler for zoom in Button
|
|
*/
|
|
*/
|
|
- public static final void zoomInAction(ActionEvent event){
|
|
|
|
|
|
+ public static final void zoomInAction(ActionEvent event) {
|
|
Main.getInstance().getGraphManager().zoomIn();
|
|
Main.getInstance().getGraphManager().zoomIn();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Handler for zoom out Button
|
|
* Handler for zoom out Button
|
|
*/
|
|
*/
|
|
- public static final void zoomOutAction(ActionEvent event){
|
|
|
|
|
|
+ public static final void zoomOutAction(ActionEvent event) {
|
|
Main.getInstance().getGraphManager().zoomOut();
|
|
Main.getInstance().getGraphManager().zoomOut();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* Handler for the Underlay Layer switch Button.
|
|
* Handler for the Underlay Layer switch Button.
|
|
*/
|
|
*/
|
|
- public static final void underlayAction(ActionEvent arg0){
|
|
|
|
-
|
|
|
|
|
|
+ public static final void underlayAction(ActionEvent arg0) {
|
|
|
|
+
|
|
switchfromSymbolLayer();
|
|
switchfromSymbolLayer();
|
|
-
|
|
|
|
|
|
+
|
|
GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
|
|
GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
|
|
GraphDisplayManager.switchActiveGraph();
|
|
GraphDisplayManager.switchActiveGraph();
|
|
|
|
|
|
setBorderStyle((Button) arg0.getSource());
|
|
setBorderStyle((Button) arg0.getSource());
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Handler for the Operator Layer switch Button.
|
|
* Handler for the Operator Layer switch Button.
|
|
*/
|
|
*/
|
|
- public static final void operatorAction(ActionEvent arg0){
|
|
|
|
|
|
+ public static final void operatorAction(ActionEvent arg0) {
|
|
|
|
|
|
switchfromSymbolLayer();
|
|
switchfromSymbolLayer();
|
|
|
|
|
|
@@ -94,7 +88,6 @@ public final class ButtonManager {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Handler for the Mapping Layer switch Button.
|
|
* Handler for the Mapping Layer switch Button.
|
|
*/
|
|
*/
|
|
@@ -106,19 +99,18 @@ public final class ButtonManager {
|
|
GraphDisplayManager.switchActiveGraph();
|
|
GraphDisplayManager.switchActiveGraph();
|
|
|
|
|
|
setBorderStyle((Button) arg0.getSource());
|
|
setBorderStyle((Button) arg0.getSource());
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Handler for the Symbol Representation Layer switch Button.
|
|
* Handler for the Symbol Representation Layer switch Button.
|
|
*/
|
|
*/
|
|
public static final void symbolRepAction(ActionEvent arg0) {
|
|
public static final void symbolRepAction(ActionEvent arg0) {
|
|
-
|
|
|
|
|
|
+
|
|
if (!GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
|
|
if (!GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
|
|
controller.toolbox.setVisible(false);
|
|
controller.toolbox.setVisible(false);
|
|
controller.symbolToolVBox.setVisible(true);
|
|
controller.symbolToolVBox.setVisible(true);
|
|
-
|
|
|
|
|
|
+
|
|
controller.propertiesObjectColumn.setEditable(false);
|
|
controller.propertiesObjectColumn.setEditable(false);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -127,30 +119,32 @@ public final class ButtonManager {
|
|
GraphDisplayManager.switchActiveGraph();
|
|
GraphDisplayManager.switchActiveGraph();
|
|
|
|
|
|
setBorderStyle((Button) arg0.getSource());
|
|
setBorderStyle((Button) arg0.getSource());
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * After switching from symbol-layer to other layer show toolbox and make properties editable again
|
|
|
|
|
|
+ * After switching from symbol-layer to other layer show toolbox and make
|
|
|
|
+ * properties editable again
|
|
*/
|
|
*/
|
|
- private static void switchfromSymbolLayer(){
|
|
|
|
-
|
|
|
|
|
|
+ private static void switchfromSymbolLayer() {
|
|
|
|
+
|
|
if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
|
|
if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
|
|
controller.toolbox.setVisible(true);
|
|
controller.toolbox.setVisible(true);
|
|
controller.symbolToolVBox.setVisible(false);
|
|
controller.symbolToolVBox.setVisible(false);
|
|
-
|
|
|
|
|
|
+
|
|
controller.propertiesObjectColumn.setEditable(true);
|
|
controller.propertiesObjectColumn.setEditable(true);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
- * Functionality for "edge visible" Checkbox
|
|
|
|
|
|
+ * Functionality for "edge visible" Checkbox
|
|
|
|
+ *
|
|
* @param ov
|
|
* @param ov
|
|
- * @param oldVal Checkbox previous state (Checked or unchecked)
|
|
|
|
- * @param newVal Checkbox current state (Checked or unchecked)
|
|
|
|
|
|
+ * @param oldVal
|
|
|
|
+ * Checkbox previous state (Checked or unchecked)
|
|
|
|
+ * @param newVal
|
|
|
|
+ * Checkbox current state (Checked or unchecked)
|
|
*/
|
|
*/
|
|
public static void edgeVisibleSwitch(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
|
|
public static void edgeVisibleSwitch(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
|
|
// Show edges
|
|
// Show edges
|
|
@@ -159,23 +153,25 @@ public final class ButtonManager {
|
|
edge.removeAttribute("ui.hide");
|
|
edge.removeAttribute("ui.hide");
|
|
}
|
|
}
|
|
|
|
|
|
- // Hide edges
|
|
|
|
|
|
+ // Hide edges
|
|
} else {
|
|
} else {
|
|
for (Edge edge : Main.getInstance().getGraphManager().getGraph().getEachEdge()) {
|
|
for (Edge edge : Main.getInstance().getGraphManager().getGraph().getEachEdge()) {
|
|
edge.addAttribute("ui.hide");
|
|
edge.addAttribute("ui.hide");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Functionality for "label visible" Checkbox
|
|
|
|
|
|
+ * Functionality for "label visible" Checkbox
|
|
|
|
+ *
|
|
* @param ov
|
|
* @param ov
|
|
- * @param oldVal Checkbox previous state (Checked or unchecked)
|
|
|
|
- * @param newVal Checkbox current state (Checked or unchecked)
|
|
|
|
|
|
+ * @param oldVal
|
|
|
|
+ * Checkbox previous state (Checked or unchecked)
|
|
|
|
+ * @param newVal
|
|
|
|
+ * Checkbox current state (Checked or unchecked)
|
|
*/
|
|
*/
|
|
public static void labelVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
|
|
public static void labelVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
|
|
-
|
|
|
|
|
|
+
|
|
GraphManager graphManager = Main.getInstance().getGraphManager();
|
|
GraphManager graphManager = Main.getInstance().getGraphManager();
|
|
String stylesheet = graphManager.getStylesheet();
|
|
String stylesheet = graphManager.getStylesheet();
|
|
|
|
|
|
@@ -189,15 +185,18 @@ public final class ButtonManager {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
- * Functionality for "edge weights visible" Checkbox
|
|
|
|
|
|
+ * Functionality for "edge weights visible" Checkbox
|
|
|
|
+ *
|
|
* @param ov
|
|
* @param ov
|
|
- * @param oldVal Checkbox previous state (Checked or unchecked)
|
|
|
|
- * @param newVal Checkbox current state (Checked or unchecked)
|
|
|
|
|
|
+ * @param oldVal
|
|
|
|
+ * Checkbox previous state (Checked or unchecked)
|
|
|
|
+ * @param newVal
|
|
|
|
+ * Checkbox current state (Checked or unchecked)
|
|
*/
|
|
*/
|
|
- public static void edgeWeightVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
|
|
|
|
-
|
|
|
|
|
|
+ public static void edgeWeightVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal,
|
|
|
|
+ Boolean newVal) {
|
|
|
|
+
|
|
GraphManager graphManager = Main.getInstance().getGraphManager();
|
|
GraphManager graphManager = Main.getInstance().getGraphManager();
|
|
String stylesheet = graphManager.getStylesheet();
|
|
String stylesheet = graphManager.getStylesheet();
|
|
|
|
|
|
@@ -210,7 +209,6 @@ public final class ButtonManager {
|
|
graphManager.setStylesheet(stylesheet.concat("edge{text-mode:hidden;}"));
|
|
graphManager.setStylesheet(stylesheet.concat("edge{text-mode:hidden;}"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* Changes the border of the button that was pressed to red
|
|
* Changes the border of the button that was pressed to red
|