final int x0 = Units.toEMU(bounds.getX()); final int y0 = Units.toEMU(bounds.getY()); final PathIterator it = path.getPathIterator(new AffineTransform()); int numPoints = 0; ctPath.setH(Units.toEMU(bounds.getHeight()));
/** * Returns the length of the path. * * @param flatness the flatness used to approximate the length. */ public double getLengthOfPath(double flatness) { double len = 0; PathIterator i = generalPath.getPathIterator(new AffineTransform(), flatness); double[] coords = new double[6]; double prevX = coords[0]; double prevY = coords[1]; i.next(); for (; !i.isDone(); i.next()) { i.currentSegment(coords); len += Geom.length(prevX, prevY, coords[0], coords[1]); prevX = coords[0]; prevY = coords[1]; } return len; }
for (PathIterator pi = path.getPathIterator(null); !pi.isDone(); pi.next())
@Override public int setPath(Path2D.Double path) { Rectangle2D bounds = path.getBounds2D(); PathIterator it = path.getPathIterator(new AffineTransform());
double pos = 0; double[] coords = new double[6]; PathIterator i = generalPath.getPathIterator(new AffineTransform(), flatness); double prevX = coords[0]; double prevY = coords[1];
final int x0 = Units.toEMU(bounds.getX()); final int y0 = Units.toEMU(bounds.getY()); final PathIterator it = path.getPathIterator(new AffineTransform()); int numPoints = 0; ctPath.setH(Units.toEMU(bounds.getHeight()));
@Override public PathIterator getPathIterator(AffineTransform at, double flatness) { validatePath(); return generalPath.getPathIterator(at, flatness); }
public static void addToRegionOfInterest(final BezierPath path, final GeneralPathRegionOfInterest roi) { addToRegionOfInterest(path.toGeneralPath().getPathIterator(null), roi); }
@Override public PathIterator getPathIterator(AffineTransform at) { validatePath(); return generalPath.getPathIterator(at); }