fff9305bd48f93c303777ed076870ef905b27d7b
[jalviewjs.git] / site / swingjs / j2s / javax / swing / ComponentInputMap.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.InputMap"], "javax.swing.ComponentInputMap", ["java.lang.IllegalArgumentException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.component = null;
5 Clazz.instantialize (this, arguments);
6 }, javax.swing, "ComponentInputMap", javax.swing.InputMap);
7 Clazz.makeConstructor (c$, 
8 function (component) {
9 Clazz.superConstructor (this, javax.swing.ComponentInputMap, []);
10 this.component = component;
11 if (component == null) {
12 throw  new IllegalArgumentException ("ComponentInputMaps must be associated with a non-null JComponent");
13 }}, "javax.swing.JComponent");
14 Clazz.defineMethod (c$, "setParent", 
15 function (map) {
16 if (this.getParent () === map) {
17 return;
18 }if (map != null && (!(Clazz.instanceOf (map, javax.swing.ComponentInputMap)) || (map).getComponent () !== this.getComponent ())) {
19 throw  new IllegalArgumentException ("ComponentInputMaps must have a parent ComponentInputMap associated with the same component");
20 }Clazz.superCall (this, javax.swing.ComponentInputMap, "setParent", [map]);
21 this.getComponent ().componentInputMapChanged (this);
22 }, "javax.swing.InputMap");
23 Clazz.defineMethod (c$, "getComponent", 
24 function () {
25 return this.component;
26 });
27 Clazz.defineMethod (c$, "put", 
28 function (keyStroke, actionMapKey) {
29 Clazz.superCall (this, javax.swing.ComponentInputMap, "put", [keyStroke, actionMapKey]);
30 if (this.getComponent () != null) {
31 this.getComponent ().componentInputMapChanged (this);
32 }}, "javax.swing.KeyStroke,~O");
33 Clazz.defineMethod (c$, "remove", 
34 function (key) {
35 Clazz.superCall (this, javax.swing.ComponentInputMap, "remove", [key]);
36 if (this.getComponent () != null) {
37 this.getComponent ().componentInputMapChanged (this);
38 }}, "javax.swing.KeyStroke");
39 Clazz.defineMethod (c$, "clear", 
40 function () {
41 var oldSize = this.size ();
42 Clazz.superCall (this, javax.swing.ComponentInputMap, "clear", []);
43 if (oldSize > 0 && this.getComponent () != null) {
44 this.getComponent ().componentInputMapChanged (this);
45 }});
46 });