aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/JRootPane.java
diff options
context:
space:
mode:
authorMark Wielaard <mark@gcc.gnu.org>2006-03-10 21:46:48 +0000
committerMark Wielaard <mark@gcc.gnu.org>2006-03-10 21:46:48 +0000
commit8aa540d2f783474d1d2e06f16744bf67b9c1facc (patch)
treeea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/javax/swing/JRootPane.java
parent27079765d00123f8e53d0e1ef7f9d46559266e6d (diff)
downloadgcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.zip
gcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.tar.gz
gcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.tar.bz2
Imported GNU Classpath 0.90
Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r111942
Diffstat (limited to 'libjava/classpath/javax/swing/JRootPane.java')
-rw-r--r--libjava/classpath/javax/swing/JRootPane.java58
1 files changed, 29 insertions, 29 deletions
diff --git a/libjava/classpath/javax/swing/JRootPane.java b/libjava/classpath/javax/swing/JRootPane.java
index dea4ee4..dec4395 100644
--- a/libjava/classpath/javax/swing/JRootPane.java
+++ b/libjava/classpath/javax/swing/JRootPane.java
@@ -120,11 +120,6 @@ public class JRootPane extends JComponent implements Accessible
private Rectangle menuBarBounds;
/**
- * The cached preferred size.
- */
- private Dimension prefSize;
-
- /**
* Creates a new <code>RootLayout</code> object.
*/
protected RootLayout()
@@ -191,7 +186,6 @@ public class JRootPane extends JComponent implements Accessible
layeredPaneBounds = null;
contentPaneBounds = null;
menuBarBounds = null;
- prefSize = null;
}
}
@@ -251,7 +245,7 @@ public class JRootPane extends JComponent implements Accessible
layeredPane.setBounds(layeredPaneBounds);
if (menuBar != null)
menuBar.setBounds(menuBarBounds);
- contentPane.setBounds(contentPaneBounds);
+ getContentPane().setBounds(contentPaneBounds);
}
/**
@@ -287,29 +281,20 @@ public class JRootPane extends JComponent implements Accessible
*/
public Dimension preferredLayoutSize(Container c)
{
- // We must synchronize here, otherwise we cannot guarantee that the
- // prefSize is still non-null when returning.
- synchronized (this)
+ Dimension prefSize = new Dimension();
+ Insets i = getInsets();
+ prefSize = new Dimension(i.left + i.right, i.top + i.bottom);
+ Dimension contentPrefSize = getContentPane().getPreferredSize();
+ prefSize.width += contentPrefSize.width;
+ prefSize.height += contentPrefSize.height;
+ if (menuBar != null)
{
- if (prefSize == null)
- {
- Insets i = getInsets();
- prefSize = new Dimension(i.left + i.right, i.top + i.bottom);
- Dimension contentPrefSize = contentPane.getPreferredSize();
- prefSize.width += contentPrefSize.width;
- prefSize.height += contentPrefSize.height;
- if (menuBar != null)
- {
- Dimension menuBarSize = menuBar.getPreferredSize();
- if (menuBarSize.width > contentPrefSize.width)
- prefSize.width += menuBarSize.width - contentPrefSize.width;
- prefSize.height += menuBarSize.height;
- }
- }
- // Return a copy here so the cached value won't get trashed by some
- // other component.
- return new Dimension(prefSize);
- }
+ Dimension menuBarSize = menuBar.getPreferredSize();
+ if (menuBarSize.width > contentPrefSize.width)
+ prefSize.width += menuBarSize.width - contentPrefSize.width;
+ prefSize.height += menuBarSize.height;
+ }
+ return prefSize;
}
/**
@@ -541,6 +526,7 @@ public class JRootPane extends JComponent implements Accessible
getGlassPane();
getLayeredPane();
getContentPane();
+ setOpaque(true);
updateUI();
}
@@ -674,4 +660,18 @@ public class JRootPane extends JComponent implements Accessible
windowDecorationStyle = style;
firePropertyChange("windowDecorationStyle", oldStyle, style);
}
+
+ /**
+ * This returns <code>true</code> if the <code>glassPane</code> is not
+ * visible because then the root pane can guarantee to tile its children
+ * (the only other direct child is a JLayeredPane which must figure its
+ * <code>optimizeDrawingEnabled</code> state on its own).
+ *
+ * @return <code>true</code> if the <code>glassPane</code> is not
+ * visible
+ */
+ public boolean isOptimizedDrawingEnable()
+ {
+ return ! glassPane.isVisible();
+ }
}