/** * Appends a straight line segment from the current point to the point <CODE>(x, y)</CODE>. */ public void lineTo(final float x, final float y) { if (currentPoint == null) { throw new RuntimeException(START_PATH_ERR_MSG); } Point2D targetPoint = new Point2D.Float(x, y); getLastSubpath().addSegment(new Line(currentPoint, targetPoint)); currentPoint = targetPoint; }
/** * Appends a straight line segment from the current point to the point <CODE>(x, y)</CODE>. */ public void lineTo(final float x, final float y) { if (currentPoint == null) { throw new RuntimeException(START_PATH_ERR_MSG); } Point2D targetPoint = new Point2D.Float(x, y); getLastSubpath().addSegment(new Line(currentPoint, targetPoint)); currentPoint = targetPoint; }
/** * Begins a new subpath by moving the current point to coordinates <CODE>(x, y)</CODE>. */ public void moveTo(final float x, final float y) { currentPoint = new Point2D.Float(x, y); Subpath lastSubpath = getLastSubpath(); if (lastSubpath != null && lastSubpath.isSinglePointOpen()) { lastSubpath.setStartPoint(currentPoint); } else { subpaths.add(new Subpath(currentPoint)); } }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
@Override public Point2D getP1() { return new Point2D.Float(x1, y1); }
/** * Sets the start point of the subpath. * @param x * @param y */ public void setStartPoint(float x, float y) { this.startPoint = new Point2D.Float(x, y); }
/** * Constructs a new subpath starting at the given point. */ public Subpath(float startPointX, float startPointY) { this.startPoint = new Point2D.Float(startPointX, startPointY); }
/** * Begins a new subpath by moving the current point to coordinates <CODE>(x, y)</CODE>. */ public void moveTo(final float x, final float y) { currentPoint = new Point2D.Float(x, y); Subpath lastSubpath = getLastSubpath(); if (lastSubpath != null && lastSubpath.isSinglePointOpen()) { lastSubpath.setStartPoint(currentPoint); } else { subpaths.add(new Subpath(currentPoint)); } }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
@Override public Point2D getCtrlPt() { return new Point2D.Float(ctrlx, ctrly); }
public Point2D deltaTransform(Point2D src, Point2D dst) { if (dst == null) { if (src instanceof Point2D.Double) { dst = new Point2D.Double(); } else { dst = new Point2D.Float(); } } double x = src.getX(); double y = src.getY(); dst.setLocation(x * m00 + y * m01, x * m10 + y * m11); return dst; }
@Override public Point2D getCtrlP2() { return new Point2D.Float(ctrlx2, ctrly2); }
@Override public Point2D getP1() { return new Point2D.Float(x1, y1); }
public Point2D deltaTransform(Point2D src, Point2D dst) { if (dst == null) { if (src instanceof Point2D.Double) { dst = new Point2D.Double(); } else { dst = new Point2D.Float(); } } double x = src.getX(); double y = src.getY(); dst.setLocation(x * m00 + y * m01, x * m10 + y * m11); return dst; }
@Override public Point2D getCtrlP2() { return new Point2D.Float(ctrlx2, ctrly2); }
/** * Constructs a new line based on the given coordinates. */ public Line(float x1, float y1, float x2, float y2) { p1 = new Point2D.Float(x1, y1); p2 = new Point2D.Float(x2, y2); }
/** * Sets the start point of the subpath. * @param x * @param y */ public void setStartPoint(float x, float y) { this.startPoint = new Point2D.Float(x, y); }
/** * Constructs a new subpath starting at the given point. */ public Subpath(float startPointX, float startPointY) { this.startPoint = new Point2D.Float(startPointX, startPointY); }
/** * Constructs a new line based on the given coordinates. */ public Line(float x1, float y1, float x2, float y2) { p1 = new Point2D.Float(x1, y1); p2 = new Point2D.Float(x2, y2); }