summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/awt/CardLayout.java
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-10 21:46:48 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-10 21:46:48 +0000
commitce57ab760f69de6db452def7ffbf5b114a2d8694 (patch)
treeea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/java/awt/CardLayout.java
parent50996fe55769882de3f410896032c887f0ff0d04 (diff)
downloadppe42-gcc-ce57ab760f69de6db452def7ffbf5b114a2d8694.tar.gz
ppe42-gcc-ce57ab760f69de6db452def7ffbf5b114a2d8694.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/awt/CardLayout.java')
-rw-r--r--libjava/classpath/java/awt/CardLayout.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/libjava/classpath/java/awt/CardLayout.java b/libjava/classpath/java/awt/CardLayout.java
index 8582c5f099b..8b3fea2ca23 100644
--- a/libjava/classpath/java/awt/CardLayout.java
+++ b/libjava/classpath/java/awt/CardLayout.java
@@ -117,7 +117,7 @@ public class CardLayout implements LayoutManager2, Serializable
/**
* Cause the first component in the container to be displayed.
*
- * @param parent The parent container
+ * @param parent The parent container, not <code>null</code>.
*/
public void first (Container parent)
{
@@ -181,7 +181,7 @@ public class CardLayout implements LayoutManager2, Serializable
/**
* Cause the last component in the container to be displayed.
*
- * @param parent The parent container
+ * @param parent The parent container, not <code>null</code>.
*/
public void last (Container parent)
{
@@ -247,7 +247,7 @@ public class CardLayout implements LayoutManager2, Serializable
* this current card is the last one in the deck, the first
* component is displayed.
*
- * @param parent The parent container
+ * @param parent The parent container, not <code>null</code>.
*/
public void next (Container parent)
{
@@ -271,7 +271,7 @@ public class CardLayout implements LayoutManager2, Serializable
* If this current card is the first one in the deck, the last
* component is displayed.
*
- * @param parent The parent container
+ * @param parent The parent container, not <code>null</code>.
*/
public void previous (Container parent)
{
@@ -321,13 +321,19 @@ public class CardLayout implements LayoutManager2, Serializable
/**
* Cause the named component to be shown. If the component name is
- * unknown, this method does nothing.
+ * unknown or <code>null</code>, this method does nothing.
*
- * @param parent The parent container
- * @param name The name of the component to show
+ * @param parent The parent container, not <code>null</code>.
+ * @param name The name of the component to show
*/
public void show (Container parent, String name)
{
+ if (name == null)
+ return;
+
+ if (parent.getLayout() != this)
+ throw new IllegalArgumentException("parent's layout is not this CardLayout");
+
Object target = tab.get (name);
if (target != null)
{
@@ -362,9 +368,15 @@ public class CardLayout implements LayoutManager2, Serializable
*
* @param parent The parent container
* @param what The type of goto: FIRST, LAST, NEXT or PREV
+ *
+ * @throws IllegalArgumentException if parent has not this
+ * CardLayout set as its layout.
*/
private void gotoComponent (Container parent, int what)
{
+ if (parent.getLayout() != this)
+ throw new IllegalArgumentException("parent's layout is not this CardLayout");
+
synchronized (parent.getTreeLock ())
{
int num = parent.ncomponents;
OpenPOWER on IntegriCloud