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