/** * Delegates to the enclosed <code>GeneralPath</code>. */ public Object clone() { try { final ExtendedGeneralPath result = (ExtendedGeneralPath) super.clone(); result.path = (GeneralPath) path.clone(); if (values != null) { result.values = new double[values.length]; System.arraycopy(values, 0, result.values, 0, values.length); } result.numVals = numVals; if (types != null) { result.types = new int[types.length]; System.arraycopy(types, 0, result.types, 0, types.length); } result.numSeg = numSeg; return result; } catch (CloneNotSupportedException ex) { ex.printStackTrace(); } return null; }
/** * Fills and then strokes the path. * * @param windingRule The winding rule this path will use. * @throws IOException If there is an IO error while filling the path. */ @Override public void fillAndStrokePath(int windingRule) throws IOException { // TODO can we avoid cloning the path? GeneralPath path = (GeneralPath)linePath.clone(); fillPath(windingRule); linePath = path; strokePath(); }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
private void updateComputingPath() { if (npoints >= 1) { if (closedPath == null) { closedPath = (GeneralPath)path.clone(); closedPath.closePath(); } } }
@Override public Path clone() { try { Path clone = (Path) super.clone(); clone.generalPath = (GeneralPath) generalPath.clone(); return clone; } catch (CloneNotSupportedException e) { throw new IllegalStateException("cannot clone?", e); } } }
/** * Creates a new object of the same class as this object. * * @return a clone of this instance. * @exception OutOfMemoryError if there is not enough memory. * @see java.lang.Cloneable */ @Override public Object clone() { try { GrappaShape copy = (GrappaShape) super.clone(); copy.path = (GeneralPath) this.path.clone(); return copy; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Delegates to the enclosed <code>GeneralPath</code>. */ public Object clone() { try { ExtendedGeneralPath result = (ExtendedGeneralPath) super.clone(); result.path = (GeneralPath) path.clone(); if ( values != null ){ result.values = new float[values.length]; System.arraycopy(values, 0, result.values, 0, values.length); } result.numVals = numVals; if ( types != null ){ result.types = new int[types.length]; System.arraycopy(types, 0, result.types, 0, types.length); } result.numSeg = numSeg; return result; } catch (CloneNotSupportedException ex) {} return null; }
/**Returns a deep copy of the argument. */ static Shape cloneShape(Shape rhs) { if(rhs==null) return null; if(rhs instanceof Rectangle2D.Double) { return (Rectangle2D.Double)((Rectangle2D.Double)rhs).clone(); } else if(rhs instanceof Ellipse2D.Double) { return (Ellipse2D.Double)((Ellipse2D.Double)rhs).clone(); } else if(rhs instanceof Line2D.Double) { return (Line2D.Double)((Line2D.Double)rhs).clone(); } else if(rhs instanceof Polygon) { return new Polygon(((Polygon)rhs).xpoints, ((Polygon)rhs).ypoints, ((Polygon)rhs).npoints); } else if(rhs instanceof GeneralPath) { return (GeneralPath)((GeneralPath)rhs).clone(); } return new GeneralPath(); // dodgy !!! }
/**Returns a deep copy of the argument. */ static Shape cloneShape(Shape rhs) { if(rhs==null) return null; if(rhs instanceof Rectangle2D.Double) { return (Rectangle2D.Double)((Rectangle2D.Double)rhs).clone(); } else if(rhs instanceof Ellipse2D.Double) { return (Ellipse2D.Double)((Ellipse2D.Double)rhs).clone(); } else if(rhs instanceof Line2D.Double) { return (Line2D.Double)((Line2D.Double)rhs).clone(); } else if(rhs instanceof Polygon) { return new Polygon(((Polygon)rhs).xpoints, ((Polygon)rhs).ypoints, ((Polygon)rhs).npoints); } else if(rhs instanceof GeneralPath) { return (GeneralPath)((GeneralPath)rhs).clone(); } return new GeneralPath(); // dodgy !!! }
/** * Fills and then strokes the path. * * @param windingRule The winding rule this path will use. * @throws IOException If there is an IO error while filling the path. */ @Override public void fillAndStrokePath(int windingRule) throws IOException { // TODO can we avoid cloning the path? GeneralPath path = (GeneralPath)linePath.clone(); fillPath(windingRule); linePath = path; strokePath(); }
/** * Fills and then strokes the path. * * @param windingRule The winding rule this path will use. * @throws IOException If there is an IO error while filling the path. */ @Override public void fillAndStrokePath(int windingRule) throws IOException { // TODO can we avoid cloning the path? GeneralPath path = (GeneralPath)linePath.clone(); fillPath(windingRule); linePath = path; strokePath(); }
public ShapeTransform copy() { return new Top((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); } }
public ShapeTransform copy() { return new Left((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); } }
public ShapeTransform copy() { return new Right((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
public ShapeTransform copy() { return new Bottom((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
/** * fill and stroke the path. * @param operator The operator that is being executed. * @param arguments List * * @throws IOException If an error occurs while processing the font. */ public void process(PDFOperator operator, List arguments) throws IOException { PDFObjectExtractor drawer = (PDFObjectExtractor)context; drawer.simpleFillPath(); GeneralPath currentPath = (GeneralPath)drawer.getLinePath().clone(); context.processOperator( "f", arguments ); drawer.setLinePath( currentPath ); context.processOperator( "S", arguments ); } }