home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / awt / geom / RectIterator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  89 lines

  1. package java.awt.geom;
  2.  
  3. import java.util.NoSuchElementException;
  4.  
  5. class RectIterator implements PathIterator {
  6.    // $FF: renamed from: x double
  7.    double field_0;
  8.    // $FF: renamed from: y double
  9.    double field_1;
  10.    // $FF: renamed from: w double
  11.    double field_2;
  12.    // $FF: renamed from: h double
  13.    double field_3;
  14.    AffineTransform affine;
  15.    int index;
  16.  
  17.    RectIterator(Rectangle2D var1, AffineTransform var2) {
  18.       this.field_0 = ((RectangularShape)var1).getX();
  19.       this.field_1 = ((RectangularShape)var1).getY();
  20.       this.field_2 = ((RectangularShape)var1).getWidth();
  21.       this.field_3 = ((RectangularShape)var1).getHeight();
  22.       this.affine = var2;
  23.       if (this.field_2 < (double)0.0F || this.field_3 < (double)0.0F) {
  24.          this.index = 6;
  25.       }
  26.  
  27.    }
  28.  
  29.    public int getWindingRule() {
  30.       return 1;
  31.    }
  32.  
  33.    public boolean isDone() {
  34.       return this.index > 5;
  35.    }
  36.  
  37.    public void next() {
  38.       ++this.index;
  39.    }
  40.  
  41.    public int currentSegment(float[] var1) {
  42.       if (this.isDone()) {
  43.          throw new NoSuchElementException("rect iterator out of bounds");
  44.       } else if (this.index == 5) {
  45.          return 4;
  46.       } else {
  47.          var1[0] = (float)this.field_0;
  48.          var1[1] = (float)this.field_1;
  49.          if (this.index == 1 || this.index == 2) {
  50.             var1[0] += (float)this.field_2;
  51.          }
  52.  
  53.          if (this.index == 2 || this.index == 3) {
  54.             var1[1] += (float)this.field_3;
  55.          }
  56.  
  57.          if (this.affine != null) {
  58.             this.affine.transform(var1, 0, var1, 0, 1);
  59.          }
  60.  
  61.          return this.index == 0 ? 0 : 1;
  62.       }
  63.    }
  64.  
  65.    public int currentSegment(double[] var1) {
  66.       if (this.isDone()) {
  67.          throw new NoSuchElementException("rect iterator out of bounds");
  68.       } else if (this.index == 5) {
  69.          return 4;
  70.       } else {
  71.          var1[0] = this.field_0;
  72.          var1[1] = this.field_1;
  73.          if (this.index == 1 || this.index == 2) {
  74.             var1[0] += this.field_2;
  75.          }
  76.  
  77.          if (this.index == 2 || this.index == 3) {
  78.             var1[1] += this.field_3;
  79.          }
  80.  
  81.          if (this.affine != null) {
  82.             this.affine.transform(var1, 0, var1, 0, 1);
  83.          }
  84.  
  85.          return this.index == 0 ? 0 : 1;
  86.       }
  87.    }
  88. }
  89.