public Point2D.Double getHandlePoint(int index) { Predicate<List<Point2D.Double>> validateIndex = list -> list.size() > index; Function<List<Point2D.Double>, Point2D.Double> getPoint = list -> list.get(index); Function<Point2D.Double, Point2D.Double> cloneValue = point -> (Point2D.Double) point.clone(); return Optional.of(pts).filter(validateIndex).map(getPoint).map(cloneValue).orElse(null); }
public Point2D getStartPoint() { updateTool(); return ptA == null ? null : (Point2D) ptA.clone(); }
public Point2D getEndPoint() { updateTool(); return ptB == null ? null : (Point2D) ptB.clone(); }
@Override public Object getTransformRestoreData() { Point2D.Double[] restoredCoordinates = (Point2D.Double[]) this.coordinates.clone(); for (int i=0; i < this.coordinates.length; i++) { restoredCoordinates[i] = (Point2D.Double) this.coordinates[i].clone(); } return new Object[] { TRANSFORM.getClone(this), restoredCoordinates, FILL_GRADIENT.getClone(this), STROKE_GRADIENT.getClone(this), }; }
@Override public Object getTransformRestoreData() { return origin.clone(); }
@Override public SVGTextFigure clone() { SVGTextFigure that = (SVGTextFigure) super.clone(); that.coordinates = new Point2D.Double[this.coordinates.length]; for (int i=0; i < this.coordinates.length; i++) { that.coordinates[i] = (Point2D.Double) this.coordinates[i].clone(); } that.rotates = (double[]) this.rotates.clone(); that.cachedBounds = null; that.cachedDrawingArea = null; that.cachedTextShape = null; return that; }
@Override public DirectPosition2D clone() { return (DirectPosition2D) super.clone(); }
/** * Returns a clone of this point. * * @return a clone of this position. */ @Override public DirectPosition2D clone() { return (DirectPosition2D) super.clone(); } }
protected void setHandlePointList(Point2D.Double ptAnchor, Point2D.Double ptBox) { Point2D.Double pt2 = (ptBox == null && ptAnchor != null) ? ptAnchor : ptBox; Point2D.Double pt1 = (pt2 != null && pt2.equals(ptAnchor)) ? null : ptAnchor; setHandlePoint(0, pt1 == null ? null : (Point2D.Double) pt1.clone()); setHandlePoint(1, pt2 == null ? null : (Point2D.Double) pt2.clone()); buildShape(null); }
public Point2D.Double[] getCoordinates() { Point2D.Double[] c = new Point2D.Double[coordinates.length]; for (int i=0; i < c.length; i++) { c[i] = (Point2D.Double) coordinates[i].clone(); } return c; }
@Override public TextFigure clone() { TextFigure that = (TextFigure) super.clone(); that.origin = (Point2D.Double) this.origin.clone(); that.textLayout = null; return that; }
public static Point2D.Double[] copy(final Point2D.Double[] _ini) { if (_ini == null) { return null; } final Point2D.Double[] res = new Point2D.Double[_ini.length]; for (int i = res.length - 1; i >= 0; i--) { res[i] = (Point2D.Double) _ini[i].clone(); } return res; }
public Point2D getEndPoint() { updateTool(); return ptB == null ? null : (Point2D) ptB.clone(); } }
@Override public void restoreTransformTo(Object geometry) { Object[] restoreData = (Object[]) geometry; TRANSFORM.setClone(this, (AffineTransform) restoreData[0]); Point2D.Double[] restoredCoordinates = (Point2D.Double[]) restoreData[1]; for (int i=0; i < this.coordinates.length; i++) { coordinates[i] = (Point2D.Double) restoredCoordinates[i].clone(); } FILL_GRADIENT.setClone(this, (Gradient) restoreData[2]); STROKE_GRADIENT.setClone(this, (Gradient) restoreData[3]); invalidate(); }
/** * Returns a clone of this point. * * @return a clone of this position. */ @Override public DirectPosition2D clone() { return (DirectPosition2D) super.clone(); } }
@Override public Object clone () { return super.clone(); //To change body of generated methods, choose Tools | Templates. } }
public Point2D.Double getImageCoordinates() { return (Point2D.Double) point2d.clone(); }
/** * Returns a clone of this point. * * @return A clone of this position. */ @Override public DirectPosition2D clone() { return (DirectPosition2D) super.clone(); }