diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
commit | 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede (patch) | |
tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/java/awt/GridBagLayout.java | |
parent | a3ef37ddfeddcc5b0f1c5068d8fdeb25a302d5cd (diff) | |
download | ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.tar.gz ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.zip |
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/awt/GridBagLayout.java')
-rw-r--r-- | libjava/classpath/java/awt/GridBagLayout.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libjava/classpath/java/awt/GridBagLayout.java b/libjava/classpath/java/awt/GridBagLayout.java index 083c0b7a7a3..714e080d7b2 100644 --- a/libjava/classpath/java/awt/GridBagLayout.java +++ b/libjava/classpath/java/awt/GridBagLayout.java @@ -341,11 +341,14 @@ public class GridBagLayout GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE); if (info.cols == 0 && info.rows == 0) return; - layoutInfo = info; // DEBUG - //dumpLayoutInfo (layoutInfo); - + //dumpLayoutInfo (info); + + // Calling setBounds on these components causes this layout to + // be invalidated, clearing the layout information cache, + // layoutInfo. So we wait until after this for loop to set + // layoutInfo. for(int i = 0; i < components.length; i++) { Component component = components [i]; @@ -357,11 +360,11 @@ public class GridBagLayout GridBagConstraints constraints = lookupInternalConstraints(component); - int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx); - int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy); - int cellw = sumIntArray(layoutInfo.colWidths, + int cellx = sumIntArray(info.colWidths, constraints.gridx); + int celly = sumIntArray(info.rowHeights, constraints.gridy); + int cellw = sumIntArray(info.colWidths, constraints.gridx + constraints.gridwidth) - cellx; - int cellh = sumIntArray(layoutInfo.rowHeights, + int cellh = sumIntArray(info.rowHeights, constraints.gridy + constraints.gridheight) - celly; Insets insets = constraints.insets; @@ -438,11 +441,14 @@ public class GridBagLayout break; } - component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height); + component.setBounds(info.pos_x + x, info.pos_y + y, dim.width, dim.height); } // DEBUG - //dumpLayoutInfo (layoutInfo); + //dumpLayoutInfo (info); + + // Cache layout information. + layoutInfo = getLayoutInfo (parent, PREFERREDSIZE); } /** |