diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
commit | 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/javax/swing/ComponentInputMap.java | |
parent | 7e55c49d7d91ef9f09e93c1100119b1ab3652446 (diff) | |
download | ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.tar.gz ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.zip |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/ComponentInputMap.java')
-rw-r--r-- | libjava/classpath/javax/swing/ComponentInputMap.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libjava/classpath/javax/swing/ComponentInputMap.java b/libjava/classpath/javax/swing/ComponentInputMap.java index f95c3104535..28aa8e22cf6 100644 --- a/libjava/classpath/javax/swing/ComponentInputMap.java +++ b/libjava/classpath/javax/swing/ComponentInputMap.java @@ -78,7 +78,8 @@ public class ComponentInputMap extends InputMap public void put(KeyStroke keystroke, Object value) { super.put(keystroke, value); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -87,7 +88,8 @@ public class ComponentInputMap extends InputMap public void clear() { super.clear(); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -98,7 +100,8 @@ public class ComponentInputMap extends InputMap public void remove(KeyStroke keystroke) { super.remove(keystroke); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -111,14 +114,19 @@ public class ComponentInputMap extends InputMap */ public void setParent(InputMap parentMap) { - if (! (parentMap instanceof ComponentInputMap)) - throw new IllegalArgumentException(); - - if (((ComponentInputMap) parentMap).getComponent() != component) - throw new IllegalArgumentException(); + if (parentMap != null && !(parentMap instanceof ComponentInputMap)) + throw new IllegalArgumentException("ComponentInputMaps can only have " + + "ComponentInputMaps for parents"); + + if (parentMap != null && + ((ComponentInputMap) parentMap).getComponent() != component) + throw new + IllegalArgumentException("ComponentInputMaps' parents must " + + "be associated with the same JComponents"); super.setParent(parentMap); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** |