Author: [EMAIL PROTECTED]
Date: Fri Sep 5 12:45:46 2008
New Revision: 2698
Modified:
trunk/src/ca/sqlpower/architect/swingui/PlayPen.java
Log:
Changed normalizing method so that all playpen components cannot be dragged
offscreen.
Modified: trunk/src/ca/sqlpower/architect/swingui/PlayPen.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/PlayPen.java (original)
+++ trunk/src/ca/sqlpower/architect/swingui/PlayPen.java Fri Sep 5
12:45:46 2008
@@ -901,16 +901,17 @@
normalizing=true;
int minX = 0;
int minY = 0;
- for (TablePane tp : getTablePanes()) {
- minX = Math.min(minX, tp.getX());
- minY = Math.min(minY, tp.getY());
- }
+
+ for (PlayPenComponent ppc : getPlayPenComponents()) {
+ minX = Math.min(minX, ppc.getX());
+ minY = Math.min(minY, ppc.getY());
+ }
//Readjusts the table pane, since minX and min <= 0,
//the adjustments of subtracting minX and/or minY makes sense.
- if ( minX < 0 || minY < 0 ) {
- for (TablePane tp : getTablePanes()) {
- tp.setLocation(tp.getX()-minX, tp.getY()-minY);
+ if ( minX < 0 || minY < 0 ) {
+ for (PlayPenComponent ppc : getPlayPenComponents()) {
+ ppc.setLocation(ppc.getX()-minX, ppc.getY()-minY);
}
// This function may have expanded the playpen's minimum