home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / awt / geom / CurveLink.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.0 KB  |  86 lines

  1. package sun.awt.geom;
  2.  
  3. final class CurveLink {
  4.    Curve curve;
  5.    double ytop;
  6.    double ybot;
  7.    int etag;
  8.    CurveLink next;
  9.  
  10.    public CurveLink(Curve var1, double var2, double var4, int var6) {
  11.       this.curve = var1;
  12.       this.ytop = var2;
  13.       this.ybot = var4;
  14.       this.etag = var6;
  15.       if (this.ytop < var1.getYTop() || this.ybot > var1.getYBot()) {
  16.          throw new InternalError("bad curvelink [" + this.ytop + "=>" + this.ybot + "] for " + var1);
  17.       }
  18.    }
  19.  
  20.    public boolean absorb(CurveLink var1) {
  21.       return this.absorb(var1.curve, var1.ytop, var1.ybot, var1.etag);
  22.    }
  23.  
  24.    public boolean absorb(Curve var1, double var2, double var4, int var6) {
  25.       if (this.curve == var1 && this.etag == var6 && !(this.ybot < var2) && !(this.ytop > var4)) {
  26.          if (!(var2 < var1.getYTop()) && !(var4 > var1.getYBot())) {
  27.             this.ytop = Math.min(this.ytop, var2);
  28.             this.ybot = Math.max(this.ybot, var4);
  29.             return true;
  30.          } else {
  31.             throw new InternalError("bad curvelink [" + var2 + "=>" + var4 + "] for " + var1);
  32.          }
  33.       } else {
  34.          return false;
  35.       }
  36.    }
  37.  
  38.    public boolean isEmpty() {
  39.       return this.ytop == this.ybot;
  40.    }
  41.  
  42.    public Curve getCurve() {
  43.       return this.curve;
  44.    }
  45.  
  46.    public Curve getSubCurve() {
  47.       return this.ytop == this.curve.getYTop() && this.ybot == this.curve.getYBot() ? this.curve.getWithDirection(this.etag) : this.curve.getSubCurve(this.ytop, this.ybot, this.etag);
  48.    }
  49.  
  50.    public Curve getMoveto() {
  51.       return new Order0(this.getXTop(), this.getYTop());
  52.    }
  53.  
  54.    public double getXTop() {
  55.       return this.curve.XforY(this.ytop);
  56.    }
  57.  
  58.    public double getYTop() {
  59.       return this.ytop;
  60.    }
  61.  
  62.    public double getXBot() {
  63.       return this.curve.XforY(this.ybot);
  64.    }
  65.  
  66.    public double getYBot() {
  67.       return this.ybot;
  68.    }
  69.  
  70.    public double getX() {
  71.       return this.curve.XforY(this.ytop);
  72.    }
  73.  
  74.    public int getEdgeTag() {
  75.       return this.etag;
  76.    }
  77.  
  78.    public void setNext(CurveLink var1) {
  79.       this.next = var1;
  80.    }
  81.  
  82.    public CurveLink getNext() {
  83.       return this.next;
  84.    }
  85. }
  86.