Преглед изворни кода

Merge dominik, not yet tested

Jan Enders пре 8 година
родитељ
комит
b04ad1dfe1
33 измењених фајлова са 1274 додато и 76 уклоњено
  1. 11 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java
  2. 1 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/main/MainApp.java
  3. 110 63
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java
  4. 52 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java
  5. 3 1
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java
  6. 35 5
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/ResizeListener.java
  7. 121 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomMapClickListener.java
  8. 80 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomWaypoint.java
  9. 89 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomWaypointRenderer.java
  10. 189 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/EdgePainter.java
  11. 268 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/MapViewFunctions.java
  12. 105 0
      scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/WorldView.java
  13. 199 0
      scopviz/src/main/resources/ExampleSymbol.graphml
  14. 11 5
      scopviz/src/main/resources/MainWindow.fxml
  15. BIN
      scopviz/src/main/resources/png/computer.png
  16. BIN
      scopviz/src/main/resources/png/router.png
  17. BIN
      scopviz/src/main/resources/png/symbol_icons/3G_lte_basestation.png
  18. BIN
      scopviz/src/main/resources/png/symbol_icons/car.png
  19. BIN
      scopviz/src/main/resources/png/symbol_icons/cloud_computing_server.png
  20. BIN
      scopviz/src/main/resources/png/symbol_icons/data_storage.png
  21. BIN
      scopviz/src/main/resources/png/symbol_icons/desktop.png
  22. BIN
      scopviz/src/main/resources/png/symbol_icons/laptop.png
  23. BIN
      scopviz/src/main/resources/png/symbol_icons/network_middlebox.png
  24. BIN
      scopviz/src/main/resources/png/symbol_icons/raspberry_pi.png
  25. BIN
      scopviz/src/main/resources/png/symbol_icons/router.png
  26. BIN
      scopviz/src/main/resources/png/symbol_icons/sensor.png
  27. BIN
      scopviz/src/main/resources/png/symbol_icons/smart_home.png
  28. BIN
      scopviz/src/main/resources/png/symbol_icons/smartband.png
  29. BIN
      scopviz/src/main/resources/png/symbol_icons/smartphone.png
  30. BIN
      scopviz/src/main/resources/png/symbol_icons/smartwatch.png
  31. BIN
      scopviz/src/main/resources/png/symbol_icons/switch.png
  32. BIN
      scopviz/src/main/resources/png/symbol_icons/tablet.png
  33. BIN
      scopviz/src/main/resources/png/symbol_icons/unknown.png

+ 11 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/debug/Debug.java

@@ -48,6 +48,17 @@ public final class Debug {
 		return fileName;
 	}
 
+	/**
+	 * Returns the Location of the File for the testing SymbolGraph.
+	 * 
+	 * @return a sample symbol graph for the Program
+	 */
+	public static String getDefaultSymbolGraph() {
+		String fileName = null;
+		fileName = "/ExampleSymbol.graphml";
+		return fileName;
+	}
+
 	/**
 	 * Short form for System.out.println().
 	 * 

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

@@ -69,7 +69,7 @@ public class MainApp extends Application {
 			GraphDisplayManager.setCurrentLayer(Layer.OPERATOR);
 			GraphDisplayManager.addGraph(Debug.getDefaultGraph2(), true);
 			GraphDisplayManager.setCurrentLayer(Layer.UNDERLAY);
-			GraphDisplayManager.addGraph(Debug.getDefaultGraph(), true);
+			GraphDisplayManager.addGraph(Debug.getDefaultSymbolGraph(), true);
 		}
 	}
 

+ 110 - 63
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ButtonManager.java

@@ -6,11 +6,16 @@ import org.graphstream.graph.Edge;
 import org.graphstream.graph.Graph;
 import org.graphstream.graph.Node;
 import org.graphstream.graph.implementations.Graphs;
+import org.jxmapviewer.viewer.WaypointPainter;
 
 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 de.tu_darmstadt.informatik.tk.scopviz.main.MyGraph;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.CustomWaypoint;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.CustomWaypointRenderer;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.MapViewFunctions;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.WorldView;
 import javafx.beans.value.ObservableValue;
 import javafx.event.ActionEvent;
 import javafx.scene.control.Button;
@@ -61,14 +66,52 @@ public final class ButtonManager {
 	 * Handler for zoom in Button.
 	 */
 	public static final void zoomInAction(ActionEvent event) {
-		Main.getInstance().getGraphManager().zoomIn();
+		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
+			WorldView.internMapViewer.setZoom(WorldView.internMapViewer.getZoom() - 1);
+		} else {
+			Main.getInstance().getGraphManager().zoomIn();
+		}
 	}
 
 	/**
 	 * Handler for zoom out Button.
 	 */
 	public static final void zoomOutAction(ActionEvent event) {
-		Main.getInstance().getGraphManager().zoomOut();
+		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
+			WorldView.internMapViewer.setZoom(WorldView.internMapViewer.getZoom() + 1);
+		} else {
+			Main.getInstance().getGraphManager().zoomOut();
+		}
+	}
+
+	/**
+	 * After switching from symbol-layer to other layer show toolbox and make
+	 * properties editable again
+	 */
+	private static void switchfromSymbolLayer() {
+
+		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
+
+			// show toolbox and hide VBox
+			controller.toolbox.setVisible(true);
+			controller.symbolToolVBox.setVisible(false);
+
+			// make properties editable again
+			controller.propertiesObjectColumn.setEditable(true);
+
+			// show graph instead of map view
+			controller.swingNodeWorldView.setVisible(false);
+			controller.swingNode.setVisible(true);
+
+			// make map view mouse transparent
+			controller.stackPane.setMouseTransparent(true);
+			controller.swingNodeWorldView.setMouseTransparent(true);
+
+			// make graph non mouse transparent
+			controller.pane.setMouseTransparent(false);
+			controller.swingNode.setMouseTransparent(false);
+
+		}
 	}
 
 	/**
@@ -118,62 +161,54 @@ public final class ButtonManager {
 	 */
 	public static final void symbolRepAction(ActionEvent arg0) {
 
-		if (!GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
-			controller.toolbox.setVisible(false);
-			controller.symbolToolVBox.setVisible(true);
-
-			controller.propertiesObjectColumn.setEditable(false);
-		}
-
-		// add a copy of the underlay graph to the the symbol layer
-		MyGraph gClone = (MyGraph) Graphs.clone(GraphDisplayManager.getGraphManager(Layer.UNDERLAY).getGraph());
-		gClone.removeAttribute("layer");
-		GraphDisplayManager.setCurrentLayer(Layer.SYMBOL);
-		GraphDisplayManager.addGraph(gClone, true);
+		if (!(GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL))) {
 
-		// apply checkbox changes from last time
-		// TODO abstract these things
-		if (!controller.edgesVisibleCheckbox.isSelected()) {
-
-			for (Edge edge : Main.getInstance().getGraphManager().getGraph().getEachEdge()) {
-				edge.addAttribute("ui.hide");
-			}
-
-		}
+			// add a copy of the underlay graph to the the symbol layer
+			MyGraph gClone = (MyGraph) Graphs.clone(GraphDisplayManager.getGraphManager(Layer.UNDERLAY).getGraph());
+			gClone.removeAttribute("layer");
+			GraphDisplayManager.setCurrentLayer(Layer.SYMBOL);
+			GraphDisplayManager.addGraph(gClone, true);
 
-		if (!controller.nodeLabelCheckbox.isSelected()) {
-			GraphManager graphManager = Main.getInstance().getGraphManager();
-			String stylesheet = graphManager.getStylesheet();
-			graphManager.setStylesheet(stylesheet.concat("node{text-mode:hidden;}"));
+			activateWorldView();
 
 		}
 
-		if (!controller.edgeWeightCheckbox.isSelected()) {
-			GraphManager graphManager = Main.getInstance().getGraphManager();
-			String stylesheet = graphManager.getStylesheet();
-			graphManager.setStylesheet(stylesheet.concat("edge{text-mode:hidden;}"));
-
-		}
-
-		// nodesToSymbols(Main.getInstance().getGraphManager().getGraph());
-
 		GraphDisplayManager.switchActiveGraph();
 		setBorderStyle((Button) arg0.getSource());
 	}
 
 	/**
-	 * After switching from symbol-layer to other layer show toolbox and make
-	 * properties editable again
+	 * Initializes the WorldView, sets data and paints them
 	 */
-	private static void switchfromSymbolLayer() {
+	private static void activateWorldView() {
 
-		if (GraphDisplayManager.getCurrentLayer().equals(Layer.SYMBOL)) {
-			controller.toolbox.setVisible(true);
-			controller.symbolToolVBox.setVisible(false);
+		// dont show graph and toolbox
+		controller.toolbox.setVisible(false);
+		controller.swingNode.setVisible(false);
 
-			controller.propertiesObjectColumn.setEditable(true);
+		// make properties uneditable
+		controller.propertiesObjectColumn.setEditable(false);
 
-		}
+		// make map view non mouse transparent
+		controller.stackPane.setMouseTransparent(false);
+		controller.swingNodeWorldView.setMouseTransparent(false);
+
+		// make graph mouse transparent
+		controller.pane.setMouseTransparent(true);
+		controller.swingNode.setMouseTransparent(true);
+
+		// show VBox for map options
+		controller.symbolToolVBox.setVisible(true);
+
+		WorldView.loadWorldView();
+
+		MapViewFunctions.checkVBoxChanged();
+
+		WorldView.internMapViewer.repaint();
+
+		// set content to UI Element
+		controller.swingNodeWorldView.setContent(WorldView.internMapViewer);
+		controller.swingNodeWorldView.setVisible(true);
 	}
 
 	/**
@@ -213,15 +248,12 @@ public final class ButtonManager {
 	public static void edgeVisibleSwitch(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
 		// Show edges
 		if (newVal) {
-			for (Edge edge : Main.getInstance().getGraphManager().getGraph().getEachEdge()) {
-				edge.removeAttribute("ui.hide");
-			}
+			WorldView.edgePainter.setShowEdges(true);
+			WorldView.internMapViewer.repaint();
 
 			// Hide edges
-		} else {
-			for (Edge edge : Main.getInstance().getGraphManager().getGraph().getEachEdge()) {
-				edge.addAttribute("ui.hide");
-			}
+			WorldView.edgePainter.setShowEdges(false);
+			WorldView.internMapViewer.repaint();
 		}
 	}
 
@@ -236,16 +268,22 @@ public final class ButtonManager {
 	 */
 	public static void labelVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
 
-		GraphManager graphManager = Main.getInstance().getGraphManager();
-		String stylesheet = graphManager.getStylesheet();
+		WaypointPainter<CustomWaypoint> waypointPainter = WorldView.waypointPainter;
+		CustomWaypointRenderer renderer = new CustomWaypointRenderer();
 
-		// Show node weights
+		// Show node labels
 		if (newVal) {
-			graphManager.setStylesheet(stylesheet.replace("node{text-mode:hidden;}", ""));
+			renderer.setShowLabels(true);
+			waypointPainter.clearCache();
+			waypointPainter.setRenderer(renderer);
+			WorldView.internMapViewer.repaint();
 
-			// Hide node weights
 		} else {
-			graphManager.setStylesheet(stylesheet.concat("node{text-mode:hidden;}"));
+			// Hide node labels
+			renderer.setShowLabels(false);
+			waypointPainter.clearCache();
+			waypointPainter.setRenderer(renderer);
+			WorldView.internMapViewer.repaint();
 		}
 	}
 
@@ -261,16 +299,14 @@ public final class ButtonManager {
 	public static void edgeWeightVisibilitySwitcher(ObservableValue<? extends Boolean> ov, Boolean oldVal,
 			Boolean newVal) {
 
-		GraphManager graphManager = Main.getInstance().getGraphManager();
-		String stylesheet = graphManager.getStylesheet();
-
 		// Show Edges weights
 		if (newVal) {
-			graphManager.setStylesheet(stylesheet.replace("edge{text-mode:hidden;}", ""));
-
+			WorldView.edgePainter.setShowWeights(true);
+			WorldView.internMapViewer.repaint();
 			// Hide Edges weights
 		} else {
-			graphManager.setStylesheet(stylesheet.concat("edge{text-mode:hidden;}"));
+			WorldView.edgePainter.setShowWeights(false);
+			WorldView.internMapViewer.repaint();
 		}
 	}
 
@@ -293,4 +329,15 @@ public final class ButtonManager {
 		}
 	}
 
+	/**
+	 * update mapViewer if choiceBox item was changed
+	 * 
+	 * @param ov
+	 * @param oldVal
+	 * @param newVal
+	 */
+	public static void mapViewChoiceChange(ObservableValue<? extends String> ov, String oldVal, String newVal) {
+		MapViewFunctions.changeMapView();
+	}
+
 }

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

@@ -5,17 +5,27 @@ import java.util.ArrayList;
 import java.util.ResourceBundle;
 
 import javax.swing.JPanel;
+import javax.swing.event.MouseInputListener;
+
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.input.CenterMapListener;
+import org.jxmapviewer.input.PanKeyListener;
+import org.jxmapviewer.input.PanMouseInputListener;
+import org.jxmapviewer.input.ZoomMouseWheelListenerCursor;
 
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.KeyboardShortcuts;
 import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.ResizeListener;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.mapView.WorldView;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
 import javafx.embed.swing.SwingNode;
 import javafx.fxml.FXML;
 import javafx.fxml.Initializable;
 import javafx.scene.control.Button;
 import javafx.scene.control.CheckBox;
+import javafx.scene.control.ChoiceBox;
 import javafx.scene.control.Label;
 import javafx.scene.control.ListView;
 import javafx.scene.control.MenuItem;
@@ -25,6 +35,7 @@ import javafx.scene.control.TableView;
 import javafx.scene.control.cell.PropertyValueFactory;
 import javafx.scene.control.cell.TextFieldTableCell;
 import javafx.scene.layout.Pane;
+import javafx.scene.layout.StackPane;
 import javafx.scene.layout.VBox;
 import javafx.util.Pair;
 
@@ -46,6 +57,8 @@ public class GUIController implements Initializable {
 	public SwingNode swingNodeWorldView;
 	@FXML
 	public Pane pane;
+	@FXML
+	public StackPane stackPane;
 
 	// The buttons present in the UI
 	@FXML
@@ -117,6 +130,8 @@ public class GUIController implements Initializable {
 	public CheckBox nodeLabelCheckbox;
 	@FXML
 	public CheckBox edgeWeightCheckbox;
+	@FXML
+	public ChoiceBox<String> mapViewChoiceBox;
 
 	/**
 	 * Initializes all the references to the UI elements specified in the FXML
@@ -142,15 +157,44 @@ public class GUIController implements Initializable {
 		// Bind all the handlers to their corresponding UI elements
 		initializeZoomButtons();
 		initializeLayerButton();
-		initializeDisplayPane();
 		initializeMenuBar();
 		initializeSymbolRepToolbox();
 
+		initializeDisplayPane();
+
+		initializeWorldView();
+
 		// Setup the Keyboard Shortcuts
 		KeyboardShortcuts.initialize(Main.getInstance().getPrimaryStage());
 
 	}
 
+	private void initializeWorldView() {
+
+		JXMapViewer mapViewer = new JXMapViewer();
+
+		WorldView.initAttributes(mapViewer, this);
+
+		// center map if double clicked / middle clicked
+		mapViewer.addMouseListener(new CenterMapListener(mapViewer));
+		// zoom with mousewheel
+		mapViewer.addMouseWheelListener(new ZoomMouseWheelListenerCursor(mapViewer));
+		// TODO make this work
+		mapViewer.addKeyListener(new PanKeyListener(mapViewer));
+		// "Drag map around" Listener
+		MouseInputListener mia = new PanMouseInputListener(mapViewer);
+		mapViewer.addMouseListener(mia);
+		mapViewer.addMouseMotionListener(mia);
+
+		swingNodeWorldView.setContent(mapViewer);
+
+		// add resize Listener to the stackPane
+		stackPane.heightProperty().addListener(new ResizeListener(swingNode, stackPane));
+		stackPane.widthProperty().addListener(new ResizeListener(swingNode, stackPane));
+
+		swingNodeWorldView.setVisible(false);
+	}
+
 	/**
 	 * Initializes the Menu Bar with all its contents.
 	 */
@@ -191,6 +235,11 @@ public class GUIController implements Initializable {
 				.addListener((ov, oldVal, newVal) -> ButtonManager.labelVisibilitySwitcher(ov, oldVal, newVal));
 		edgeWeightCheckbox.selectedProperty()
 				.addListener((ov, oldVal, newVal) -> ButtonManager.edgeWeightVisibilitySwitcher(ov, oldVal, newVal));
+
+		mapViewChoiceBox.setItems(FXCollections.observableArrayList("Default", "Road", "Satellite", "Hybrid"));
+		mapViewChoiceBox.getSelectionModel().selectFirst();
+		mapViewChoiceBox.getSelectionModel().selectedItemProperty()
+				.addListener((ov, oldVal, newVal) -> ButtonManager.mapViewChoiceChange(ov, oldVal, newVal));
 	}
 
 	/**
@@ -343,7 +392,9 @@ public class GUIController implements Initializable {
 		assert edgesVisibleCheckbox != null : "fx:id=\"edgesVisibleCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert nodeLabelCheckbox != null : "fx:id=\"nodeLabelCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 		assert edgeWeightCheckbox != null : "fx:id=\"egdeWeightCheckbox\" was not injected: check your FXML file 'MainWindow.fxml'.";
+		assert mapViewChoiceBox != null : "fx:id=\"mapViewChoiceBox\" was not injected: check your FXML file 'MainWindow.fxml'.";
 
+		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'.";
 	}
 }

+ 3 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java

@@ -210,7 +210,7 @@ public final class PropertiesManager {
 	 *            selected Node or Edge
 	 * @param newData
 	 */
-	private static void showNewDataSet(Element selected) {
+	public static void showNewDataSet(Element selected) {
 		if (selected == null) {
 			return;
 		}
@@ -240,6 +240,8 @@ public final class PropertiesManager {
 				break;
 			case "ui.class":
 				break;
+			case "ui.map.selected":
+				break;
 			case "xyz":
 				double[] pos = Toolkit.nodePosition((Node) selected);
 				newData.add(new KeyValuePair("x", String.valueOf(pos[0]), double.class));

+ 35 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/handlers/ResizeListener.java

@@ -7,6 +7,7 @@ import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.embed.swing.SwingNode;
 import javafx.scene.layout.Pane;
+import javafx.scene.layout.StackPane;
 
 /**
  * The Listener to resize the graph view manually whenever its parent pane is
@@ -25,7 +26,31 @@ public class ResizeListener implements ChangeListener<Number> {
 	/**
 	 * The parent Pane of the swingnode.
 	 */
-	private Pane pane;
+	private Pane pane = null;
+
+	/**
+	 * Parent StackPane of swingNode for WorldView
+	 */
+	private StackPane stackPane = null;
+
+	/**
+	 * Indicates if pane or stackPane are used
+	 */
+	private Boolean paneUsed;
+
+	/**
+	 * Creates a new ResizeListener for a swingNode and its parent StackPane.
+	 * 
+	 * @param swingNode
+	 *            the SwingNode
+	 * @param stackPane
+	 *            the StackPane
+	 */
+	public ResizeListener(SwingNode swingNod, StackPane stackPane) {
+		this.swingNode = swingNod;
+		this.stackPane = stackPane;
+		this.paneUsed = false;
+	}
 
 	/**
 	 * Creates a new ResizeListener for a swingNode and its parent Pane.
@@ -38,13 +63,18 @@ public class ResizeListener implements ChangeListener<Number> {
 	public ResizeListener(SwingNode swingNod, Pane pan) {
 		this.swingNode = swingNod;
 		this.pane = pan;
+		this.paneUsed = true;
 	}
 
 	@Override
 	public void changed(ObservableValue<? extends Number> arg0, Number arg1, Number arg2) {
-		Main.getInstance().getGraphManager().getView()
-				.setPreferredSize(new Dimension((int) pane.getWidth() - 5, (int) pane.getHeight() - 5));
-		swingNode.setContent(Main.getInstance().getGraphManager().getView());
-	}
+		if (!paneUsed) {
+			swingNode.getContent().setSize(new Dimension((int) stackPane.getWidth(), (int) stackPane.getHeight()));
+		} else {
+			Main.getInstance().getGraphManager().getView()
+					.setPreferredSize(new Dimension((int) pane.getWidth() - 5, (int) pane.getHeight() - 5));
+			swingNode.setContent(Main.getInstance().getGraphManager().getView());
 
+		}
+	}
 }

+ 121 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomMapClickListener.java

@@ -0,0 +1,121 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.util.HashSet;
+
+import org.graphstream.graph.Edge;
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.input.MapClickListener;
+import org.jxmapviewer.viewer.GeoPosition;
+
+import de.tu_darmstadt.informatik.tk.scopviz.main.Layer;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.PropertiesManager;
+
+public class CustomMapClickListener extends MapClickListener {
+
+	private final HashSet<CustomWaypoint> nodePositions;
+	private final JXMapViewer viewer;
+
+	private static CustomWaypoint selected;
+
+	private static HashSet<Edge> edges;
+
+	public CustomMapClickListener(JXMapViewer viewer, HashSet<CustomWaypoint> waypoints, HashSet<Edge> edges) {
+		super(viewer);
+
+		this.viewer = viewer;
+		this.nodePositions = waypoints;
+		CustomMapClickListener.edges = edges;
+
+	}
+
+	@Override
+	public void mapClicked(GeoPosition arg0) {
+
+		Point2D clickedPoint = this.viewer.getTileFactory().geoToPixel(arg0, this.viewer.getZoom());
+		Point2D nodePoint;
+
+		// a waypoint was clicked
+		Boolean wayPointSelected = false;
+
+		for (CustomWaypoint nodeWaypoint : this.nodePositions) {
+			// transform GeoPosition to point on screen
+			nodePoint = this.viewer.getTileFactory().geoToPixel(nodeWaypoint.getPosition(), this.viewer.getZoom());
+
+			boolean yChecked = false;
+
+			// clicked position is in range of 50 pixel above the waypoint
+			// position
+			double deltaY = clickedPoint.getY() - nodePoint.getY();
+			if (deltaY > -50 && deltaY < 0) {
+				yChecked = true;
+			}
+
+			// clicked Position is in x- and y-range of wapoint position (in
+			// range of 50 pixels)
+			if (Math.abs(clickedPoint.getX() - nodePoint.getX()) < 25 && yChecked) {
+
+				wayPointSelected = true;
+
+				PropertiesManager.showNewDataSet(GraphDisplayManager.getGraphManager(Layer.UNDERLAY).getGraph()
+						.getNode(nodeWaypoint.getNodeID()));
+
+				// deselect old waypoint and select new clicked waypoint
+				deselectAll();
+				selected = nodeWaypoint;
+				nodeWaypoint.select();
+				viewer.repaint();
+				break;
+			}
+		}
+
+		// no node selected so check if edge selected
+		if (!wayPointSelected) {
+			for (Edge edge : CustomMapClickListener.edges) {
+				// Get geo Positions of the two nodes that define the edge
+				GeoPosition startPos = new GeoPosition(edge.getNode0().getAttribute("lat"),
+						edge.getNode0().getAttribute("long"));
+				GeoPosition endPos = new GeoPosition(edge.getNode1().getAttribute("lat"),
+						edge.getNode1().getAttribute("long"));
+
+				// convert geo-coordinate to world bitmap pixel
+				Point2D startPoint = viewer.getTileFactory().geoToPixel(startPos, viewer.getZoom());
+				Point2D endPoint = viewer.getTileFactory().geoToPixel(endPos, viewer.getZoom());
+
+				Line2D.Double line = new Line2D.Double(startPoint.getX(), startPoint.getY(), endPoint.getX(),
+						endPoint.getY());
+
+				// Clicked point in 10 pixel range of line
+				if (line.ptLineDist(clickedPoint) < 10) {
+					deselectAll();
+					if (!edge.hasAttribute("ui.map.selected"))
+						edge.addAttribute("ui.map.selected", true);
+					else
+						edge.changeAttribute("ui.map.selected", true);
+
+					PropertiesManager.showNewDataSet(edge);
+
+					viewer.repaint();
+					break;
+				} else {
+					edge.changeAttribute("ui.map.selected", false);
+				}
+			}
+		}
+
+	}
+
+	/**
+	 * deselect all edges and the selected node
+	 */
+	public static void deselectAll() {
+		if (selected != null)
+			selected.deselect();
+		for (Edge edge : edges) {
+			edge.changeAttribute("ui.map.selected", false);
+		}
+	}
+
+}

+ 80 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomWaypoint.java

@@ -0,0 +1,80 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.net.URL;
+
+import org.jxmapviewer.viewer.DefaultWaypoint;
+import org.jxmapviewer.viewer.GeoPosition;
+
+/**
+ * A waypoint that also has a color and a label
+ * 
+ * @author Martin Steiger
+ */
+public class CustomWaypoint extends DefaultWaypoint {
+
+	private final String label;
+	private final URL resource;
+	private final String nodeID;
+
+	private Boolean isSelected = false;
+
+	/**
+	 * @param label
+	 *            the text
+	 * @param color
+	 *            the color
+	 * @param coord
+	 *            the coordinate
+	 */
+	public CustomWaypoint(String label, String nodeID, URL resource, GeoPosition coord) {
+		super(coord);
+		this.label = label;
+		this.resource = resource;
+		this.nodeID = nodeID;
+	}
+
+	/**
+	 * @return the label text
+	 */
+	public String getLabel() {
+		return label;
+	}
+
+	/**
+	 * @return the ressource png
+	 */
+	public URL getResource() {
+		return resource;
+	}
+
+	/**
+	 * 
+	 * @return the id of the referenced node
+	 */
+	public String getNodeID() {
+		return nodeID;
+	}
+
+	/**
+	 * change isSelected value to true
+	 */
+	public void select() {
+		this.isSelected = true;
+	}
+
+	/**
+	 * change isSelected value to false
+	 */
+	public void deselect() {
+		this.isSelected = false;
+	}
+
+	/**
+	 * return isSelected value
+	 * 
+	 * @return
+	 */
+	public Boolean getIsSelected() {
+		return this.isSelected;
+	}
+}

+ 89 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/CustomWaypointRenderer.java

@@ -0,0 +1,89 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+
+import javax.imageio.ImageIO;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.viewer.WaypointRenderer;
+
+public class CustomWaypointRenderer implements WaypointRenderer<CustomWaypoint> {
+
+	private static final Log log = LogFactory.getLog(CustomWaypointRenderer.class);
+
+	private final Font font = new Font("Lucida Sans", Font.BOLD, 15);
+
+	private Boolean showLabels = true;
+
+	private static final Color STANDARD = Color.BLACK;
+
+	private static final Color CLICKED = Color.RED;
+
+	private static final int ALPHA = 255;
+
+	@Override
+	public void paintWaypoint(Graphics2D g, JXMapViewer viewer, CustomWaypoint w) {
+
+		g = (Graphics2D) g.create();
+		BufferedImage origImage = null;
+
+		try {
+			origImage = ImageIO.read(w.getResource());
+			if (w.getIsSelected()) {
+				origImage = MapViewFunctions.colorImage(origImage, STANDARD, CLICKED, ALPHA);
+			}
+		} catch (Exception ex) {
+			log.warn("couldn't read Waypoint png", ex);
+		}
+
+		if (origImage == null)
+			return;
+
+		// scale image down
+		BufferedImage myImg = MapViewFunctions.scaleImage(origImage, 60, 60);
+
+		// get waypoint position
+		Point2D point = viewer.getTileFactory().geoToPixel(w.getPosition(), viewer.getZoom());
+
+		int x = (int) point.getX();
+		int y = (int) point.getY();
+
+		g.drawImage(myImg, x - myImg.getWidth() / 2, y - myImg.getHeight(), null);
+
+		if (showLabels) {
+
+			// Set label Position on street map
+			String label = w.getLabel();
+			g.setFont(font);
+
+			if (w.getIsSelected()) {
+				g.setColor(CLICKED);
+			} else
+				g.setColor(STANDARD);
+
+			// get label height and width under given font
+			FontMetrics metrics = g.getFontMetrics();
+			int tw = metrics.stringWidth(label);
+			int th = 1 + metrics.getAscent();
+
+			g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+			// Show label left middle of deviceType picture
+			g.drawString(label, x - myImg.getWidth() / 2 - tw - 5, y + th / 2 - myImg.getHeight() / 2);
+
+			g.dispose();
+		}
+	}
+
+	public void setShowLabels(Boolean showLabels) {
+		this.showLabels = showLabels;
+	}
+
+}

+ 189 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/EdgePainter.java

@@ -0,0 +1,189 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.geom.Point2D;
+import java.util.HashSet;
+
+import org.graphstream.graph.Edge;
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.painter.Painter;
+import org.jxmapviewer.viewer.GeoPosition;
+
+/**
+ * Paints a route
+ * 
+ * @author Dominik Renkel
+ */
+public class EdgePainter implements Painter<JXMapViewer> {
+
+	private boolean showEdges = true;
+
+	private static final Color STANDARD = Color.BLACK;
+
+	private static final Color CLICKED = Color.RED;
+
+	private boolean antiAlias = true;
+
+	private static HashSet<Edge> edges;
+
+	private Boolean showWeights = true;
+
+	/**
+	 * @param track
+	 *            the track
+	 */
+	public EdgePainter(HashSet<Edge> track) {
+		// copy the list so that changes in the
+		// original list do not have an effect here
+		edges = new HashSet<Edge>(track);
+	}
+
+	@Override
+	public void paint(Graphics2D g, JXMapViewer mapViewer, int w, int h) {
+
+		if (showEdges) {
+			g = (Graphics2D) g.create();
+
+			// convert from viewport to world bitmap
+			Rectangle rect = mapViewer.getViewportBounds();
+			g.translate(-rect.x, -rect.y);
+
+			if (antiAlias)
+				g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+			// do the drawing
+			g.setColor(STANDARD);
+			g.setStroke(new BasicStroke(4));
+
+			drawRoute(g, mapViewer);
+
+			// do the drawing again
+			g.setColor(STANDARD);
+			g.setStroke(new BasicStroke(2));
+
+			drawRoute(g, mapViewer);
+
+			g.dispose();
+		}
+	}
+
+	/**
+	 * Draws a line on the street map for all edges
+	 * 
+	 * @param g
+	 *            the graphics object
+	 * @param mapViewer
+	 *            the map
+	 */
+	private void drawRoute(Graphics2D g, JXMapViewer mapViewer) {
+
+		for (Edge edge : edges) {
+
+			// Get geo Positions of the two nodes that define the edge
+			GeoPosition startPos = new GeoPosition(edge.getNode0().getAttribute("lat"),
+					edge.getNode0().getAttribute("long"));
+			GeoPosition endPos = new GeoPosition(edge.getNode1().getAttribute("lat"),
+					edge.getNode1().getAttribute("long"));
+
+			// convert geo-coordinate to world bitmap pixel
+			Point2D startPoint = mapViewer.getTileFactory().geoToPixel(startPos, mapViewer.getZoom());
+			Point2D endPoint = mapViewer.getTileFactory().geoToPixel(endPos, mapViewer.getZoom());
+
+			// if edge has attribute selected
+			if (edge.hasAttribute("ui.map.selected")) {
+
+				// draw red line if edge is selected
+				if ((boolean) edge.getAttribute("ui.map.selected")) {
+					g.setColor(CLICKED);
+					g.drawLine((int) startPoint.getX(), (int) startPoint.getY(), (int) endPoint.getX(),
+							(int) endPoint.getY());
+
+					// draw black line if not selected
+				} else {
+					g.setColor(STANDARD);
+					g.drawLine((int) startPoint.getX(), (int) startPoint.getY(), (int) endPoint.getX(),
+							(int) endPoint.getY());
+				}
+
+				// edge hasnt got selected attribute
+			} else {
+				g.setColor(STANDARD);
+				g.drawLine((int) startPoint.getX(), (int) startPoint.getY(), (int) endPoint.getX(),
+						(int) endPoint.getY());
+			}
+
+			if (showWeights) {
+				drawWeights(edge, g, startPoint, endPoint);
+			}
+		}
+	}
+
+	/**
+	 * draw the weights of an edge
+	 * 
+	 * @param edge
+	 *            edge
+	 * @param g
+	 *            graphic
+	 * @param startPoint
+	 *            start point edge
+	 * @param endPoint
+	 *            end point edge
+	 */
+	private void drawWeights(Edge edge, Graphics2D g, Point2D startPoint, Point2D endPoint) {
+		// Set weight Position on street map
+		String weight = edge.getAttribute("weight").toString();
+
+		// get weight height and width under given font
+		FontMetrics metrics = g.getFontMetrics();
+		int tw = metrics.stringWidth(weight);
+		int th = 1 + metrics.getAscent();
+
+		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+		double deltaX = (startPoint.getX() - endPoint.getX()) / 2;
+		double deltaY = (startPoint.getY() - endPoint.getY()) / 2;
+
+		double weightPosX;
+		double weightPosY;
+
+		if (deltaX < 0) {
+			weightPosX = startPoint.getX() + Math.abs(deltaX);
+		} else {
+			weightPosX = startPoint.getX() - Math.abs(deltaX);
+		}
+
+		if (deltaY < 0) {
+			weightPosY = startPoint.getY() + Math.abs(deltaY);
+		} else {
+			weightPosY = startPoint.getY() - Math.abs(deltaY);
+		}
+		// Show weight left middle of deviceType picture
+		g.drawString(weight, (int) weightPosX - tw / 2, (int) weightPosY - th / 2);
+
+	}
+
+	/**
+	 * Sets the removeEdges attribute
+	 * 
+	 * @param showEdges
+	 */
+	public void setShowEdges(Boolean showEdges) {
+		this.showEdges = showEdges;
+	}
+
+	/**
+	 * sets the showWeights attribute
+	 * 
+	 * @param showWeights
+	 */
+	public void setShowWeights(Boolean showWeights) {
+		this.showWeights = showWeights;
+	}
+
+}

+ 268 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/MapViewFunctions.java

@@ -0,0 +1,268 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.net.URL;
+import java.util.HashSet;
+
+import org.graphstream.graph.Edge;
+import org.graphstream.graph.Node;
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.OSMTileFactoryInfo;
+import org.jxmapviewer.VirtualEarthTileFactoryInfo;
+import org.jxmapviewer.painter.Painter;
+import org.jxmapviewer.viewer.DefaultTileFactory;
+import org.jxmapviewer.viewer.GeoPosition;
+import org.jxmapviewer.viewer.TileFactoryInfo;
+import org.jxmapviewer.viewer.WaypointPainter;
+
+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.MainApp;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.GraphDisplayManager;
+
+public final class MapViewFunctions {
+
+	/**
+	 * private constructor to avoid instantiation
+	 */
+	private MapViewFunctions() {
+
+	}
+
+	/**
+	 * Scale a given BufferedImage down to given width w and given height h
+	 * 
+	 * @param loadImg
+	 * @param w
+	 * @param h
+	 * @return
+	 */
+	public static BufferedImage scaleImage(BufferedImage loadImg, int w, int h) {
+		BufferedImage imgOut = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+
+		Graphics2D graphics = imgOut.createGraphics();
+		graphics.drawImage(loadImg, 0, 0, w, h, null);
+		graphics.dispose();
+
+		return imgOut;
+	}
+
+	/**
+	 * change all pixels from a given color to another given color (under a
+	 * given alpha value)
+	 *
+	 * @param image
+	 * @param toChange
+	 *            change all pixels with this color to another color
+	 * @param changeWith
+	 *            new color
+	 * @param alpha
+	 * @return
+	 */
+	public static BufferedImage colorImage(BufferedImage image, Color toChange, Color changeWith, int alpha) {
+		int width = image.getWidth();
+		int height = image.getHeight();
+
+		for (int xx = 0; xx < width; xx++) {
+			for (int yy = 0; yy < height; yy++) {
+				Color originalColor = new Color(image.getRGB(xx, yy), true);
+
+				// Pixel is Black -> paint it Red
+				if (originalColor.equals(toChange) && originalColor.getAlpha() == alpha) {
+					image.setRGB(xx, yy, changeWith.getRGB());
+				}
+			}
+		}
+		return image;
+	}
+
+	/**
+	 * Initialize HashSets with data from graph
+	 * 
+	 * @param nodePositions
+	 *            Read node data to create GeoPositions of all nodes
+	 * @param waypoints
+	 *            Read node data to create CustomWaypoints with deviceTypes
+	 */
+	public static void fetchGraphData(HashSet<GeoPosition> nodePositions, HashSet<CustomWaypoint> waypoints,
+			HashSet<Edge> edges) {
+
+		GraphManager man = GraphDisplayManager.getGraphManager(Layer.UNDERLAY);
+
+		// add all edges from the Graph to the HashSet
+		for (Edge edge : man.getGraph().getEdgeSet()) {
+			edges.add(edge);
+		}
+
+		// fetch all needed data from nodes
+		for (Node node : man.getGraph().getEachNode()) {
+
+			if (node.hasAttribute("lat") && node.hasAttribute("long")) {
+
+				// Fetch all geo-data from nodes
+				Double latitude = node.getAttribute("lat");
+				Double longitude = node.getAttribute("long");
+
+				GeoPosition geoPos = new GeoPosition(latitude.doubleValue(), longitude.doubleValue());
+
+				nodePositions.add(geoPos);
+
+				// Create waypoints with device type dependent pictures
+				String deviceType = (String) node.getAttribute("device.type");
+				URL resource = getDeviceType(deviceType);
+
+				// create a new waypoint with the node information
+				waypoints.add(new CustomWaypoint(node.getAttribute("ui.label"), node.getId(), resource, geoPos));
+
+			}
+		}
+	}
+
+	/**
+	 * get the png URL based on the device.type of nodes
+	 * 
+	 * @param deviceType
+	 * @return
+	 */
+	public static URL getDeviceType(String deviceType) {
+		// TODO add pngs for device types
+		switch (deviceType.equals(null) ? "" : deviceType) {
+
+		case "3G_lte_basestation":
+			return MainApp.class.getResource("/png/symbol_icons/3G_lte_basestation.png");
+
+		case "car":
+			return MainApp.class.getResource("/png/symbol_icons/car.png");
+
+		case "cloud_computing_server":
+			return MainApp.class.getResource("/png/symbol_icons/cloud_computing_server.png");
+			
+		case "data_storage":
+			return MainApp.class.getResource("/png/symbol_icons/data_storage.png");
+			
+		case "desktop":
+			return MainApp.class.getResource("/png/symbol_icons/desktop.png");
+			
+		case "laptop":
+			return MainApp.class.getResource("/png/symbol_icons/laptop.png");
+
+		case "network_middlebox":
+			return MainApp.class.getResource("/png/symbol_icons/network_middlebox.png");
+
+		case "raspberry_pi":
+			return MainApp.class.getResource("/png/symbol_icons/raspberry_pi.png");
+
+		case "router":
+			return MainApp.class.getResource("/png/symbol_icons/router.png");
+
+		case "sensor":
+			return MainApp.class.getResource("/png/symbol_icons/sensor.png");
+			
+		case "smart_home":
+			return MainApp.class.getResource("/png/symbol_icons/smart_home.png");
+			
+		case "smartband":
+			return MainApp.class.getResource("/png/symbol_icons/smartband.png");
+			
+		case "smartphone":
+			return MainApp.class.getResource("/png/symbol_icons/smartphone.png");
+			
+		case "smartwatch":
+			return MainApp.class.getResource("/png/symbol_icons/smartwatch.png");
+			
+		case "switch":
+			return MainApp.class.getResource("/png/symbol_icons/switch.png");
+			
+		case "tablet":
+			return MainApp.class.getResource("/png/symbol_icons/tablet.png");
+
+		default:
+			return MainApp.class.getResource("/png/symbol_icons/unknown.png");
+
+		}
+	}
+
+	/**
+	 * Returns either an EdgePainter (case input "edge") or a WaypointPainter
+	 * (case input "waypoint") based on input
+	 * 
+	 * @param mode
+	 *            0 or 1
+	 * @return EdgePainter or WaypointPainter if existing in CompoundPainter
+	 *         otherwise null
+	 */
+	private static Painter<JXMapViewer> getRequestedPainter(String requested) {
+
+		// return value
+		switch (requested) {
+		case "edge":
+			return WorldView.edgePainter;
+		case "waypoint":
+			return WorldView.waypointPainter;
+		default:
+			return null;
+
+		}
+
+	}
+
+	/**
+	 * change the shown map based on the selected item in the ChoiceBox
+	 */
+	public static void changeMapView() {
+		String selected = WorldView.controller.mapViewChoiceBox.getSelectionModel().getSelectedItem();
+
+		switch (selected) {
+		case "Default":
+			TileFactoryInfo defaultTileFactoryInfo = new OSMTileFactoryInfo();
+			WorldView.internMapViewer.setTileFactory(new DefaultTileFactory(defaultTileFactoryInfo));
+			break;
+
+		case "Road":
+			TileFactoryInfo roadTileFactoryInfo = new VirtualEarthTileFactoryInfo(VirtualEarthTileFactoryInfo.MAP);
+			WorldView.internMapViewer.setTileFactory(new DefaultTileFactory(roadTileFactoryInfo));
+			break;
+
+		case "Satellite":
+			TileFactoryInfo sateliteTileFactoryInfo = new VirtualEarthTileFactoryInfo(
+					VirtualEarthTileFactoryInfo.SATELLITE);
+			WorldView.internMapViewer.setTileFactory(new DefaultTileFactory(sateliteTileFactoryInfo));
+			break;
+
+		case "Hybrid":
+			TileFactoryInfo hybridTileFactoryInfo = new VirtualEarthTileFactoryInfo(VirtualEarthTileFactoryInfo.HYBRID);
+			WorldView.internMapViewer.setTileFactory(new DefaultTileFactory(hybridTileFactoryInfo));
+			break;
+		}
+	}
+
+	/**
+	 * Check if Checkboxes or ChoiceBox where changed, last time symbol-rep.
+	 * layer was shown
+	 */
+	public static void checkVBoxChanged() {
+
+		EdgePainter edgePainter = (EdgePainter) getRequestedPainter("edge");
+		WaypointPainter<CustomWaypoint> waypointPainter = (WaypointPainter<CustomWaypoint>) getRequestedPainter(
+				"waypoint");
+
+		// Checkboxes were changed last time symbolRep-Layer was shown
+		if (!WorldView.controller.edgesVisibleCheckbox.isSelected()) {
+			edgePainter.setShowEdges(false);
+		}
+		if (!WorldView.controller.nodeLabelCheckbox.isSelected()) {
+			CustomWaypointRenderer renderer = new CustomWaypointRenderer();
+			renderer.setShowLabels(false);
+			waypointPainter.setRenderer(renderer);
+		}
+		if (!WorldView.controller.edgeWeightCheckbox.isSelected()) {
+			edgePainter.setShowWeights(false);
+		}
+		if (!WorldView.controller.mapViewChoiceBox.getSelectionModel().getSelectedItem().equals("Default")) {
+			MapViewFunctions.changeMapView();
+		}
+	}
+
+}

+ 105 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/mapView/WorldView.java

@@ -0,0 +1,105 @@
+package de.tu_darmstadt.informatik.tk.scopviz.ui.mapView;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import org.graphstream.graph.Edge;
+import org.jxmapviewer.JXMapViewer;
+import org.jxmapviewer.OSMTileFactoryInfo;
+import org.jxmapviewer.painter.CompoundPainter;
+import org.jxmapviewer.painter.Painter;
+import org.jxmapviewer.viewer.DefaultTileFactory;
+import org.jxmapviewer.viewer.GeoPosition;
+import org.jxmapviewer.viewer.TileFactoryInfo;
+import org.jxmapviewer.viewer.WaypointPainter;
+
+import de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController;
+
+public class WorldView {
+
+	/*
+	 * intern map viewer
+	 */
+	public static JXMapViewer internMapViewer;
+
+	/*
+	 * edgePainter of overlayPainter
+	 */
+	public static EdgePainter edgePainter;
+
+	/*
+	 * waypointPointer of overlayPainter
+	 */
+	public static WaypointPainter<CustomWaypoint> waypointPainter;
+
+	/*
+	 * GUIController with UI elements
+	 */
+	public static GUIController controller;
+
+	
+	/**
+	 * private constructor to avoid instantiation
+	 */
+	private WorldView() {
+	}
+
+	/**
+	 * initialize attributes internMapViewer and controller
+	 * 
+	 * @param mapViewer
+	 * @param guiController
+	 */
+	public static void initAttributes(JXMapViewer mapViewer, GUIController guiController) {
+		internMapViewer = mapViewer;
+		controller = guiController;
+	}
+
+	/**
+	 * load map elements based on current underlay graph
+	 */
+	public static void loadWorldView() {
+
+		HashSet<GeoPosition> nodePositions = new HashSet<GeoPosition>();
+		HashSet<CustomWaypoint> waypoints = new HashSet<CustomWaypoint>();
+		HashSet<Edge> edges = new HashSet<Edge>();
+
+		// Get GeoPositions of nodes and get all waypoints created
+		MapViewFunctions.fetchGraphData(nodePositions, waypoints, edges);
+
+		// Create a line for all edges
+		edgePainter = new EdgePainter(edges);
+
+		// Create a waypoint painter that takes all the waypoints
+		waypointPainter = new WaypointPainter<CustomWaypoint>();
+		waypointPainter.setWaypoints(waypoints);
+		waypointPainter.setRenderer(new CustomWaypointRenderer());
+
+		// Create a compound painter that uses all painters
+		List<Painter<JXMapViewer>> painters = new ArrayList<Painter<JXMapViewer>>();
+		painters.add(waypointPainter);
+		painters.add(edgePainter);
+
+		CompoundPainter<JXMapViewer> painter = new CompoundPainter<JXMapViewer>(painters);
+
+		// Create a TileFactoryInfo for OpenStreetMap
+		TileFactoryInfo info = new OSMTileFactoryInfo();
+		DefaultTileFactory tileFactory = new DefaultTileFactory(info);
+		internMapViewer.setTileFactory(tileFactory);
+
+		// Use 8 threads in parallel to load the tiles
+		tileFactory.setThreadPoolSize(8);
+
+		// set Zoom and Center to show all node positions
+		internMapViewer.zoomToBestFit(nodePositions, 0.7);
+
+		internMapViewer.setOverlayPainter(painter);
+
+		// "click on waypoints" listener
+		internMapViewer.addMouseListener(new CustomMapClickListener(internMapViewer, waypoints, edges));
+
+		internMapViewer.repaint();
+	}
+
+}

+ 199 - 0
scopviz/src/main/resources/ExampleSymbol.graphml

@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	 xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
+	   http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
+   	<key id="attr0000" for="node" attr.name="ui.label" attr.type="string"/>
+	<key id="attr0001" for="node" attr.name="Eigenschaft" attr.type="string"/>
+	<key id="attr0002" for="node" attr.name="y" attr.type="double"/>
+	<key id="attr0003" for="node" attr.name="x" attr.type="double"/>
+	<key id="attr0004" for="node" attr.name="ui.class"  attr.type="string" />
+	<key id="attr0005" for="node" attr.name="lat"  attr.type="double" />
+	<key id="attr0006" for="node" attr.name="long"  attr.type="double" />
+	<key id="attr0007" for="node" attr.name="device.type" attr.type="string"/>
+	
+	<key id="attr0008" for="edge" attr.name="weight" attr.type="int"/>
+	
+	<graph id="Example" edgedefault="undirected">
+		<node id="A">
+			<data key="attr0000">A</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">100</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.8705556</data>
+			<data key="attr0006">8.6494444</data>
+			<data key="attr0007">router</data>
+		</node>
+		<node id="B">
+			<data key="attr0000">B</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">200</data>
+			<data key="attr0003">100</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">50</data>
+			<data key="attr0006">9</data>
+			<data key="attr0007">desktop</data>
+		</node>
+		<node id="C">
+			<data key="attr0000">C</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">50.1</data>
+			<data key="attr0006">8.5</data>
+			<data key="attr0007">3G_lte_basestation</data>
+		</node>
+		<node id="D">
+			<data key="attr0000">D</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.89</data>
+			<data key="attr0006">8.1</data>
+			<data key="attr0007">car</data>
+		</node>
+		<node id="E">
+			<data key="attr0000">E</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.723</data>
+			<data key="attr0006">8.6</data>
+			<data key="attr0007">cloud_computing_server</data>
+		</node>
+		<node id="F">
+			<data key="attr0000">F</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.87478</data>
+			<data key="attr0006">8.3</data>
+			<data key="attr0007">data_storage</data>
+		</node>
+		<node id="G">
+			<data key="attr0000">G</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.689</data>
+			<data key="attr0006">8.09</data>
+			<data key="attr0007">laptop</data>
+		</node>
+		<node id="H">
+			<data key="attr0000">H</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.792</data>
+			<data key="attr0006">8.9</data>
+			<data key="attr0007">network_middlebox</data>
+		</node>
+		<node id="I">
+			<data key="attr0000">I</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.7852</data>
+			<data key="attr0006">8.05</data>
+			<data key="attr0007">raspberry_pi</data>
+		</node>
+		<node id="J">
+			<data key="attr0000">J</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.8</data>
+			<data key="attr0006">8.3843</data>
+			<data key="attr0007">sensor</data>
+		</node>
+		<node id="K">
+			<data key="attr0000">K</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.6584</data>
+			<data key="attr0006">8.3172</data>
+			<data key="attr0007">smart_home</data>
+		</node>
+		<node id="L">
+			<data key="attr0000">L</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.6984</data>
+			<data key="attr0006">8.2872</data>
+			<data key="attr0007">smartband</data>
+		</node>
+		<node id="M">
+			<data key="attr0000">M</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.4887</data>
+			<data key="attr0006">8.39</data>
+			<data key="attr0007">smartphone</data>
+		</node>
+		<node id="N">
+			<data key="attr0000">N</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.578</data>
+			<data key="attr0006">8.62</data>
+			<data key="attr0007">smartwatch</data>
+		</node>
+		<node id="O">
+			<data key="attr0000">O</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.3953</data>
+			<data key="attr0006">8.606</data>
+			<data key="attr0007">switch</data>
+		</node>
+		<node id="P">
+			<data key="attr0000">P</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.652321</data>
+			<data key="attr0006">8.49995</data>
+			<data key="attr0007">tablet</data>
+		</node>
+		<node id="Q">
+			<data key="attr0000">Q</data>
+			<data key="attr0001">test</data>
+			<data key="attr0002">100</data>
+			<data key="attr0003">200</data>
+			<data key="attr0004">standard</data>
+			<data key="attr0005">49.702</data>
+			<data key="attr0006">8.92</data>
+			<data key="attr0007">unknown</data>
+		</node>
+
+		
+		<edge id="AB" source="A" target="B" directed="false">
+			<data key="attr0001">test</data>
+			<data key="attr0008">100</data>
+		</edge>
+		<edge id="BC" source="B" target="C" directed="false">
+			<data key="attr0001">test</data>
+			<data key="attr0008">5</data>
+		</edge>
+	</graph>
+</graphml>

+ 11 - 5
scopviz/src/main/resources/MainWindow.fxml

@@ -4,6 +4,7 @@
 <?import javafx.geometry.Insets?>
 <?import javafx.scene.control.Button?>
 <?import javafx.scene.control.CheckBox?>
+<?import javafx.scene.control.ChoiceBox?>
 <?import javafx.scene.control.ListView?>
 <?import javafx.scene.control.Menu?>
 <?import javafx.scene.control.MenuBar?>
@@ -14,9 +15,8 @@
 <?import javafx.scene.control.TableView?>
 <?import javafx.scene.layout.AnchorPane?>
 <?import javafx.scene.layout.Pane?>
+<?import javafx.scene.layout.StackPane?>
 <?import javafx.scene.layout.VBox?>
-<?import javafx.scene.text.Font?>
-<?import javafx.scene.text.Text?>
 
 <VBox minHeight="400.0" minWidth="640.0" prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController">
   <children>
@@ -84,6 +84,7 @@
                                                 <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
                                              </padding>
                                           </CheckBox>
+                                          <ChoiceBox fx:id="mapViewChoiceBox" prefWidth="150.0" />
                                        </children></VBox>
                                 </children>
                               </AnchorPane>
@@ -111,13 +112,18 @@
                           <items>
                             <AnchorPane styleClass="background" SplitPane.resizableWithParent="false">
                                  <children>
+                                    <StackPane fx:id="stackPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
+                                       <children>
+                                          <SwingNode fx:id="swingNodeWorldView" />
+                                       </children>
+                                    </StackPane>
                                     <Pane fx:id="pane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                                        <children>
                                           <SwingNode fx:id="swingNode" />
-                                          <SwingNode fx:id="swingNodeWorldView" />
-                                       </children></Pane>
-                                    <Button fx:id="zoomOut" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="30.0" prefWidth="30.0" text="-" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0" />
+                                       </children>
+                                    </Pane>
                                     <Button fx:id="zoomIn" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="30.0" prefWidth="30.0" text="+" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="45.0" AnchorPane.rightAnchor="10.0" />
+                                    <Button fx:id="zoomOut" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="30.0" prefWidth="30.0" text="-" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0" />
                                  </children>
                               </AnchorPane>
                             <AnchorPane SplitPane.resizableWithParent="false">

BIN
scopviz/src/main/resources/png/computer.png


BIN
scopviz/src/main/resources/png/router.png


BIN
scopviz/src/main/resources/png/symbol_icons/3G_lte_basestation.png


BIN
scopviz/src/main/resources/png/symbol_icons/car.png


BIN
scopviz/src/main/resources/png/symbol_icons/cloud_computing_server.png


BIN
scopviz/src/main/resources/png/symbol_icons/data_storage.png


BIN
scopviz/src/main/resources/png/symbol_icons/desktop.png


BIN
scopviz/src/main/resources/png/symbol_icons/laptop.png


BIN
scopviz/src/main/resources/png/symbol_icons/network_middlebox.png


BIN
scopviz/src/main/resources/png/symbol_icons/raspberry_pi.png


BIN
scopviz/src/main/resources/png/symbol_icons/router.png


BIN
scopviz/src/main/resources/png/symbol_icons/sensor.png


BIN
scopviz/src/main/resources/png/symbol_icons/smart_home.png


BIN
scopviz/src/main/resources/png/symbol_icons/smartband.png


BIN
scopviz/src/main/resources/png/symbol_icons/smartphone.png


BIN
scopviz/src/main/resources/png/symbol_icons/smartwatch.png


BIN
scopviz/src/main/resources/png/symbol_icons/switch.png


BIN
scopviz/src/main/resources/png/symbol_icons/tablet.png


BIN
scopviz/src/main/resources/png/symbol_icons/unknown.png