Revision: 3578
Author: [email protected]
Date: Mon May 31 15:36:25 2010
Log: NEW - bug 2839: Missing scrollbars when opening a project on server
workspace where playpen is zoomed in
http://trillian.sqlpower.ca/bugzilla/show_bug.cgi?id=2839
Revalidating on adding and removing objects to and from the content pane as
well as on bound changes to the tables and
relationships. This allows the scroll bars to appear correctly when a user
on a different screen makes changes or the user
opens a server project.
http://code.google.com/p/power-architect/source/detail?r=3578
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenContentPane.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Thu May
27 08:31:55 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Mon May
31 15:36:25 2010
@@ -1834,6 +1834,7 @@
* delegate) with a ChangeEvent.
*/
public void propertyChanged(PropertyChangeEvent e) {
+ revalidate();
this.firePropertyChange("model."+e.getPropertyName(),
e.getOldValue(), e.getNewValue()); //$NON-NLS-1$
}
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenContentPane.java
Thu May 27 15:05:10 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenContentPane.java
Mon May 31 15:36:25 2010
@@ -97,6 +97,17 @@
e.getSource().removeSPListener(this);
}
}
+ };
+
+ private final SPListener componentBoundChanges = new
AbstractSPListener() {
+
+ @Override
+ public void propertyChanged(PropertyChangeEvent evt) {
+ if (evt.getPropertyName().equals("bounds") && playPen != null)
{
+ playPen.revalidate();
+ }
+ }
+
};
@Constructor
@@ -242,9 +253,13 @@
if (getPlayPen() != null) {
ppc.addSelectionListener(getPlayPen());
}
+ ppc.addSPListener(componentBoundChanges);
ppc.connect();
fireChildAdded(ppc.getClass(), ppc, pos);
ppc.revalidate();
+ if (playPen != null) {
+ playPen.revalidate();
+ }
}
@Override
@@ -262,6 +277,7 @@
if (getPlayPen() != null) {
((PlayPenComponent)
child).removeSelectionListener(getPlayPen());
}
+ child.removeSPListener(componentBoundChanges);
if (playPen != null) {
playPen.repaint();
}