Browse Source

Imports fixed

dominik 7 years ago
parent
commit
3b1a9a2a82

+ 31 - 22
scopviz/.classpath

@@ -1,22 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 1 - 0
scopviz/.settings/org.eclipse.core.resources.prefs

@@ -1,4 +1,5 @@
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
 encoding//src/test/java=UTF-8
 encoding/<project>=UTF-8

+ 5 - 0
scopviz/pom.xml

@@ -38,5 +38,10 @@
     	<artifactId>gs-ui</artifactId>
     	<version>1.3</version>
     </dependency>
+    <dependency>
+    	<groupId>org.jxmapviewer</groupId>
+    	<artifactId>jxmapviewer2</artifactId>
+    	<version>2.2</version>
+    </dependency>
   </dependencies>
 </project>

+ 43 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -1,10 +1,10 @@
 package de.tu_darmstadt.informatik.tk.scopviz.ui;
 
+import java.awt.Dimension;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.ResourceBundle;
 
-import javax.swing.JFrame;
 import javax.swing.JPanel;
 
 import org.jxmapviewer.JXMapViewer;
@@ -23,7 +23,6 @@ import javafx.beans.value.ObservableValue;
 import javafx.embed.swing.SwingNode;
 import javafx.fxml.FXML;
 import javafx.fxml.Initializable;
-import javafx.geometry.Insets;
 import javafx.scene.control.Button;
 import javafx.scene.control.CheckBox;
 import javafx.scene.control.Label;
@@ -35,7 +34,6 @@ import javafx.scene.control.TableRow;
 import javafx.scene.control.TableView;
 import javafx.scene.control.cell.PropertyValueFactory;
 import javafx.scene.control.cell.TextFieldTableCell;
-import javafx.scene.layout.GridPane;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.VBox;
 import javafx.scene.text.Text;
@@ -140,6 +138,9 @@ public class GUIController implements Initializable {
 	public CheckBox nodeLabelCheckbox;
 	@FXML
 	public CheckBox edgeWeightCheckbox;
+	
+	@FXML
+	public Pane worldViewPane;
 
 	/**
 	 * Initializes all the references to the UI elements specified in the FXML
@@ -168,7 +169,7 @@ public class GUIController implements Initializable {
 		// Bind all the handlers to their corresponding UI elements
 		initializeZoomButtons();
 		initializeLayerButton();
-		initializeDisplayPane();
+		//initializeDisplayPane();
 		initializeMenuBar();
 		initializeSymbolRepToolbox();
 
@@ -179,6 +180,42 @@ public class GUIController implements Initializable {
 		// Setup the Keyboard Shortcuts
 		KeyboardShortcuts.initialize(Main.getInstance().getPrimaryStage());
 
+		
+		initializeWorldView();
+	}
+
+	// Initialize world view for symbolRep.
+	private void initializeWorldView() {
+		
+		JXMapViewer mapViewer = new JXMapViewer();
+
+		// Create a TileFactoryInfo for OpenStreetMap
+		TileFactoryInfo info = new OSMTileFactoryInfo();
+		DefaultTileFactory tileFactory = new DefaultTileFactory(info);
+		mapViewer.setTileFactory(tileFactory);
+		
+		// Use 8 threads in parallel to load the tiles
+		tileFactory.setThreadPoolSize(8);
+
+		// Set the focus
+		GeoPosition frankfurt = new GeoPosition(50.11, 8.68);
+
+		mapViewer.setZoom(7);
+		mapViewer.setAddressLocation(frankfurt);
+		
+		JPanel testPane = new JPanel();
+		
+		testPane.setSize(new Dimension(500, 500));
+		testPane.add(mapViewer);
+		
+		swingNodeWorldView.setContent(testPane);
+		
+		swingNode.setVisible(false);
+		pane.setVisible(false);
+		
+		worldViewPane.setMinSize(200, 200);
+		worldViewPane.setMaxSize(1000, 1000);
+		
 	}
 
 	/**
@@ -246,7 +283,7 @@ public class GUIController implements Initializable {
 		swingNode.setOnMouseClicked(ButtonManager.clickedHandler);
 		swingNode.setOnMousePressed(GraphDisplayManager.rememberLastClickedPosHandler);
 		swingNode.setOnMouseDragged(GraphDisplayManager.mouseDraggedHandler);
-
+		
 		pane.setMinSize(200, 200);
 	}
 
@@ -391,5 +428,6 @@ public class GUIController implements Initializable {
 		assert edgeWeightCheckbox != null : "fx:id=\"egdeWeightCheckbox\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
 		
 		assert swingNodeWorldView != null : "fx:id=\"swingNodeWorldView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
+		assert worldViewPane != null : "fx:id=\"worldViewPane\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
 	}
 }

+ 6 - 2
scopviz/src/main/resources/NewBetterCoolerWindowTest.fxml

@@ -110,12 +110,11 @@
                      <children>
                         <SplitPane dividerPositions="0.8" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                           <items>
-                            <AnchorPane styleClass="background" SplitPane.resizableWithParent="false">
+                            <AnchorPane SplitPane.resizableWithParent="false">
                                  <children>
                                     <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" />
                                     <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" />
@@ -134,6 +133,11 @@
                                           <Font size="9.0" />
                                        </font>
                                     </Text>
+                                    <Pane fx:id="worldViewPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
+                                       <children>
+                                          <SwingNode fx:id="swingNodeWorldView" />
+                                       </children>
+                                    </Pane>
                                  </children>
                               </AnchorPane>
                             <AnchorPane SplitPane.resizableWithParent="false">