public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { double det = getDeterminant(); if (Math.abs(det) < ZERO) { // awt.204=Determinant is zero throw new NoninvertibleTransformException(Messages.getString("awt.204")); //$NON-NLS-1$ } if (dst == null) { if (src instanceof Point2D.Double) { dst = new Point2D.Double(); } else { dst = new Point2D.Float(); } } double x = src.getX() - m02; double y = src.getY() - m12; dst.setLocation((x * m11 - y * m01) / det, (y * m00 - x * m10) / det); return dst; }
public void transform(Point2D[] src, int srcOff, Point2D[] dst, int dstOff, int length) { while (--length >= 0) { Point2D srcPoint = src[srcOff++]; double x = srcPoint.getX(); double y = srcPoint.getY(); Point2D dstPoint = dst[dstOff]; if (dstPoint == null) { if (srcPoint instanceof Point2D.Double) { dstPoint = new Point2D.Double(); } else { dstPoint = new Point2D.Float(); } } dstPoint.setLocation(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12); dst[dstOff++] = dstPoint; } }
public void transform(Point2D[] src, int srcOff, Point2D[] dst, int dstOff, int length) { while (--length >= 0) { Point2D srcPoint = src[srcOff++]; double x = srcPoint.getX(); double y = srcPoint.getY(); Point2D dstPoint = dst[dstOff]; if (dstPoint == null) { if (srcPoint instanceof Point2D.Double) { dstPoint = new Point2D.Double(); } else { dstPoint = new Point2D.Float(); } } dstPoint.setLocation(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12); dst[dstOff++] = dstPoint; } }
public Point2D getCurrentPoint() { if (typeSize == 0) { return null; } int j = pointSize - 2; if (types[typeSize - 1] == PathIterator.SEG_CLOSE) { for (int i = typeSize - 2; i > 0; i--) { int type = types[i]; if (type == PathIterator.SEG_MOVETO) { break; } j -= pointShift[type]; } } return new Point2D.Float(points[j], points[j + 1]); }
/** * Appends a cubic Bezier curve to the current path. The curve shall extend from * the current point to the point <CODE>(x3, y3)</CODE>. */ public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) { if (currentPoint == null) { throw new RuntimeException(START_PATH_ERR_MSG); } // Numbered in natural order Point2D secondPoint = new Point2D.Float(x1, y1); Point2D thirdPoint = new Point2D.Float(x2, y2); Point2D fourthPoint = new Point2D.Float(x3, y3); List<Point2D> controlPoints = new ArrayList(Arrays.asList(currentPoint, secondPoint, thirdPoint, fourthPoint)); getLastSubpath().addSegment(new BezierCurve(controlPoints)); currentPoint = fourthPoint; }
public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { double det = getDeterminant(); if (Math.abs(det) < ZERO) { // awt.204=Determinant is zero throw new NoninvertibleTransformException(Messages.getString("awt.204")); //$NON-NLS-1$ } if (dst == null) { if (src instanceof Point2D.Double) { dst = new Point2D.Double(); } else { dst = new Point2D.Float(); } } double x = src.getX() - m02; double y = src.getY() - m12; dst.setLocation((x * m11 - y * m01) / det, (y * m00 - x * m10) / det); return dst; }
/** * Appends a cubic Bezier curve to the current path. The curve shall extend from * the current point to the point <CODE>(x3, y3)</CODE>. */ public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) { if (currentPoint == null) { throw new RuntimeException(START_PATH_ERR_MSG); } // Numbered in natural order Point2D secondPoint = new Point2D.Float(x1, y1); Point2D thirdPoint = new Point2D.Float(x2, y2); Point2D fourthPoint = new Point2D.Float(x3, y3); List<Point2D> controlPoints = new ArrayList(Arrays.asList(currentPoint, secondPoint, thirdPoint, fourthPoint)); getLastSubpath().addSegment(new BezierCurve(controlPoints)); currentPoint = fourthPoint; }
public Point2D getCurrentPoint() { if (typeSize == 0) { return null; } int j = pointSize - 2; if (types[typeSize - 1] == PathIterator.SEG_CLOSE) { for (int i = typeSize - 2; i > 0; i--) { int type = types[i]; if (type == PathIterator.SEG_MOVETO) { break; } j -= pointShift[type]; } } return new Point2D.Float(points[j], points[j + 1]); }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
@Override public Point2D getCtrlP1() { return new Point2D.Float(ctrlx1, ctrly1); }
public Point2D transform(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 + m02, x * m10 + y * m11 + m12); return dst; }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
@Override public Point2D getP1() { return new Point2D.Float(x1, y1); }
@Override public Point2D getP1() { return new Point2D.Float(x1, y1); }
@Override public Point2D getP1() { return new Point2D.Float(x1, y1); }
@Override public Point2D getCtrlPt() { return new Point2D.Float(ctrlx, ctrly); }
@Override public Point2D getCtrlP1() { return new Point2D.Float(ctrlx1, ctrly1); }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }
public Point2D transform(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 + m02, x * m10 + y * m11 + m12); return dst; }
@Override public Point2D getP2() { return new Point2D.Float(x2, y2); }