1 Clazz.declarePackage ("javax.swing.text");
2 Clazz.load (null, "javax.swing.text.TabSet", ["java.lang.IllegalArgumentException", "$.StringBuffer"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.$hashCode = 2147483647;
6 Clazz.instantialize (this, arguments);
7 }, javax.swing.text, "TabSet");
8 Clazz.makeConstructor (c$,
11 var tabCount = tabs.length;
12 this.tabs = new Array (tabCount);
13 System.arraycopy (tabs, 0, this.tabs, 0, tabCount);
14 } else this.tabs = null;
16 Clazz.defineMethod (c$, "getTabCount",
18 return (this.tabs == null) ? 0 : this.tabs.length;
20 Clazz.defineMethod (c$, "getTab",
22 var numTabs = this.getTabCount ();
23 if (index < 0 || index >= numTabs) throw new IllegalArgumentException (index + " is outside the range of tabs");
24 return this.tabs[index];
26 Clazz.defineMethod (c$, "getTabAfter",
28 var index = this.getTabIndexAfter (location);
29 return (index == -1) ? null : this.tabs[index];
31 Clazz.defineMethod (c$, "getTabIndex",
33 for (var counter = this.getTabCount () - 1; counter >= 0; counter--) if (this.getTab (counter) === tab) return counter;
36 }, "javax.swing.text.TabStop");
37 Clazz.defineMethod (c$, "getTabIndexAfter",
43 max = this.getTabCount ();
45 current = Clazz.doubleToInt ((max - min) / 2) + min;
46 if (location > this.tabs[current].getPosition ()) {
47 if (min == current) min = max;
50 if (current == 0 || location > this.tabs[current - 1].getPosition ()) return current;
55 Clazz.overrideMethod (c$, "equals",
59 }if (Clazz.instanceOf (o, javax.swing.text.TabSet)) {
61 var count = this.getTabCount ();
62 if (ts.getTabCount () != count) {
64 }for (var i = 0; i < count; i++) {
65 var ts1 = this.getTab (i);
66 var ts2 = ts.getTab (i);
67 if ((ts1 == null && ts2 != null) || (ts1 != null && !this.getTab (i).equals (ts.getTab (i)))) {
73 Clazz.overrideMethod (c$, "hashCode",
75 if (this.$hashCode == 2147483647) {
77 var len = this.getTabCount ();
78 for (var i = 0; i < len; i++) {
79 var ts = this.getTab (i);
80 this.$hashCode ^= ts != null ? this.getTab (i).hashCode () : 0;
82 if (this.$hashCode == 2147483647) {
84 }}return this.$hashCode;
86 Clazz.overrideMethod (c$, "toString",
88 var tabCount = this.getTabCount ();
89 var buffer = new StringBuffer ("[ ");
90 for (var counter = 0; counter < tabCount; counter++) {
91 if (counter > 0) buffer.append (" - ");
92 buffer.append (this.getTab (counter).toString ());
95 return buffer.toString ();