public void lineTo(float x, float y) { checkBuf(2, true); types[typeSize++] = PathIterator.SEG_LINETO; points[pointSize++] = x; points[pointSize++] = y; }
case PathIterator.SEG_MOVETO: if (!connect || typeSize == 0) { moveTo(coords[0], coords[1]); break; lineTo(coords[0], coords[1]); break; case PathIterator.SEG_QUADTO: quadTo(coords[0], coords[1], coords[2], coords[3]); break; case PathIterator.SEG_CUBICTO: curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]); break; case PathIterator.SEG_CLOSE: closePath(); break;
public Shape createTransformedShape(Shape src) { if (src == null) { return null; } if (src instanceof GeneralPath) { return ((GeneralPath)src).createTransformedShape(this); } PathIterator path = src.getPathIterator(this); GeneralPath dst = new GeneralPath(path.getWindingRule()); dst.append(path, false); return dst; }
public GeneralPath(Shape shape) { this(WIND_NON_ZERO, BUFFER_SIZE); PathIterator p = shape.getPathIterator(null); setWindingRule(p.getWindingRule()); append(p, false); }
public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
public Rectangle getBounds() { return getBounds2D().getBounds(); }
public void append(Shape shape, boolean connect) { PathIterator p = shape.getPathIterator(null); append(p, connect); }
public PathIterator getPathIterator(AffineTransform t, double flatness) { return new FlatteningPathIterator(getPathIterator(t), flatness); }
case PathIterator.SEG_MOVETO: if (!connect || typeSize == 0) { moveTo(coords[0], coords[1]); break; lineTo(coords[0], coords[1]); break; case PathIterator.SEG_QUADTO: quadTo(coords[0], coords[1], coords[2], coords[3]); break; case PathIterator.SEG_CUBICTO: curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]); break; case PathIterator.SEG_CLOSE: closePath(); break;
public Shape createTransformedShape(Shape src) { if (src == null) { return null; } if (src instanceof GeneralPath) { return ((GeneralPath)src).createTransformedShape(this); } PathIterator path = src.getPathIterator(this); GeneralPath dst = new GeneralPath(path.getWindingRule()); dst.append(path, false); return dst; }
public GeneralPath(Shape shape) { this(WIND_NON_ZERO, BUFFER_SIZE); PathIterator p = shape.getPathIterator(null); setWindingRule(p.getWindingRule()); append(p, false); }
public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
public Rectangle getBounds() { return getBounds2D().getBounds(); }
public void append(Shape shape, boolean connect) { PathIterator p = shape.getPathIterator(null); append(p, connect); }
public PathIterator getPathIterator(AffineTransform t, double flatness) { return new FlatteningPathIterator(getPathIterator(t), flatness); }
public void closePath() { if (typeSize == 0 || types[typeSize - 1] != PathIterator.SEG_CLOSE) { checkBuf(0, true); types[typeSize++] = PathIterator.SEG_CLOSE; } }
public boolean contains(Rectangle2D r) { return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
public void quadTo(float x1, float y1, float x2, float y2) { checkBuf(4, true); types[typeSize++] = PathIterator.SEG_QUADTO; points[pointSize++] = x1; points[pointSize++] = y1; points[pointSize++] = x2; points[pointSize++] = y2; }