Revision: 4009
Author: [email protected]
Date: Wed Dec  1 09:21:10 2010
Log: Fixes some tests regarding events being fired. Mostly they were listening for changes with the property bounds, whereas that doesn't exist. You need to now look for property topLeftCorner.
http://code.google.com/p/power-architect/source/detail?r=4009

Modified:
/trunk/regress/ca/sqlpower/architect/swingui/PlayPenComponentEventCounter.java
 /trunk/regress/ca/sqlpower/architect/swingui/TestTablePane.java
 /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java
 /trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java

=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/PlayPenComponentEventCounter.java Wed Mar 17 14:29:59 2010 +++ /trunk/regress/ca/sqlpower/architect/swingui/PlayPenComponentEventCounter.java Wed Dec 1 09:21:10 2010
@@ -61,14 +61,12 @@
         * counters.
         */
     public void propertyChange(PropertyChangeEvent evt) {
-        if(evt.getPropertyName().equals("connectionPoints")) {
+        if (evt.getPropertyName().equals("connectionPoints")) {
             conPointsMoved++;
-        }
-        else if(evt.getPropertyName().equals("bounds")) {
+        } else if (evt.getPropertyName().equals("lengths")) {
             resized++;
-            if (PlayPenComponent.isLocationChange(evt)) {
-                moved++;
-            }
+ } else if (evt.getPropertyName().equals("topLeftCorner") && PlayPenComponent.isLocationChange(evt)) {
+            moved++;
         }
     }

=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestTablePane.java Mon Jul 12 08:21:11 2010 +++ /trunk/regress/ca/sqlpower/architect/swingui/TestTablePane.java Wed Dec 1 09:21:10 2010
@@ -366,7 +366,7 @@
final PlayPenComponentEventCounter eventCounter = new PlayPenComponentEventCounter();
         tp.addSPListener(new AbstractSPListener() {
             public void propertyChanged(PropertyChangeEvent evt) {
- if (evt.getPropertyName().equals("bounds") && PlayPenComponent.isLocationChange(evt)) { + if (evt.getPropertyName().equals("topLeftCorner") && PlayPenComponent.isLocationChange(evt)) {
                     eventCounter.propertyChange(evt);
                 }
             }
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java Wed Dec 1 09:15:40 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java Wed Dec 1 09:21:10 2010
@@ -334,8 +334,8 @@

     @NonBound
     public static boolean isLocationChange(PropertyChangeEvent evt) {
-        Rectangle oldVal = (Rectangle) evt.getOldValue();
-        Rectangle newVal = (Rectangle) evt.getNewValue();
+        Point oldVal = (Point) evt.getOldValue();
+        Point newVal = (Point) evt.getNewValue();
         return (oldVal.x != newVal.x || oldVal.y != newVal.y);
     }

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java Tue Nov 16 08:27:40 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java Wed Dec 1 09:21:10 2010
@@ -171,6 +171,7 @@

                this.insertionPoint = tp.insertionPoint;
                this.draggingColumn = tp.draggingColumn;
+               this.topLeftCorner = new Point(tp.topLeftCorner);
                this.selected = false;

                this.hiddenColumns = new 
HashSet<SQLColumn>(tp.getHiddenColumns());

Reply via email to