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