1 Clazz.declarePackage ("javax.swing.event");
2 Clazz.load (["java.util.EventObject"], "javax.swing.event.TreeSelectionEvent", ["java.lang.IllegalArgumentException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
6 this.oldLeadSelectionPath = null;
7 this.newLeadSelectionPath = null;
8 Clazz.instantialize (this, arguments);
9 }, javax.swing.event, "TreeSelectionEvent", java.util.EventObject);
10 Clazz.makeConstructor (c$,
11 function (source, paths, areNew, oldLeadSelectionPath, newLeadSelectionPath) {
12 Clazz.superConstructor (this, javax.swing.event.TreeSelectionEvent, [source]);
15 this.oldLeadSelectionPath = oldLeadSelectionPath;
16 this.newLeadSelectionPath = newLeadSelectionPath;
17 }, "~O,~A,~A,javax.swing.tree.TreePath,javax.swing.tree.TreePath");
18 Clazz.makeConstructor (c$,
19 function (source, path, isNew, oldLeadSelectionPath, newLeadSelectionPath) {
20 Clazz.superConstructor (this, javax.swing.event.TreeSelectionEvent, [source]);
21 this.paths = new Array (1);
23 this.areNew = Clazz.newBooleanArray (1, false);
24 this.areNew[0] = isNew;
25 this.oldLeadSelectionPath = oldLeadSelectionPath;
26 this.newLeadSelectionPath = newLeadSelectionPath;
27 }, "~O,javax.swing.tree.TreePath,~B,javax.swing.tree.TreePath,javax.swing.tree.TreePath");
28 Clazz.defineMethod (c$, "getPaths",
32 numPaths = this.paths.length;
33 retPaths = new Array (numPaths);
34 System.arraycopy (this.paths, 0, retPaths, 0, numPaths);
37 Clazz.defineMethod (c$, "getPath",
41 Clazz.defineMethod (c$, "isAddedPath",
43 return this.areNew[0];
45 Clazz.defineMethod (c$, "isAddedPath",
47 for (var counter = this.paths.length - 1; counter >= 0; counter--) if (this.paths[counter].equals (path)) return this.areNew[counter];
49 throw new IllegalArgumentException ("path is not a path identified by the TreeSelectionEvent");
50 }, "javax.swing.tree.TreePath");
51 Clazz.defineMethod (c$, "isAddedPath",
53 if (this.paths == null || index < 0 || index >= this.paths.length) {
54 throw new IllegalArgumentException ("index is beyond range of added paths identified by TreeSelectionEvent");
55 }return this.areNew[index];
57 Clazz.defineMethod (c$, "getOldLeadSelectionPath",
59 return this.oldLeadSelectionPath;
61 Clazz.defineMethod (c$, "getNewLeadSelectionPath",
63 return this.newLeadSelectionPath;
65 Clazz.defineMethod (c$, "cloneWithSource",
66 function (newSource) {
67 return new javax.swing.event.TreeSelectionEvent (newSource, this.paths, this.areNew, this.oldLeadSelectionPath, this.newLeadSelectionPath);