57b3a2814a04928d748640f1232845c46128fcc5
[jalviewjs.git] / site / swingjs / j2s / javax / swing / event / TreeModelEvent.js
1 Clazz.declarePackage ("javax.swing.event");
2 Clazz.load (["java.util.EventObject"], "javax.swing.event.TreeModelEvent", ["java.lang.StringBuffer", "javax.swing.tree.TreePath"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.path = null;
5 this.childIndices = null;
6 this.children = null;
7 Clazz.instantialize (this, arguments);
8 }, javax.swing.event, "TreeModelEvent", java.util.EventObject);
9 Clazz.makeConstructor (c$, 
10 function (source, path, childIndices, children) {
11 this.construct (source,  new javax.swing.tree.TreePath (path), childIndices, children);
12 }, "~O,~A,~A,~A");
13 Clazz.makeConstructor (c$, 
14 function (source, path, childIndices, children) {
15 Clazz.superConstructor (this, javax.swing.event.TreeModelEvent, [source]);
16 this.path = path;
17 this.childIndices = childIndices;
18 this.children = children;
19 }, "~O,javax.swing.tree.TreePath,~A,~A");
20 Clazz.makeConstructor (c$, 
21 function (source, path) {
22 this.construct (source,  new javax.swing.tree.TreePath (path));
23 }, "~O,~A");
24 Clazz.makeConstructor (c$, 
25 function (source, path) {
26 Clazz.superConstructor (this, javax.swing.event.TreeModelEvent, [source]);
27 this.path = path;
28 this.childIndices =  Clazz.newIntArray (0, 0);
29 }, "~O,javax.swing.tree.TreePath");
30 Clazz.defineMethod (c$, "getTreePath", 
31 function () {
32 return this.path;
33 });
34 Clazz.defineMethod (c$, "getPath", 
35 function () {
36 if (this.path != null) return this.path.getPath ();
37 return null;
38 });
39 Clazz.defineMethod (c$, "getChildren", 
40 function () {
41 if (this.children != null) {
42 var cCount = this.children.length;
43 var retChildren =  new Array (cCount);
44 System.arraycopy (this.children, 0, retChildren, 0, cCount);
45 return retChildren;
46 }return null;
47 });
48 Clazz.defineMethod (c$, "getChildIndices", 
49 function () {
50 if (this.childIndices != null) {
51 var cCount = this.childIndices.length;
52 var retArray =  Clazz.newIntArray (cCount, 0);
53 System.arraycopy (this.childIndices, 0, retArray, 0, cCount);
54 return retArray;
55 }return null;
56 });
57 Clazz.overrideMethod (c$, "toString", 
58 function () {
59 var retBuffer =  new StringBuffer ();
60 retBuffer.append (this.getClass ().getName () + " " + Integer.toString (this.hashCode ()));
61 if (this.path != null) retBuffer.append (" path " + this.path);
62 if (this.childIndices != null) {
63 retBuffer.append (" indices [ ");
64 for (var counter = 0; counter < this.childIndices.length; counter++) retBuffer.append (Integer.toString (this.childIndices[counter]) + " ");
65
66 retBuffer.append ("]");
67 }if (this.children != null) {
68 retBuffer.append (" children [ ");
69 for (var counter = 0; counter < this.children.length; counter++) retBuffer.append (this.children[counter] + " ");
70
71 retBuffer.append ("]");
72 }return retBuffer.toString ();
73 });
74 });