[archstudio-commits] svn commit: r7065 - in /calico/branches/mitchnick2/ics/uci/edu/Calico: UI/CalicoCanvas.java UI/MouseInputHandler.java UI/components/CalicoGrid.java models/ObjectHandlerModel.java

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Fri May 2 10:07:17 PDT 2008


Author: nmangano
Date: Fri May  2 10:07:16 2008
New Revision: 7065

Log:
The recovery fix wasn't actually complete, here's the rest of the code.

Modified:
    calico/branches/mitchnick2/ics/uci/edu/Calico/UI/CalicoCanvas.java
    calico/branches/mitchnick2/ics/uci/edu/Calico/UI/MouseInputHandler.java
    calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/CalicoGrid.=
java
    calico/branches/mitchnick2/ics/uci/edu/Calico/models/ObjectHandlerModel=
.java

Modified: calico/branches/mitchnick2/ics/uci/edu/Calico/UI/CalicoCanvas.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- calico/branches/mitchnick2/ics/uci/edu/Calico/UI/CalicoCanvas.java (ori=
ginal)
+++ calico/branches/mitchnick2/ics/uci/edu/Calico/UI/CalicoCanvas.java Fri =
May  2 10:07:16 2008
@@ -785,6 +785,14 @@
 		return latestAction;
 	}
 	=

+	public void clearInvalidNodes() {
+		for (int i =3D getLayer().getChildrenCount() - 1; i > -1; i--) {
+			if (getLayer().getChild(i) instanceof BGElementPainter &&
+					((BGElementPainter)getLayer().getChild(i)).getId() < 0)
+				getLayer().removeChild(i);
+		}
+	}
+	=

 }
 =

 =


Modified: calico/branches/mitchnick2/ics/uci/edu/Calico/UI/MouseInputHandle=
r.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- calico/branches/mitchnick2/ics/uci/edu/Calico/UI/MouseInputHandler.java=
 (original)
+++ calico/branches/mitchnick2/ics/uci/edu/Calico/UI/MouseInputHandler.java=
 Fri May  2 10:07:16 2008
@@ -791,6 +791,13 @@
 		}
 		hist.add(p);
 	}
+	=

+	public void resetStrokes() {
+		for (BGElementPainter bge : pathLines) {
+			canvas.getLayer().removeChild(bge);
+		}
+		pathLines.clear();
+	}
 =

 	protected void pan(PInputEvent e) {
 		PCamera c =3D e.getCamera();

Modified: calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Calic=
oGrid.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/CalicoGrid.=
java (original)
+++ calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/CalicoGrid.=
java Fri May  2 10:07:16 2008
@@ -932,8 +932,11 @@
 	 */
 	public void loadGrid() {
 		//setupMenu();
-		canvas.removeInputEventListener(inputHandler);
-		inputHandler =3D null;
+		//canvas.removeInputEventListener(inputHandler);
+		if (inputHandler !=3D null)
+			inputHandler.resetStrokes();
+		canvas.clearInvalidNodes();		=

+		//inputHandler =3D null;
 		canvas.fireListeners(new GridView(currentCell));
 		canvas.getCamera().addChild(this);
 		updateBounds(canvas.getWidth(), canvas.getHeight());

Modified: calico/branches/mitchnick2/ics/uci/edu/Calico/models/ObjectHandle=
rModel.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- calico/branches/mitchnick2/ics/uci/edu/Calico/models/ObjectHandlerModel=
.java (original)
+++ calico/branches/mitchnick2/ics/uci/edu/Calico/models/ObjectHandlerModel=
.java Fri May  2 10:07:16 2008
@@ -32,7 +32,7 @@
 		relationships =3D new ArrayList<RelationshipModel>();
 		bgElements =3D new ArrayList<BGElementModel>();
 		bgColor =3D defaultBackground;
-		objectIdTicker =3D -1;
+		objectIdTicker =3D 0;
 	}
 	=

 	//Alex:Copy constructor. May not need this later, trying for now




More information about the archstudio-commits mailing list