Pārlūkot izejas kodu

Fixed NullPointers on Layer change

Jan Enders 8 gadi atpakaļ
vecāks
revīzija
4cce7fbf99

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

@@ -36,7 +36,7 @@ public class GraphManager {
 	 * The Stylesheet for this Graph, excluding parts that can be set by
 	 * NodeGraphics.
 	 */
-	protected String stylesheet;
+	protected String stylesheet = "";
 
 	/** The last Node that was deleted. */
 	protected Node deletedNode;

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

@@ -143,7 +143,7 @@ public class GUIController implements Initializable {
 		// Initialize the Managers for the various for UI elements
 		ToolboxManager.initializeItems(toolbox);
 		PropertiesManager.initializeItems(properties);
-		GraphDisplayManager.setGuiController(this);
+		GraphDisplayManager.init(this);
 
 		// Bind all the handlers to their corresponding UI elements
 		initializeZoomButtons();

+ 10 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GraphDisplayManager.java

@@ -66,8 +66,17 @@ public final class GraphDisplayManager {
 	 * @param guiController
 	 *            a Reference to the GUI Controller
 	 */
-	public static void setGuiController(GUIController guiController) {
+	public static void init(GUIController guiController) {
 		GraphDisplayManager.guiController = guiController;
+		
+		addGraph();
+	    currentLayer=Layer.OPERATOR;
+		addGraph();
+		currentLayer=Layer.MAPPING;
+		addGraph();
+		currentLayer=Layer.SYMBOL;
+		addGraph();
+		currentLayer=Layer.UNDERLAY;
 	}
 
 	/**