Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / tree / TreePath.js
index f63c650..22b8dd7 100644 (file)
-Clazz.declarePackage ("javax.swing.tree");\r
-Clazz.load (null, "javax.swing.tree.TreePath", ["java.lang.IllegalArgumentException", "$.NullPointerException", "$.StringBuffer"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.parentPath = null;\r
-this.lastPathComponent = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.tree, "TreePath");\r
-Clazz.makeConstructor (c$, \r
-function (path) {\r
-if (path == null || path.length == 0) throw  new IllegalArgumentException ("path in TreePath must be non null and not empty.");\r
-this.lastPathComponent = path[path.length - 1];\r
-if (path.length > 1) this.parentPath =  new javax.swing.tree.TreePath (path, path.length - 1);\r
-}, "~A");\r
-Clazz.makeConstructor (c$, \r
-function (singlePath) {\r
-if (singlePath == null) throw  new IllegalArgumentException ("path in TreePath must be non null.");\r
-this.lastPathComponent = singlePath;\r
-this.parentPath = null;\r
-}, "~O");\r
-Clazz.makeConstructor (c$, \r
-function (parent, lastElement) {\r
-if (lastElement == null) throw  new IllegalArgumentException ("path in TreePath must be non null.");\r
-this.parentPath = parent;\r
-this.lastPathComponent = lastElement;\r
-}, "javax.swing.tree.TreePath,~O");\r
-Clazz.makeConstructor (c$, \r
-function (path, length) {\r
-this.lastPathComponent = path[length - 1];\r
-if (length > 1) this.parentPath =  new javax.swing.tree.TreePath (path, length - 1);\r
-}, "~A,~N");\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "getPath", \r
-function () {\r
-var i = this.getPathCount ();\r
-var result =  new Array (i--);\r
-for (var path = this; path != null; path = path.parentPath) {\r
-result[i--] = path.lastPathComponent;\r
-}\r
-return result;\r
-});\r
-Clazz.defineMethod (c$, "getLastPathComponent", \r
-function () {\r
-return this.lastPathComponent;\r
-});\r
-Clazz.defineMethod (c$, "getPathCount", \r
-function () {\r
-var result = 0;\r
-for (var path = this; path != null; path = path.parentPath) {\r
-result++;\r
-}\r
-return result;\r
-});\r
-Clazz.defineMethod (c$, "getPathComponent", \r
-function (element) {\r
-var pathLength = this.getPathCount ();\r
-if (element < 0 || element >= pathLength) throw  new IllegalArgumentException ("Index " + element + " is out of the specified range");\r
-var path = this;\r
-for (var i = pathLength - 1; i != element; i--) {\r
-path = path.parentPath;\r
-}\r
-return path.lastPathComponent;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "equals", \r
-function (o) {\r
-if (o === this) return true;\r
-if (Clazz.instanceOf (o, javax.swing.tree.TreePath)) {\r
-var oTreePath = o;\r
-if (this.getPathCount () != oTreePath.getPathCount ()) return false;\r
-for (var path = this; path != null; path = path.parentPath) {\r
-if (!(path.lastPathComponent.equals (oTreePath.lastPathComponent))) {\r
-return false;\r
-}oTreePath = oTreePath.parentPath;\r
-}\r
-return true;\r
-}return false;\r
-}, "~O");\r
-Clazz.defineMethod (c$, "hashCode", \r
-function () {\r
-return this.lastPathComponent.hashCode ();\r
-});\r
-Clazz.defineMethod (c$, "isDescendant", \r
-function (aTreePath) {\r
-if (aTreePath === this) return true;\r
-if (aTreePath != null) {\r
-var pathLength = this.getPathCount ();\r
-var oPathLength = aTreePath.getPathCount ();\r
-if (oPathLength < pathLength) return false;\r
-while (oPathLength-- > pathLength) aTreePath = aTreePath.getParentPath ();\r
-\r
-return this.equals (aTreePath);\r
-}return false;\r
-}, "javax.swing.tree.TreePath");\r
-Clazz.defineMethod (c$, "pathByAddingChild", \r
-function (child) {\r
-if (child == null) throw  new NullPointerException ("Null child not allowed");\r
-return  new javax.swing.tree.TreePath (this, child);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getParentPath", \r
-function () {\r
-return this.parentPath;\r
-});\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-var tempSpot =  new StringBuffer ("[");\r
-for (var counter = 0, maxCounter = this.getPathCount (); counter < maxCounter; counter++) {\r
-if (counter > 0) tempSpot.append (", ");\r
-tempSpot.append (this.getPathComponent (counter));\r
-}\r
-tempSpot.append ("]");\r
-return tempSpot.toString ();\r
-});\r
-});\r
+Clazz.declarePackage ("javax.swing.tree");
+Clazz.load (null, "javax.swing.tree.TreePath", ["java.lang.IllegalArgumentException", "$.NullPointerException", "$.StringBuffer"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.parentPath = null;
+this.lastPathComponent = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.tree, "TreePath");
+Clazz.makeConstructor (c$, 
+function (path) {
+if (path == null || path.length == 0) throw  new IllegalArgumentException ("path in TreePath must be non null and not empty.");
+this.lastPathComponent = path[path.length - 1];
+if (path.length > 1) this.parentPath =  new javax.swing.tree.TreePath (path, path.length - 1);
+}, "~A");
+Clazz.makeConstructor (c$, 
+function (singlePath) {
+if (singlePath == null) throw  new IllegalArgumentException ("path in TreePath must be non null.");
+this.lastPathComponent = singlePath;
+this.parentPath = null;
+}, "~O");
+Clazz.makeConstructor (c$, 
+function (parent, lastElement) {
+if (lastElement == null) throw  new IllegalArgumentException ("path in TreePath must be non null.");
+this.parentPath = parent;
+this.lastPathComponent = lastElement;
+}, "javax.swing.tree.TreePath,~O");
+Clazz.makeConstructor (c$, 
+function (path, length) {
+this.lastPathComponent = path[length - 1];
+if (length > 1) this.parentPath =  new javax.swing.tree.TreePath (path, length - 1);
+}, "~A,~N");
+Clazz.makeConstructor (c$, 
+function () {
+});
+Clazz.defineMethod (c$, "getPath", 
+function () {
+var i = this.getPathCount ();
+var result =  new Array (i--);
+for (var path = this; path != null; path = path.parentPath) {
+result[i--] = path.lastPathComponent;
+}
+return result;
+});
+Clazz.defineMethod (c$, "getLastPathComponent", 
+function () {
+return this.lastPathComponent;
+});
+Clazz.defineMethod (c$, "getPathCount", 
+function () {
+var result = 0;
+for (var path = this; path != null; path = path.parentPath) {
+result++;
+}
+return result;
+});
+Clazz.defineMethod (c$, "getPathComponent", 
+function (element) {
+var pathLength = this.getPathCount ();
+if (element < 0 || element >= pathLength) throw  new IllegalArgumentException ("Index " + element + " is out of the specified range");
+var path = this;
+for (var i = pathLength - 1; i != element; i--) {
+path = path.parentPath;
+}
+return path.lastPathComponent;
+}, "~N");
+Clazz.defineMethod (c$, "equals", 
+function (o) {
+if (o === this) return true;
+if (Clazz.instanceOf (o, javax.swing.tree.TreePath)) {
+var oTreePath = o;
+if (this.getPathCount () != oTreePath.getPathCount ()) return false;
+for (var path = this; path != null; path = path.parentPath) {
+if (!(path.lastPathComponent.equals (oTreePath.lastPathComponent))) {
+return false;
+}oTreePath = oTreePath.parentPath;
+}
+return true;
+}return false;
+}, "~O");
+Clazz.defineMethod (c$, "hashCode", 
+function () {
+return this.lastPathComponent.hashCode ();
+});
+Clazz.defineMethod (c$, "isDescendant", 
+function (aTreePath) {
+if (aTreePath === this) return true;
+if (aTreePath != null) {
+var pathLength = this.getPathCount ();
+var oPathLength = aTreePath.getPathCount ();
+if (oPathLength < pathLength) return false;
+while (oPathLength-- > pathLength) aTreePath = aTreePath.getParentPath ();
+
+return this.equals (aTreePath);
+}return false;
+}, "javax.swing.tree.TreePath");
+Clazz.defineMethod (c$, "pathByAddingChild", 
+function (child) {
+if (child == null) throw  new NullPointerException ("Null child not allowed");
+return  new javax.swing.tree.TreePath (this, child);
+}, "~O");
+Clazz.defineMethod (c$, "getParentPath", 
+function () {
+return this.parentPath;
+});
+Clazz.overrideMethod (c$, "toString", 
+function () {
+var tempSpot =  new StringBuffer ("[");
+for (var counter = 0, maxCounter = this.getPathCount (); counter < maxCounter; counter++) {
+if (counter > 0) tempSpot.append (", ");
+tempSpot.append (this.getPathComponent (counter));
+}
+tempSpot.append ("]");
+return tempSpot.toString ();
+});
+});