Revision: 3914
Author: [email protected]
Date: Mon Aug 23 12:24:08 2010
Log: Accidentally recreated a bug that I fixed before. Wrapped dragging
tables in transactions.
http://code.google.com/p/power-architect/source/detail?r=3914
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Mon Aug
16 11:37:28 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Mon Aug
23 12:24:08 2010
@@ -2635,6 +2635,9 @@
pp.addMouseMotionListener(this);
pp.addMouseListener(this); // the click that ends this
operation
+
+ pp.getContentPane().begin("Dragging " + this);
+ pp.startCompoundEdit("Dragging " + this);
pp.cursorManager.tableDragStarted();
}
@@ -2687,6 +2690,9 @@
// of this compound edit, refer to bug 1592.
pp.normalize();
pp.revalidate();
+
+ pp.endCompoundEdit("Done moving " + ppc);
+ pp.getContentPane().commit("Done moving " + ppc);
}
protected void cleanup() {
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java
Mon Aug 16 11:37:28 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenComponent.java
Mon Aug 23 12:24:08 2010
@@ -672,17 +672,19 @@
getPlayPen().endCompoundEdit("Done dragging " + this);
getParent().commit("Done dragging " + this);
} else {
- getPlayPen().endCompoundEdit("Update received while
dragging.");
- getParent().rollback("Update received while dragging");
-
// We need to cleanup all of the
FloatingContainerPaneListeners
// on the PlayPen because we no longer want to keep track
// of dragging.
for (MouseMotionListener l :
getPlayPen().getMouseMotionListeners()) {
if (l instanceof FloatingContainerPaneListener) {
((FloatingContainerPaneListener) l).cleanup();
+ getPlayPen().endCompoundEdit("Update received
while dragging.");
+ getParent().rollback("Update received while
dragging.");
}
}
+
+ getPlayPen().endCompoundEdit("Update received while
dragging.");
+ getParent().rollback("Update received while dragging");
JOptionPane.showMessageDialog(getPlayPen(), "There was an
update while you were dragging");
}