75564ffd64d407c913f4f40d7cca11146f220fa0
[jalviewjs.git] / site / j2s / javax / swing / tree / DefaultMutableTreeNode.js
1 Clazz.declarePackage ("javax.swing.tree");
2 Clazz.load (["java.util.Enumeration", "javax.swing.tree.MutableTreeNode", "java.util.NoSuchElementException"], "javax.swing.tree.DefaultMutableTreeNode", ["java.lang.ArrayIndexOutOfBoundsException", "$.Error", "$.IllegalArgumentException", "$.IllegalStateException", "java.util.Stack", "$.Vector"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.parent = null;
5 this.$children = null;
6 this.userObject = null;
7 this.allowsChildren = false;
8 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.PreorderEnumeration")) {
9 javax.swing.tree.DefaultMutableTreeNode.$DefaultMutableTreeNode$PreorderEnumeration$ ();
10 }
11 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.PostorderEnumeration")) {
12 javax.swing.tree.DefaultMutableTreeNode.$DefaultMutableTreeNode$PostorderEnumeration$ ();
13 }
14 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration")) {
15 javax.swing.tree.DefaultMutableTreeNode.$DefaultMutableTreeNode$BreadthFirstEnumeration$ ();
16 }
17 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.PathBetweenNodesEnumeration")) {
18 javax.swing.tree.DefaultMutableTreeNode.$DefaultMutableTreeNode$PathBetweenNodesEnumeration$ ();
19 }
20 Clazz.instantialize (this, arguments);
21 }, javax.swing.tree, "DefaultMutableTreeNode", null, [Cloneable, javax.swing.tree.MutableTreeNode]);
22 Clazz.makeConstructor (c$, 
23 function () {
24 this.construct (null);
25 });
26 Clazz.makeConstructor (c$, 
27 function (userObject) {
28 this.construct (userObject, true);
29 }, "~O");
30 Clazz.makeConstructor (c$, 
31 function (userObject, allowsChildren) {
32 this.parent = null;
33 this.allowsChildren = allowsChildren;
34 this.userObject = userObject;
35 }, "~O,~B");
36 Clazz.overrideMethod (c$, "insert", 
37 function (newChild, childIndex) {
38 if (!this.allowsChildren) {
39 throw  new IllegalStateException ("node does not allow children");
40 } else if (newChild == null) {
41 throw  new IllegalArgumentException ("new child is null");
42 } else if (this.isNodeAncestor (newChild)) {
43 throw  new IllegalArgumentException ("new child is an ancestor");
44 }var oldParent = newChild.getParent ();
45 if (oldParent != null) {
46 oldParent.remove (newChild);
47 }newChild.setParent (this);
48 if (this.$children == null) {
49 this.$children =  new java.util.Vector ();
50 }this.$children.insertElementAt (newChild, childIndex);
51 }, "javax.swing.tree.MutableTreeNode,~N");
52 Clazz.defineMethod (c$, "remove", 
53 function (childIndex) {
54 var child = this.getChildAt (childIndex);
55 this.$children.removeElementAt (childIndex);
56 child.setParent (null);
57 }, "~N");
58 Clazz.defineMethod (c$, "setParent", 
59 function (newParent) {
60 this.parent = newParent;
61 }, "javax.swing.tree.MutableTreeNode");
62 Clazz.defineMethod (c$, "getParent", 
63 function () {
64 return this.parent;
65 });
66 Clazz.overrideMethod (c$, "getChildAt", 
67 function (index) {
68 if (this.$children == null) {
69 throw  new ArrayIndexOutOfBoundsException ("node has no children");
70 }return this.$children.elementAt (index);
71 }, "~N");
72 Clazz.defineMethod (c$, "getChildCount", 
73 function () {
74 if (this.$children == null) {
75 return 0;
76 } else {
77 return this.$children.size ();
78 }});
79 Clazz.overrideMethod (c$, "getIndex", 
80 function (aChild) {
81 if (aChild == null) {
82 throw  new IllegalArgumentException ("argument is null");
83 }if (!this.isNodeChild (aChild)) {
84 return -1;
85 }return this.$children.indexOf (aChild);
86 }, "javax.swing.tree.TreeNode");
87 Clazz.defineMethod (c$, "children", 
88 function () {
89 if (this.$children == null) {
90 return javax.swing.tree.DefaultMutableTreeNode.EMPTY_ENUMERATION;
91 } else {
92 return this.$children.elements ();
93 }});
94 Clazz.defineMethod (c$, "setAllowsChildren", 
95 function (allows) {
96 if (allows != this.allowsChildren) {
97 this.allowsChildren = allows;
98 if (!this.allowsChildren) {
99 this.removeAllChildren ();
100 }}}, "~B");
101 Clazz.overrideMethod (c$, "getAllowsChildren", 
102 function () {
103 return this.allowsChildren;
104 });
105 Clazz.overrideMethod (c$, "setUserObject", 
106 function (userObject) {
107 this.userObject = userObject;
108 }, "~O");
109 Clazz.defineMethod (c$, "getUserObject", 
110 function () {
111 return this.userObject;
112 });
113 Clazz.overrideMethod (c$, "removeFromParent", 
114 function () {
115 var parent = this.getParent ();
116 if (parent != null) {
117 parent.remove (this);
118 }});
119 Clazz.defineMethod (c$, "remove", 
120 function (aChild) {
121 if (aChild == null) {
122 throw  new IllegalArgumentException ("argument is null");
123 }if (!this.isNodeChild (aChild)) {
124 throw  new IllegalArgumentException ("argument is not a child");
125 }this.remove (this.getIndex (aChild));
126 }, "javax.swing.tree.MutableTreeNode");
127 Clazz.defineMethod (c$, "removeAllChildren", 
128 function () {
129 for (var i = this.getChildCount () - 1; i >= 0; i--) {
130 this.remove (i);
131 }
132 });
133 Clazz.defineMethod (c$, "add", 
134 function (newChild) {
135 if (newChild != null && newChild.getParent () === this) this.insert (newChild, this.getChildCount () - 1);
136  else this.insert (newChild, this.getChildCount ());
137 }, "javax.swing.tree.MutableTreeNode");
138 Clazz.defineMethod (c$, "isNodeAncestor", 
139 function (anotherNode) {
140 if (anotherNode == null) {
141 return false;
142 }var ancestor = this;
143 do {
144 if (ancestor === anotherNode) {
145 return true;
146 }} while ((ancestor = ancestor.getParent ()) != null);
147 return false;
148 }, "javax.swing.tree.TreeNode");
149 Clazz.defineMethod (c$, "isNodeDescendant", 
150 function (anotherNode) {
151 if (anotherNode == null) return false;
152 return anotherNode.isNodeAncestor (this);
153 }, "javax.swing.tree.DefaultMutableTreeNode");
154 Clazz.defineMethod (c$, "getSharedAncestor", 
155 function (aNode) {
156 if (aNode === this) {
157 return this;
158 } else if (aNode == null) {
159 return null;
160 }var level1;
161 var level2;
162 var diff;
163 var node1;
164 var node2;
165 level1 = this.getLevel ();
166 level2 = aNode.getLevel ();
167 if (level2 > level1) {
168 diff = level2 - level1;
169 node1 = aNode;
170 node2 = this;
171 } else {
172 diff = level1 - level2;
173 node1 = this;
174 node2 = aNode;
175 }while (diff > 0) {
176 node1 = node1.getParent ();
177 diff--;
178 }
179 do {
180 if (node1 === node2) {
181 return node1;
182 }node1 = node1.getParent ();
183 node2 = node2.getParent ();
184 } while (node1 != null);
185 if (node1 != null || node2 != null) {
186 throw  new Error ("nodes should be null");
187 }return null;
188 }, "javax.swing.tree.DefaultMutableTreeNode");
189 Clazz.defineMethod (c$, "isNodeRelated", 
190 function (aNode) {
191 return (aNode != null) && (this.getRoot () === aNode.getRoot ());
192 }, "javax.swing.tree.DefaultMutableTreeNode");
193 Clazz.defineMethod (c$, "getDepth", 
194 function () {
195 var last = null;
196 var enum_ = this.breadthFirstEnumeration ();
197 while (enum_.hasMoreElements ()) {
198 last = enum_.nextElement ();
199 }
200 if (last == null) {
201 throw  new Error ("nodes should be null");
202 }return (last).getLevel () - this.getLevel ();
203 });
204 Clazz.defineMethod (c$, "getLevel", 
205 function () {
206 var ancestor;
207 var levels = 0;
208 ancestor = this;
209 while ((ancestor = ancestor.getParent ()) != null) {
210 levels++;
211 }
212 return levels;
213 });
214 Clazz.defineMethod (c$, "getPath", 
215 function () {
216 return this.getPathToRoot (this, 0);
217 });
218 Clazz.defineMethod (c$, "getPathToRoot", 
219 function (aNode, depth) {
220 var retNodes;
221 if (aNode == null) {
222 if (depth == 0) return null;
223  else retNodes =  new Array (depth);
224 } else {
225 depth++;
226 retNodes = this.getPathToRoot (aNode.getParent (), depth);
227 retNodes[retNodes.length - depth] = aNode;
228 }return retNodes;
229 }, "javax.swing.tree.TreeNode,~N");
230 Clazz.defineMethod (c$, "getUserObjectPath", 
231 function () {
232 var realPath = this.getPath ();
233 var retPath =  new Array (realPath.length);
234 for (var counter = 0; counter < realPath.length; counter++) retPath[counter] = (realPath[counter]).getUserObject ();
235
236 return retPath;
237 });
238 Clazz.defineMethod (c$, "getRoot", 
239 function () {
240 var ancestor = this;
241 var previous;
242 do {
243 previous = ancestor;
244 ancestor = ancestor.getParent ();
245 } while (ancestor != null);
246 return previous;
247 });
248 Clazz.defineMethod (c$, "isRoot", 
249 function () {
250 return this.getParent () == null;
251 });
252 Clazz.defineMethod (c$, "getNextNode", 
253 function () {
254 if (this.getChildCount () == 0) {
255 var nextSibling = this.getNextSibling ();
256 if (nextSibling == null) {
257 var aNode = this.getParent ();
258 do {
259 if (aNode == null) {
260 return null;
261 }nextSibling = aNode.getNextSibling ();
262 if (nextSibling != null) {
263 return nextSibling;
264 }aNode = aNode.getParent ();
265 } while (true);
266 } else {
267 return nextSibling;
268 }} else {
269 return this.getChildAt (0);
270 }});
271 Clazz.defineMethod (c$, "getPreviousNode", 
272 function () {
273 var previousSibling;
274 var myParent = this.getParent ();
275 if (myParent == null) {
276 return null;
277 }previousSibling = this.getPreviousSibling ();
278 if (previousSibling != null) {
279 if (previousSibling.getChildCount () == 0) return previousSibling;
280  else return previousSibling.getLastLeaf ();
281 } else {
282 return myParent;
283 }});
284 Clazz.defineMethod (c$, "preorderEnumeration", 
285 function () {
286 return Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.PreorderEnumeration, this, null, this);
287 });
288 Clazz.defineMethod (c$, "postorderEnumeration", 
289 function () {
290 return Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.PostorderEnumeration, this, null, this);
291 });
292 Clazz.defineMethod (c$, "breadthFirstEnumeration", 
293 function () {
294 return Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration, this, null, this);
295 });
296 Clazz.defineMethod (c$, "depthFirstEnumeration", 
297 function () {
298 return this.postorderEnumeration ();
299 });
300 Clazz.defineMethod (c$, "pathFromAncestorEnumeration", 
301 function (ancestor) {
302 return Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.PathBetweenNodesEnumeration, this, null, ancestor, this);
303 }, "javax.swing.tree.TreeNode");
304 Clazz.defineMethod (c$, "isNodeChild", 
305 function (aNode) {
306 var retval;
307 if (aNode == null) {
308 retval = false;
309 } else {
310 if (this.getChildCount () == 0) {
311 retval = false;
312 } else {
313 retval = (aNode.getParent () === this);
314 }}return retval;
315 }, "javax.swing.tree.TreeNode");
316 Clazz.defineMethod (c$, "getFirstChild", 
317 function () {
318 if (this.getChildCount () == 0) {
319 throw  new java.util.NoSuchElementException ("node has no children");
320 }return this.getChildAt (0);
321 });
322 Clazz.defineMethod (c$, "getLastChild", 
323 function () {
324 if (this.getChildCount () == 0) {
325 throw  new java.util.NoSuchElementException ("node has no children");
326 }return this.getChildAt (this.getChildCount () - 1);
327 });
328 Clazz.defineMethod (c$, "getChildAfter", 
329 function (aChild) {
330 if (aChild == null) {
331 throw  new IllegalArgumentException ("argument is null");
332 }var index = this.getIndex (aChild);
333 if (index == -1) {
334 throw  new IllegalArgumentException ("node is not a child");
335 }if (index < this.getChildCount () - 1) {
336 return this.getChildAt (index + 1);
337 } else {
338 return null;
339 }}, "javax.swing.tree.TreeNode");
340 Clazz.defineMethod (c$, "getChildBefore", 
341 function (aChild) {
342 if (aChild == null) {
343 throw  new IllegalArgumentException ("argument is null");
344 }var index = this.getIndex (aChild);
345 if (index == -1) {
346 throw  new IllegalArgumentException ("argument is not a child");
347 }if (index > 0) {
348 return this.getChildAt (index - 1);
349 } else {
350 return null;
351 }}, "javax.swing.tree.TreeNode");
352 Clazz.defineMethod (c$, "isNodeSibling", 
353 function (anotherNode) {
354 var retval;
355 if (anotherNode == null) {
356 retval = false;
357 } else if (anotherNode === this) {
358 retval = true;
359 } else {
360 var myParent = this.getParent ();
361 retval = (myParent != null && myParent === anotherNode.getParent ());
362 if (retval && !(this.getParent ()).isNodeChild (anotherNode)) {
363 throw  new Error ("sibling has different parent");
364 }}return retval;
365 }, "javax.swing.tree.TreeNode");
366 Clazz.defineMethod (c$, "getSiblingCount", 
367 function () {
368 var myParent = this.getParent ();
369 if (myParent == null) {
370 return 1;
371 } else {
372 return myParent.getChildCount ();
373 }});
374 Clazz.defineMethod (c$, "getNextSibling", 
375 function () {
376 var retval;
377 var myParent = this.getParent ();
378 if (myParent == null) {
379 retval = null;
380 } else {
381 retval = myParent.getChildAfter (this);
382 }if (retval != null && !this.isNodeSibling (retval)) {
383 throw  new Error ("child of parent is not a sibling");
384 }return retval;
385 });
386 Clazz.defineMethod (c$, "getPreviousSibling", 
387 function () {
388 var retval;
389 var myParent = this.getParent ();
390 if (myParent == null) {
391 retval = null;
392 } else {
393 retval = myParent.getChildBefore (this);
394 }if (retval != null && !this.isNodeSibling (retval)) {
395 throw  new Error ("child of parent is not a sibling");
396 }return retval;
397 });
398 Clazz.defineMethod (c$, "isLeaf", 
399 function () {
400 return (this.getChildCount () == 0);
401 });
402 Clazz.defineMethod (c$, "getFirstLeaf", 
403 function () {
404 var node = this;
405 while (!node.isLeaf ()) {
406 node = node.getFirstChild ();
407 }
408 return node;
409 });
410 Clazz.defineMethod (c$, "getLastLeaf", 
411 function () {
412 var node = this;
413 while (!node.isLeaf ()) {
414 node = node.getLastChild ();
415 }
416 return node;
417 });
418 Clazz.defineMethod (c$, "getNextLeaf", 
419 function () {
420 var nextSibling;
421 var myParent = this.getParent ();
422 if (myParent == null) return null;
423 nextSibling = this.getNextSibling ();
424 if (nextSibling != null) return nextSibling.getFirstLeaf ();
425 return myParent.getNextLeaf ();
426 });
427 Clazz.defineMethod (c$, "getPreviousLeaf", 
428 function () {
429 var previousSibling;
430 var myParent = this.getParent ();
431 if (myParent == null) return null;
432 previousSibling = this.getPreviousSibling ();
433 if (previousSibling != null) return previousSibling.getLastLeaf ();
434 return myParent.getPreviousLeaf ();
435 });
436 Clazz.defineMethod (c$, "getLeafCount", 
437 function () {
438 var count = 0;
439 var node;
440 var enum_ = this.breadthFirstEnumeration ();
441 while (enum_.hasMoreElements ()) {
442 node = enum_.nextElement ();
443 if (node.isLeaf ()) {
444 count++;
445 }}
446 if (count < 1) {
447 throw  new Error ("tree has zero leaves");
448 }return count;
449 });
450 Clazz.defineMethod (c$, "toString", 
451 function () {
452 if (this.userObject == null) {
453 return null;
454 } else {
455 return this.userObject.toString ();
456 }});
457 Clazz.defineMethod (c$, "clone", 
458 function () {
459 var newNode = null;
460 try {
461 newNode = Clazz.superCall (this, javax.swing.tree.DefaultMutableTreeNode, "clone", []);
462 newNode.$children = null;
463 newNode.parent = null;
464 } catch (e) {
465 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
466 throw  new Error (e.toString ());
467 } else {
468 throw e;
469 }
470 }
471 return newNode;
472 });
473 c$.$DefaultMutableTreeNode$PreorderEnumeration$ = function () {
474 Clazz.pu$h(self.c$);
475 c$ = Clazz.decorateAsClass (function () {
476 Clazz.prepareCallback (this, arguments);
477 this.stack = null;
478 Clazz.instantialize (this, arguments);
479 }, javax.swing.tree.DefaultMutableTreeNode, "PreorderEnumeration", null, java.util.Enumeration);
480 Clazz.makeConstructor (c$, 
481 function (a) {
482 var b =  new java.util.Vector (1);
483 b.addElement (a);
484 this.stack =  new java.util.Stack ();
485 this.stack.push (b.elements ());
486 }, "javax.swing.tree.TreeNode");
487 Clazz.overrideMethod (c$, "hasMoreElements", 
488 function () {
489 return (!this.stack.empty () && (this.stack.peek ()).hasMoreElements ());
490 });
491 Clazz.overrideMethod (c$, "nextElement", 
492 function () {
493 var a = this.stack.peek ();
494 var b = a.nextElement ();
495 var c = b.children ();
496 if (!a.hasMoreElements ()) {
497 this.stack.pop ();
498 }if (c.hasMoreElements ()) {
499 this.stack.push (c);
500 }return b;
501 });
502 c$ = Clazz.p0p ();
503 };
504 c$.$DefaultMutableTreeNode$PostorderEnumeration$ = function () {
505 Clazz.pu$h(self.c$);
506 c$ = Clazz.decorateAsClass (function () {
507 Clazz.prepareCallback (this, arguments);
508 this.root = null;
509 this.children = null;
510 this.subtree = null;
511 Clazz.instantialize (this, arguments);
512 }, javax.swing.tree.DefaultMutableTreeNode, "PostorderEnumeration", null, java.util.Enumeration);
513 Clazz.makeConstructor (c$, 
514 function (a) {
515 this.root = a;
516 this.children = this.root.children ();
517 this.subtree = javax.swing.tree.DefaultMutableTreeNode.EMPTY_ENUMERATION;
518 }, "javax.swing.tree.TreeNode");
519 Clazz.defineMethod (c$, "hasMoreElements", 
520 function () {
521 return this.root != null;
522 });
523 Clazz.defineMethod (c$, "nextElement", 
524 function () {
525 var a;
526 if (this.subtree.hasMoreElements ()) {
527 a = this.subtree.nextElement ();
528 } else if (this.children.hasMoreElements ()) {
529 this.subtree = Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.PostorderEnumeration, this, null, this.children.nextElement ());
530 a = this.subtree.nextElement ();
531 } else {
532 a = this.root;
533 this.root = null;
534 }return a;
535 });
536 c$ = Clazz.p0p ();
537 };
538 c$.$DefaultMutableTreeNode$BreadthFirstEnumeration$ = function () {
539 Clazz.pu$h(self.c$);
540 c$ = Clazz.decorateAsClass (function () {
541 Clazz.prepareCallback (this, arguments);
542 this.queue = null;
543 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue")) {
544 javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.$DefaultMutableTreeNode$BreadthFirstEnumeration$Queue$ ();
545 }
546 Clazz.instantialize (this, arguments);
547 }, javax.swing.tree.DefaultMutableTreeNode, "BreadthFirstEnumeration", null, java.util.Enumeration);
548 Clazz.makeConstructor (c$, 
549 function (a) {
550 var b =  new java.util.Vector (1);
551 b.addElement (a);
552 this.queue = Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue, this, null);
553 this.queue.enqueue (b.elements ());
554 }, "javax.swing.tree.TreeNode");
555 Clazz.overrideMethod (c$, "hasMoreElements", 
556 function () {
557 return (!this.queue.isEmpty () && (this.queue.firstObject ()).hasMoreElements ());
558 });
559 Clazz.overrideMethod (c$, "nextElement", 
560 function () {
561 var a = this.queue.firstObject ();
562 var b = a.nextElement ();
563 var c = b.children ();
564 if (!a.hasMoreElements ()) {
565 this.queue.dequeue ();
566 }if (c.hasMoreElements ()) {
567 this.queue.enqueue (c);
568 }return b;
569 });
570 c$.$DefaultMutableTreeNode$BreadthFirstEnumeration$Queue$ = function () {
571 Clazz.pu$h(self.c$);
572 c$ = Clazz.decorateAsClass (function () {
573 Clazz.prepareCallback (this, arguments);
574 this.head = null;
575 this.tail = null;
576 if (!Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode")) {
577 javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.$DefaultMutableTreeNode$BreadthFirstEnumeration$Queue$QNode$ ();
578 }
579 Clazz.instantialize (this, arguments);
580 }, javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration, "Queue");
581 Clazz.defineMethod (c$, "enqueue", 
582 function (a) {
583 if (this.head == null) {
584 this.head = this.tail = Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode, this, null, a, null);
585 } else {
586 this.tail.next = Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode, this, null, a, null);
587 this.tail = this.tail.next;
588 }}, "~O");
589 Clazz.defineMethod (c$, "dequeue", 
590 function () {
591 if (this.head == null) {
592 throw  new java.util.NoSuchElementException ("No more elements");
593 }var a = this.head.object;
594 var b = this.head;
595 this.head = this.head.next;
596 if (this.head == null) {
597 this.tail = null;
598 } else {
599 b.next = null;
600 }return a;
601 });
602 Clazz.defineMethod (c$, "firstObject", 
603 function () {
604 if (this.head == null) {
605 throw  new java.util.NoSuchElementException ("No more elements");
606 }return this.head.object;
607 });
608 Clazz.defineMethod (c$, "isEmpty", 
609 function () {
610 return this.head == null;
611 });
612 c$.$DefaultMutableTreeNode$BreadthFirstEnumeration$Queue$QNode$ = function () {
613 Clazz.pu$h(self.c$);
614 c$ = Clazz.decorateAsClass (function () {
615 Clazz.prepareCallback (this, arguments);
616 this.object = null;
617 this.next = null;
618 Clazz.instantialize (this, arguments);
619 }, javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue, "QNode");
620 Clazz.makeConstructor (c$, 
621 function (a, b) {
622 this.object = a;
623 this.next = b;
624 }, "~O,javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode");
625 c$ = Clazz.p0p ();
626 };
627 c$ = Clazz.p0p ();
628 };
629 c$ = Clazz.p0p ();
630 };
631 c$.$DefaultMutableTreeNode$PathBetweenNodesEnumeration$ = function () {
632 Clazz.pu$h(self.c$);
633 c$ = Clazz.decorateAsClass (function () {
634 Clazz.prepareCallback (this, arguments);
635 this.stack = null;
636 Clazz.instantialize (this, arguments);
637 }, javax.swing.tree.DefaultMutableTreeNode, "PathBetweenNodesEnumeration", null, java.util.Enumeration);
638 Clazz.makeConstructor (c$, 
639 function (a, b) {
640 if (a == null || b == null) {
641 throw  new IllegalArgumentException ("argument is null");
642 }var c;
643 this.stack =  new java.util.Stack ();
644 this.stack.push (b);
645 c = b;
646 while (c !== a) {
647 c = c.getParent ();
648 if (c == null && b !== a) {
649 throw  new IllegalArgumentException ("node " + a + " is not an ancestor of " + b);
650 }this.stack.push (c);
651 }
652 }, "javax.swing.tree.TreeNode,javax.swing.tree.TreeNode");
653 Clazz.overrideMethod (c$, "hasMoreElements", 
654 function () {
655 return this.stack.size () > 0;
656 });
657 Clazz.overrideMethod (c$, "nextElement", 
658 function () {
659 try {
660 return this.stack.pop ();
661 } catch (e) {
662 if (Clazz.exceptionOf (e, java.util.EmptyStackException)) {
663 throw  new java.util.NoSuchElementException ("No more elements");
664 } else {
665 throw e;
666 }
667 }
668 });
669 c$ = Clazz.p0p ();
670 };
671 c$.$DefaultMutableTreeNode$1$ = function () {
672 Clazz.pu$h(self.c$);
673 c$ = Clazz.declareAnonymous (javax.swing.tree, "DefaultMutableTreeNode$1", null, java.util.Enumeration);
674 Clazz.defineMethod (c$, "hasMoreElements", 
675 function () {
676 return false;
677 });
678 Clazz.defineMethod (c$, "nextElement", 
679 function () {
680 throw  new java.util.NoSuchElementException ("No more elements");
681 });
682 c$ = Clazz.p0p ();
683 };
684 c$.EMPTY_ENUMERATION = c$.prototype.EMPTY_ENUMERATION = ((Clazz.isClassDefined ("javax.swing.tree.DefaultMutableTreeNode$1") ? 0 : javax.swing.tree.DefaultMutableTreeNode.$DefaultMutableTreeNode$1$ ()), Clazz.innerTypeInstance (javax.swing.tree.DefaultMutableTreeNode$1, this, null));
685 });