Revision: 3243
Author: [email protected]
Date: Mon Jan 25 09:01:33 2010
Log: NEW - bug 2708: Multiple problems with SQLRelationship
http://trillian.sqlpower.ca/bugzilla/show_bug.cgi?id=2708
There are several changes in this commit that got tied together:
-The SQLRelationship is now more tightly connected to its SQLImportedKey.
Previously the imported key could be
disconnected from its relationship adding complexity when the two ends of
the relationship floated apart.
-The ArchitectPropertyChangeUndoableEdit is back in the form of
SPObjectPropertyChangeEdit. This is required as magic
needs to be disabled on undo and redo which the other generic undo event
does not handle.
-The SPClassVisitor has been updated to only consider constructors in the
class being walked through. Previously it was
able to consider the constructor of inner classes as valid constructors of
the outer class.
http://code.google.com/p/power-architect/source/detail?r=3243
Modified:
/trunk/regress/ca/sqlpower/architect/swingui/ArchitectSwingSessionImplTest.java
/trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
/trunk/src/ca/sqlpower/architect/swingui/IndexColumnTable.java
/trunk/src/ca/sqlpower/architect/swingui/Navigator.java
/trunk/src/ca/sqlpower/architect/swingui/PlayPen.java
/trunk/src/ca/sqlpower/architect/swingui/Relationship.java
/trunk/src/ca/sqlpower/architect/swingui/TableEditPanel.java
/trunk/src/ca/sqlpower/architect/swingui/TablePane.java
/trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
=======================================
---
/trunk/regress/ca/sqlpower/architect/swingui/ArchitectSwingSessionImplTest.java
Fri Jan 15 15:02:04 2010
+++
/trunk/regress/ca/sqlpower/architect/swingui/ArchitectSwingSessionImplTest.java
Mon Jan 25 09:01:33 2010
@@ -183,7 +183,7 @@
assertTrue(session.isNew());
PropertyChangeEvent e = new PropertyChangeEvent(new
SQLDatabase(), "property", "old", "new");
- session.getProjectModificationWatcher().propertyChange(e);
+ session.getProjectModificationWatcher().propertyChanged(e);
assertFalse(session.isNew());
}
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
Mon Jan 18 09:19:18 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
Mon Jan 25 09:01:33 2010
@@ -24,6 +24,7 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
@@ -644,7 +645,7 @@
* <p>Note: when we implement proper undo/redo support, this class
should
* be replaced with a hook into that system.
*/
- class ProjectModificationWatcher implements SPListener {
+ class ProjectModificationWatcher implements SPListener,
PropertyChangeListener {
/**
* Sets up a new modification watcher on the given playpen.
@@ -670,7 +671,7 @@
}
/** Marks project dirty. */
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
getProjectLoader().setModified(true);
isNew = false;
}
@@ -686,6 +687,14 @@
public void transactionStarted(TransactionEvent e) {
//no-op
}
+
+ /**
+ * Marks the project dirty
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ getProjectLoader().setModified(true);
+ isNew = false;
+ }
}
/**
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/IndexColumnTable.java Mon Dec
21 08:27:43 2009
+++ /trunk/src/ca/sqlpower/architect/swingui/IndexColumnTable.java Mon Jan
25 09:01:33 2010
@@ -339,7 +339,7 @@
fireTableDataChanged();
}
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
// no-op
}
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/Navigator.java Mon Dec 21
08:27:43 2009
+++ /trunk/src/ca/sqlpower/architect/swingui/Navigator.java Mon Jan 25
09:01:33 2010
@@ -32,6 +32,7 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import javax.swing.JDialog;
import javax.swing.JPanel;
@@ -50,7 +51,7 @@
* @author kaiyi
*
*/
-public class Navigator extends JDialog implements SPListener,
AdjustmentListener {
+public class Navigator extends JDialog implements SPListener,
AdjustmentListener, PropertyChangeListener {
private static final int SCALED_IMAGE_WIDTH = 200;
@@ -193,10 +194,14 @@
/**
* Refreshes the navigator upon a visible property change
*/
- public void propertyChange(PropertyChangeEvent evt) {
+ public void propertyChanged(PropertyChangeEvent evt) {
navigationPanel.repaint();
}
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ navigationPanel.repaint();
+ }
/**
* Refreshes the navigator upon the addition of a new PlaypenComponent
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/PlayPen.java Thu Jan 21
12:13:16 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/PlayPen.java Mon Jan 25
09:01:33 2010
@@ -1738,7 +1738,7 @@
* this widget, we will notify all change listeners (the UI
* delegate) with a ChangeEvent.
*/
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
firePropertyChange("model."+e.getPropertyName(), null, null);
//$NON-NLS-1$
}
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/Relationship.java Mon Dec 21
08:27:43 2009
+++ /trunk/src/ca/sqlpower/architect/swingui/Relationship.java Mon Jan 25
09:01:33 2010
@@ -467,7 +467,7 @@
}
}
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
if (e.getPropertyName() != null) {
if (e.getPropertyName().equals("name")) { //$NON-NLS-1$
setToolTipText(model.getName());
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/TableEditPanel.java Mon Dec 21
08:27:43 2009
+++ /trunk/src/ca/sqlpower/architect/swingui/TableEditPanel.java Mon Jan 25
09:01:33 2010
@@ -267,7 +267,7 @@
}
}
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
// no-op
}
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/TablePane.java Mon Jan 11
08:44:09 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/TablePane.java Mon Jan 25
09:01:33 2010
@@ -304,7 +304,7 @@
* this widget, we will notify all change listeners (the UI
* delegate) with a ChangeEvent.
*/
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
if (logger.isDebugEnabled()) {
logger.debug("TablePane got object changed event." +
//$NON-NLS-1$
" Source="+e.getSource()+"
Property="+e.getPropertyName()+ //$NON-NLS-1$ //$NON-NLS-2$
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Thu
Jan 14 12:35:46 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java Mon
Jan 25 09:01:33 2010
@@ -239,7 +239,7 @@
//do nothing
}
- public void propertyChange(PropertyChangeEvent e) {
+ public void propertyChanged(PropertyChangeEvent e) {
logger.debug("dbObjectChanged. source="+e.getSource());
//$NON-NLS-1$
if ((!SwingUtilities.isEventDispatchThread()) &&
(!refireOnAnyThread)) {
logger.debug("Not refiring because this is not the EDT.
You will need to call refreshTreeStructure() at some point in the
future."); //$NON-NLS-1$