1 Clazz.declarePackage ("javajs.awt");
\r
2 Clazz.load (["javajs.awt.Component"], "javajs.awt.Container", ["javajs.util.Lst"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
6 Clazz.instantialize (this, arguments);
\r
7 }, javajs.awt, "Container", javajs.awt.Component);
\r
8 Clazz.defineMethod (c$, "getComponent",
\r
10 return this.list.get (i);
\r
12 Clazz.defineMethod (c$, "getComponentCount",
\r
14 return (this.list == null ? 0 : this.list.size ());
\r
16 Clazz.defineMethod (c$, "getComponents",
\r
18 if (this.cList == null) {
\r
19 if (this.list == null) return new Array (0);
\r
20 this.cList = this.list.toArray ();
\r
23 Clazz.defineMethod (c$, "add",
\r
24 function (component) {
\r
25 return this.addComponent (component);
\r
26 }, "javajs.awt.Component");
\r
27 Clazz.defineMethod (c$, "addComponent",
\r
28 function (component) {
\r
29 if (this.list == null) this.list = new javajs.util.Lst ();
\r
30 this.list.addLast (component);
\r
32 component.parent = this;
\r
34 }, "javajs.awt.Component");
\r
35 Clazz.defineMethod (c$, "insertComponent",
\r
36 function (component, index) {
\r
37 if (this.list == null) return this.addComponent (component);
\r
38 this.list.add (index, component);
\r
40 component.parent = this;
\r
42 }, "javajs.awt.Component,~N");
\r
43 Clazz.defineMethod (c$, "remove",
\r
45 var c = this.list.remove (i);
\r
49 Clazz.defineMethod (c$, "removeAll",
\r
51 if (this.list != null) {
\r
52 for (var i = this.list.size (); --i >= 0; ) this.list.get (i).parent = null;
\r
57 Clazz.defineMethod (c$, "getSubcomponentWidth",
\r
59 return (this.list != null && this.list.size () == 1 ? this.list.get (0).getSubcomponentWidth () : 0);
\r
61 Clazz.defineMethod (c$, "getSubcomponentHeight",
\r
63 return (this.list != null && this.list.size () == 1 ? this.list.get (0).getSubcomponentHeight () : 0);
\r