X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjssun%2Fawt%2Fgeom%2FEdge.js;fp=site%2Fswingjs%2Fj2s%2Fjssun%2Fawt%2Fgeom%2FEdge.js;h=a75df8f448ceeb5927c88e6359b8726e0424c998;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=0000000000000000000000000000000000000000;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/site/swingjs/j2s/jssun/awt/geom/Edge.js b/site/swingjs/j2s/jssun/awt/geom/Edge.js new file mode 100644 index 0000000..a75df8f --- /dev/null +++ b/site/swingjs/j2s/jssun/awt/geom/Edge.js @@ -0,0 +1,78 @@ +Clazz.declarePackage ("jssun.awt.geom"); +c$ = Clazz.decorateAsClass (function () { +this.curve = null; +this.ctag = 0; +this.etag = 0; +this.activey = 0; +this.equivalence = 0; +this.lastEdge = null; +this.lastResult = 0; +this.lastLimit = 0; +Clazz.instantialize (this, arguments); +}, jssun.awt.geom, "Edge"); +Clazz.makeConstructor (c$, +function (c, ctag) { +this.construct (c, ctag, 0); +}, "jssun.awt.geom.Curve,~N"); +Clazz.makeConstructor (c$, +function (c, ctag, etag) { +this.curve = c; +this.ctag = ctag; +this.etag = etag; +}, "jssun.awt.geom.Curve,~N,~N"); +Clazz.defineMethod (c$, "getCurve", +function () { +return this.curve; +}); +Clazz.defineMethod (c$, "getCurveTag", +function () { +return this.ctag; +}); +Clazz.defineMethod (c$, "getEdgeTag", +function () { +return this.etag; +}); +Clazz.defineMethod (c$, "setEdgeTag", +function (etag) { +this.etag = etag; +}, "~N"); +Clazz.defineMethod (c$, "getEquivalence", +function () { +return this.equivalence; +}); +Clazz.defineMethod (c$, "setEquivalence", +function (eq) { +this.equivalence = eq; +}, "~N"); +Clazz.defineMethod (c$, "compareTo", +function (other, yrange) { +if (other === this.lastEdge && yrange[0] < this.lastLimit) { +if (yrange[1] > this.lastLimit) { +yrange[1] = this.lastLimit; +}return this.lastResult; +}if (this === other.lastEdge && yrange[0] < other.lastLimit) { +if (yrange[1] > other.lastLimit) { +yrange[1] = other.lastLimit; +}return 0 - other.lastResult; +}var ret = this.curve.compareTo (other.curve, yrange); +this.lastEdge = other; +this.lastLimit = yrange[1]; +this.lastResult = ret; +return ret; +}, "jssun.awt.geom.Edge,~A"); +Clazz.defineMethod (c$, "record", +function (yend, etag) { +this.activey = yend; +this.etag = etag; +}, "~N,~N"); +Clazz.defineMethod (c$, "isActiveFor", +function (y, etag) { +return (this.etag == etag && this.activey >= y); +}, "~N,~N"); +Clazz.overrideMethod (c$, "toString", +function () { +return ("Edge[" + this.curve + ", " + (this.ctag == 0 ? "L" : "R") + ", " + (this.etag == 1 ? "I" : (this.etag == -1 ? "O" : "N")) + "]"); +}); +Clazz.defineStatics (c$, +"INIT_PARTS", 4, +"GROW_PARTS", 10);