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