8900c4128d0889ea642529efbd417b1fb4f8d278
[jalviewjs.git] / site / swingjs / j2s / javax / swing / text / TabStop.js
1 Clazz.declarePackage ("javax.swing.text");\r
2 c$ = Clazz.decorateAsClass (function () {\r
3 this.alignment = 0;\r
4 this.position = 0;\r
5 this.leader = 0;\r
6 Clazz.instantialize (this, arguments);\r
7 }, javax.swing.text, "TabStop");\r
8 Clazz.makeConstructor (c$, \r
9 function (pos) {\r
10 this.construct (pos, 0, 0);\r
11 }, "~N");\r
12 Clazz.makeConstructor (c$, \r
13 function (pos, align, leader) {\r
14 this.alignment = align;\r
15 this.leader = leader;\r
16 this.position = pos;\r
17 }, "~N,~N,~N");\r
18 Clazz.defineMethod (c$, "getPosition", \r
19 function () {\r
20 return this.position;\r
21 });\r
22 Clazz.defineMethod (c$, "getAlignment", \r
23 function () {\r
24 return this.alignment;\r
25 });\r
26 Clazz.defineMethod (c$, "getLeader", \r
27 function () {\r
28 return this.leader;\r
29 });\r
30 Clazz.overrideMethod (c$, "equals", \r
31 function (other) {\r
32 if (other === this) {\r
33 return true;\r
34 }if (Clazz.instanceOf (other, javax.swing.text.TabStop)) {\r
35 var o = other;\r
36 return ((this.alignment == o.alignment) && (this.leader == o.leader) && (this.position == o.position));\r
37 }return false;\r
38 }, "~O");\r
39 Clazz.overrideMethod (c$, "hashCode", \r
40 function () {\r
41 return this.alignment ^ this.leader ^ Math.round (this.position);\r
42 });\r
43 Clazz.overrideMethod (c$, "toString", \r
44 function () {\r
45 var buf;\r
46 switch (this.alignment) {\r
47 default:\r
48 case 0:\r
49 buf = "";\r
50 break;\r
51 case 1:\r
52 buf = "right ";\r
53 break;\r
54 case 2:\r
55 buf = "center ";\r
56 break;\r
57 case 4:\r
58 buf = "decimal ";\r
59 break;\r
60 case 5:\r
61 buf = "bar ";\r
62 break;\r
63 }\r
64 buf = buf + "tab @" + String.valueOf (this.position);\r
65 if (this.leader != 0) buf = buf + " (w/leaders)";\r
66 return buf;\r
67 });\r
68 Clazz.defineStatics (c$,\r
69 "ALIGN_LEFT", 0,\r
70 "ALIGN_RIGHT", 1,\r
71 "ALIGN_CENTER", 2,\r
72 "ALIGN_DECIMAL", 4,\r
73 "ALIGN_BAR", 5,\r
74 "LEAD_NONE", 0,\r
75 "LEAD_DOTS", 1,\r
76 "LEAD_HYPHENS", 2,\r
77 "LEAD_UNDERLINE", 3,\r
78 "LEAD_THICKLINE", 4,\r
79 "LEAD_EQUALS", 5);\r