JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / jssun / awt / geom / Edge.js
1 Clazz.declarePackage ("jssun.awt.geom");\r
2 c$ = Clazz.decorateAsClass (function () {\r
3 this.curve = null;\r
4 this.ctag = 0;\r
5 this.etag = 0;\r
6 this.activey = 0;\r
7 this.equivalence = 0;\r
8 this.lastEdge = null;\r
9 this.lastResult = 0;\r
10 this.lastLimit = 0;\r
11 Clazz.instantialize (this, arguments);\r
12 }, jssun.awt.geom, "Edge");\r
13 Clazz.makeConstructor (c$, \r
14 function (c, ctag) {\r
15 this.construct (c, ctag, 0);\r
16 }, "jssun.awt.geom.Curve,~N");\r
17 Clazz.makeConstructor (c$, \r
18 function (c, ctag, etag) {\r
19 this.curve = c;\r
20 this.ctag = ctag;\r
21 this.etag = etag;\r
22 }, "jssun.awt.geom.Curve,~N,~N");\r
23 Clazz.defineMethod (c$, "getCurve", \r
24 function () {\r
25 return this.curve;\r
26 });\r
27 Clazz.defineMethod (c$, "getCurveTag", \r
28 function () {\r
29 return this.ctag;\r
30 });\r
31 Clazz.defineMethod (c$, "getEdgeTag", \r
32 function () {\r
33 return this.etag;\r
34 });\r
35 Clazz.defineMethod (c$, "setEdgeTag", \r
36 function (etag) {\r
37 this.etag = etag;\r
38 }, "~N");\r
39 Clazz.defineMethod (c$, "getEquivalence", \r
40 function () {\r
41 return this.equivalence;\r
42 });\r
43 Clazz.defineMethod (c$, "setEquivalence", \r
44 function (eq) {\r
45 this.equivalence = eq;\r
46 }, "~N");\r
47 Clazz.defineMethod (c$, "compareTo", \r
48 function (other, yrange) {\r
49 if (other === this.lastEdge && yrange[0] < this.lastLimit) {\r
50 if (yrange[1] > this.lastLimit) {\r
51 yrange[1] = this.lastLimit;\r
52 }return this.lastResult;\r
53 }if (this === other.lastEdge && yrange[0] < other.lastLimit) {\r
54 if (yrange[1] > other.lastLimit) {\r
55 yrange[1] = other.lastLimit;\r
56 }return 0 - other.lastResult;\r
57 }var ret = this.curve.compareTo (other.curve, yrange);\r
58 this.lastEdge = other;\r
59 this.lastLimit = yrange[1];\r
60 this.lastResult = ret;\r
61 return ret;\r
62 }, "jssun.awt.geom.Edge,~A");\r
63 Clazz.defineMethod (c$, "record", \r
64 function (yend, etag) {\r
65 this.activey = yend;\r
66 this.etag = etag;\r
67 }, "~N,~N");\r
68 Clazz.defineMethod (c$, "isActiveFor", \r
69 function (y, etag) {\r
70 return (this.etag == etag && this.activey >= y);\r
71 }, "~N,~N");\r
72 Clazz.overrideMethod (c$, "toString", \r
73 function () {\r
74 return ("Edge[" + this.curve + ", " + (this.ctag == 0 ? "L" : "R") + ", " + (this.etag == 1 ? "I" : (this.etag == -1 ? "O" : "N")) + "]");\r
75 });\r
76 Clazz.defineStatics (c$,\r
77 "INIT_PARTS", 4,\r
78 "GROW_PARTS", 10);\r