private int current;
private int current = 0;
  public PathIterator getPathIterator(final AffineTransform at)  {    return new PathIterator()    {      /** Current coordinate. */      private int current;      public int getWindingRule()      {        return WIND_NON_ZERO;      }      public boolean isDone()      {        return current < 2;      }      public void next()      {        current++;      }      public int currentSegment(float[] coords)      {        if (current == 0)          {            coords[0] = (float) getX1();            coords[1] = (float) getY1();            if (at != null)              at.transform(coords, 0, coords, 0, 1);            return SEG_MOVETO;          }        if (current == 1)          {            coords[0] = (float) getCtrlX1();            coords[1] = (float) getCtrlY1();            coords[2] = (float) getCtrlX2();            coords[3] = (float) getCtrlY2();            coords[4] = (float) getX2();            coords[5] = (float) getY2();            if (at != null)              at.transform(coords, 0, coords, 0, 3);            return SEG_CUBICTO;          }        throw new NoSuchElementException("cubic iterator out of bounds");      }      public int currentSegment(double[] coords)      {        if (current == 0)          {            coords[0] = getX1();            coords[1] = getY1();            if (at != null)              at.transform(coords, 0, coords, 0, 1);            return SEG_MOVETO;          }        if (current == 1)          {            coords[0] = getCtrlX1();            coords[1] = getCtrlY1();            coords[2] = getCtrlX2();            coords[3] = getCtrlY2();            coords[4] = getX2();            coords[5] = getY2();            if (at != null)              at.transform(coords, 0, coords, 0, 3);            return SEG_CUBICTO;          }        throw new NoSuchElementException("cubic iterator out of bounds");      }    };  }