Browse Source

minor changes

Teh-Hai Julian Zheng 7 years ago
parent
commit
f411c072fa
2 changed files with 5 additions and 14 deletions
  1. 0 2
      src/ui/controller/LoadController.java
  2. 5 12
      src/ui/controller/StoreController.java

+ 0 - 2
src/ui/controller/LoadController.java

@@ -329,8 +329,6 @@ public class LoadController {
 
 		if (object.get("connection").getAsBoolean()) {
 			temp.getA().getConnections().add(temp);
-			System.out.println(temp.getB().getID());
-			System.out.println(temp.getB());
 			temp.getB().getConnections().add(temp);
 		}
 

+ 5 - 12
src/ui/controller/StoreController.java

@@ -301,34 +301,27 @@ public class StoreController {
 			// Key and occasionally the id of Uppernode
 			switch (type) {
 			case CANVAS:
-				if (edge.getA().getConnections().contains(edge) && edge.getA().getConnections().contains(edge))
-					b = true;
-				temp.add("connection", new JsonPrimitive(b));
-
 				k = "CVSEDGE" + getNumerator(NUMTYPE.EDGE);
 				break;
 			case CONNECTION:
-				temp.add("connection", new JsonPrimitive(b));
 				k = "CONNEDGE" + getNumerator(NUMTYPE.CONNECTION);
 				break;
 			case NODE:
 				temp.add("ID", new JsonPrimitive(id));
-				if (edge.getA().getConnections().contains(edge) && edge.getA().getConnections().contains(edge))
-					b = true;
-				temp.add("connection", new JsonPrimitive(b));
 				k = "NODEEDGE" + getNumerator(NUMTYPE.NODEEDGE);
 				break;
 			case OLD:
 				temp.add("ID", new JsonPrimitive(id));
-				if (edge.getA().getConnections().contains(edge) && edge.getA().getConnections().contains(edge))
-					b = true;
-				temp.add("connection", new JsonPrimitive(b));
 				k = "OLDEDGE" + getNumerator(NUMTYPE.OLDEDGE);
 				break;
 			default:
 				break;
 			}
-
+			// lookup if the CVS, NODE or OLDEDGE are also connections
+			if (edge.getA().getConnections().contains(edge) && edge.getA().getConnections().contains(edge)
+					&& !type.equals(EDGETYPE.CANVAS))
+				b = true;
+			temp.add("connection", new JsonPrimitive(b));
 			file.add(k, gson.toJsonTree(temp));
 			temp = new JsonObject();
 		}