Package java.awt.geom

Examples of java.awt.geom.PathIterator.currentSegment()


        }
        float[] coords = new float[6];
        int traces = 0;
        while(!points.isDone()) {
            ++traces;
            int segtype = points.currentSegment(coords);
            normalizeY(coords);
            switch(segtype) {
                case PathIterator.SEG_CLOSE:
                    cb.closePath();
                    break;
View Full Code Here


    final PathIterator pathIterator = a.getPathIterator(null, 2);
    final FloatList floats = new FloatList(100);
    final float[] coords = new float[6];
    while (pathIterator.isDone() == false)
    {
      final int retval = pathIterator.currentSegment(coords);
      if (retval == PathIterator.SEG_MOVETO ||
          retval == PathIterator.SEG_LINETO)
      {
        floats.add(coords[0]);
        floats.add(coords[1]);
View Full Code Here

    final float[] points = new float[GeneralPathObjectDescription.MAX_POINTS];
    final ArrayList segments = new ArrayList();
    while (pi.isDone() == false)
    {
      final int type = pi.currentSegment(points);
      final PathIteratorSegment seg = new PathIteratorSegment();
      switch (type)
      {
        case PathIterator.SEG_CLOSE:
        {
View Full Code Here

    final float[] coords = new float[6];
    int traces = 0;
    while (!points.isDone())
    {
      ++traces;
      final int segtype = points.currentSegment(coords);
      normalizeY(coords);
      switch (segtype)
      {
        case PathIterator.SEG_CLOSE:
          cb.closePath();
View Full Code Here

        Point2D firstPoint = null;
        Point2D point;

        // split path in polylines
        do {
            segType = pi.currentSegment(segCoords);
            point = new Point2D.Double(segCoords[0], segCoords[1]);

            switch (segType) {
            case PathIterator.SEG_MOVETO:
                if (firstPoint == null)
View Full Code Here

                int segment = 0;
                int itemsInPath = 0;
                boolean pathValid = true;

                for (; !path.isDone() && pathValid; path.next()) {
                    int type = path.currentSegment(points);
                    itemsInPath++;
                    boolean offScreen = false;
                    if (points[0] < 0 || points[0] >= width) {
                        // logger.warning("skipping x point " +
                        // points[0] + " b/c it's off the map.");
View Full Code Here

      points = s.getPathIterator(IDENTITY);
      int segments = 0;
      float[] coords = new float[6];
      while(!points.isDone()) {
          segments++;
          int segtype = points.currentSegment(coords);
          switch(segtype) {
              case PathIterator.SEG_CLOSE:
                pw.print("h ");
                  break;
View Full Code Here

      AffineTransform rotation = new AffineTransform();
      rotation.setToRotation(getNorthDirection(), getX(), getY());
      this.pointsCache = new float[4][2];
      PathIterator it = pieceRectangle.getPathIterator(rotation);
      for (int i = 0; i < this.pointsCache.length; i++) {
        it.currentSegment(this.pointsCache [i]);
        it.next();
      }
    }
    return new float [][] {this.pointsCache [0].clone(), this.pointsCache [1].clone(),
                           this.pointsCache [2].clone(), this.pointsCache [3].clone()};
View Full Code Here

   */
  public float [][] getPoints() {
    float [][] piecePoints = new float[4][2];
    PathIterator it = getShape().getPathIterator(null);
    for (int i = 0; i < piecePoints.length; i++) {
      it.currentSegment(piecePoints [i]);
      it.next();
    }
    return piecePoints;
  }
 
View Full Code Here

   */
  public float [][] getPoints() {
    float [][] piecePoints = new float[4][2];
    PathIterator it = getRectangleShape().getPathIterator(null);
    for (int i = 0; i < piecePoints.length; i++) {
      it.currentSegment(piecePoints [i]);
      it.next();
    }
    return piecePoints;
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.