1 Clazz.declarePackage ("java.awt");
2 Clazz.load (["java.awt.Stroke"], "java.awt.BasicStroke", ["java.lang.Float", "$.IllegalArgumentException", "java.util.Arrays"], function () {
3 c$ = Clazz.decorateAsClass (function () {
10 Clazz.instantialize (this, arguments);
11 }, java.awt, "BasicStroke", null, java.awt.Stroke);
12 Clazz.makeConstructor (c$,
13 function (width, cap, join, miterlimit, dash, dash_phase) {
15 throw new IllegalArgumentException ("negative width");
16 }if (cap != 0 && cap != 1 && cap != 2) {
17 throw new IllegalArgumentException ("illegal end cap value");
19 if (miterlimit < 1.0) {
20 throw new IllegalArgumentException ("miter limit < 1");
21 }} else if (join != 1 && join != 2) {
22 throw new IllegalArgumentException ("illegal line join value");
24 if (dash_phase < 0.0) {
25 throw new IllegalArgumentException ("negative dash phase");
27 for (var i = 0; i < dash.length; i++) {
32 throw new IllegalArgumentException ("negative dash length");
35 throw new IllegalArgumentException ("dash lengths all zero");
39 this.miterlimit = miterlimit;
41 this.dash = dash.clone ();
42 }this.dash_phase = dash_phase;
43 }, "~N,~N,~N,~N,~A,~N");
44 Clazz.makeConstructor (c$,
45 function (width, cap, join, miterlimit) {
46 this.construct (width, cap, join, miterlimit, null, 0.0);
48 Clazz.makeConstructor (c$,
49 function (width, cap, join) {
50 this.construct (width, cap, join, 10.0, null, 0.0);
52 Clazz.makeConstructor (c$,
54 this.construct (width, 2, 0, 10.0, null, 0.0);
56 Clazz.makeConstructor (c$,
58 this.construct (1.0, 2, 0, 10.0, null, 0.0);
60 Clazz.overrideMethod (c$, "createStrokedShape",
64 Clazz.defineMethod (c$, "getLineWidth",
68 Clazz.defineMethod (c$, "getEndCap",
72 Clazz.defineMethod (c$, "getLineJoin",
76 Clazz.defineMethod (c$, "getMiterLimit",
78 return this.miterlimit;
80 Clazz.defineMethod (c$, "getDashArray",
82 if (this.dash == null) {
84 }return this.dash.clone ();
86 Clazz.defineMethod (c$, "getDashPhase",
88 return this.dash_phase;
90 Clazz.overrideMethod (c$, "hashCode",
92 var hash = Float.floatToIntBits (this.width);
93 hash = hash * 31 + this.join;
94 hash = hash * 31 + this.cap;
95 hash = hash * 31 + Float.floatToIntBits (this.miterlimit);
96 if (this.dash != null) {
97 hash = hash * 31 + Float.floatToIntBits (this.dash_phase);
98 for (var i = 0; i < this.dash.length; i++) {
99 hash = hash * 31 + Float.floatToIntBits (this.dash[i]);
103 Clazz.overrideMethod (c$, "equals",
105 if (!(Clazz.instanceOf (obj, java.awt.BasicStroke))) {
108 if (this.width != bs.width) {
110 }if (this.join != bs.join) {
112 }if (this.cap != bs.cap) {
114 }if (this.miterlimit != bs.miterlimit) {
116 }if (this.dash != null) {
117 if (this.dash_phase != bs.dash_phase) {
119 }if (!java.util.Arrays.equals (this.dash, bs.dash)) {
121 }} else if (bs.dash != null) {
125 Clazz.defineStatics (c$,