java.awt.geom.AffineTransform.clone()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中java.awt.geom.AffineTransform.clone()方法的一些代码示例,展示了AffineTransform.clone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffineTransform.clone()方法的具体详情如下:
包路径:java.awt.geom.AffineTransform
类名称:AffineTransform
方法名:clone

AffineTransform.clone介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

  1. public void setTransform( float translationX, float translationY, int shadowsize, float magnification ) {
  2. // PDI-9953 - always use original GC's transform.
  3. AffineTransform transform = (AffineTransform) originalTransform.clone();
  4. transform.translate( translationX + shadowsize * magnification, translationY + shadowsize * magnification );
  5. transform.scale( magnification, magnification );
  6. gc.setTransform( transform );
  7. }

代码示例来源:origin: org.apache.poi/poi

  1. public AffineTransform getTransform()
  2. {
  3. return (AffineTransform)getTrans().clone();
  4. }

代码示例来源:origin: org.apache.poi/poi

  1. public void setTransform(AffineTransform affinetransform)
  2. {
  3. setTrans( (AffineTransform)affinetransform.clone() );
  4. }

代码示例来源:origin: org.apache.poi/poi

  1. public boolean drawImage(Image image, AffineTransform affinetransform, ImageObserver imageobserver)
  2. {
  3. AffineTransform affinetransform1 = (AffineTransform)getTrans().clone();
  4. getTrans().concatenate(affinetransform);
  5. drawImage(image, 0, 0, imageobserver);
  6. setTrans( affinetransform1 );
  7. return true;
  8. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * The visitor will first visit this shape, then it's children
  3. *
  4. * This is useful because exceptions will be marked with the shapes as it
  5. * propagates up the shape hierarchy.
  6. */
  7. public void visitShapes(ShapeVisitor visitor, AffineTransform tr, int level) {
  8. tr = (AffineTransform) tr.clone();
  9. tr.concatenate(getParentTransform());
  10. try {
  11. if (visitor.accept(this)) {
  12. visitor.visit(this, tr, level);
  13. }
  14. if (_shapes != null) {
  15. for (XDGFShape shape : _shapes) {
  16. shape.visitShapes(visitor, tr, level + 1);
  17. }
  18. }
  19. } catch (StopVisitingThisBranch e) {
  20. // intentionally empty
  21. } catch (POIXMLException e) {
  22. throw XDGFException.wrap(this.toString(), e);
  23. }
  24. }

代码示例来源:origin: geotools/geotools

  1. /** Returns a clone of this affine transform. */
  2. @Override
  3. public AffineTransform2D clone() {
  4. return (AffineTransform2D) super.clone();
  5. }

代码示例来源:origin: nodebox/nodebox

  1. public Transform(Transform other) {
  2. this.affineTransform = (AffineTransform) other.affineTransform.clone();
  3. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Returns an affine transform for the whole grid. This transform is only an approximation for
  3. * this localization grid. It is fitted (like "curve fitting") to grid data using the "least
  4. * squares" method.
  5. *
  6. * @return A global affine transform as an approximation for the whole localization grid.
  7. */
  8. public synchronized AffineTransform getAffineTransform() {
  9. if (global == null) {
  10. final double[] matrix = new double[6];
  11. fitPlane(X_OFFSET, matrix);
  12. assert X_OFFSET == 0 : X_OFFSET;
  13. fitPlane(Y_OFFSET, matrix);
  14. assert Y_OFFSET == 1 : Y_OFFSET;
  15. global = new AffineTransform(matrix);
  16. }
  17. return (AffineTransform) global.clone();
  18. }

代码示例来源:origin: apache/pdfbox

  1. /**
  2. * Not called in TexturePaint subclasses, which is why we wrap TexturePaint.
  3. */
  4. @Override
  5. public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds,
  6. AffineTransform xform, RenderingHints hints)
  7. {
  8. AffineTransform xformPattern = (AffineTransform)xform.clone();
  9. // applies the pattern matrix with scaling removed
  10. AffineTransform patternNoScale = patternMatrix.createAffineTransform();
  11. patternNoScale.scale(1 / patternMatrix.getScalingFactorX(),
  12. 1 / patternMatrix.getScalingFactorY());
  13. xformPattern.concatenate(patternNoScale);
  14. return paint.createContext(cm, deviceBounds, userBounds, xformPattern, hints);
  15. }

代码示例来源:origin: apache/pdfbox

  1. AffineTransform transform = (AffineTransform)graphics2D.getTransform().clone();
  2. graphics2D.setBackground(Color.WHITE);
  3. renderer.setSubsamplingAllowed(subsamplingAllowed);

代码示例来源:origin: apache/pdfbox

  1. AffineTransform at = (AffineTransform) flip.clone();
  2. at.concatenate(text.getTextMatrix().createAffineTransform());
  3. AffineTransform at = (AffineTransform) flip.clone();
  4. at.concatenate(text.getTextMatrix().createAffineTransform());

代码示例来源:origin: apache/pdfbox

  1. AffineTransform shadingToDevice = (AffineTransform)xform.clone();
  2. shadingToDevice.concatenate(matrix.createAffineTransform());

代码示例来源:origin: apache/pdfbox

  1. AffineTransform shadingToDevice = (AffineTransform)xform.clone();
  2. shadingToDevice.concatenate(matrix.createAffineTransform());

代码示例来源:origin: org.jfree/jfreesvg

  1. /**
  2. * Returns a copy of the current transform.
  3. *
  4. * @return A copy of the current transform (never {@code null}).
  5. *
  6. * @see #setTransform(java.awt.geom.AffineTransform)
  7. */
  8. @Override
  9. public AffineTransform getTransform() {
  10. return (AffineTransform) this.transform.clone();
  11. }

代码示例来源:origin: geotools/geotools

  1. (AffineTransform) requestedGridToWorld.clone();
  2. mutableTransform.preConcatenate((AffineTransform) destinationToSourceTransform);

代码示例来源:origin: geotools/geotools

  1. AffineTransform mutableTransform = (AffineTransform) requestedGridToWorld.clone();
  2. mutableTransform.preConcatenate((AffineTransform) destinationToSourceTransform);

代码示例来源:origin: geotools/geotools

  1. AffineTransform mutableTransform = (AffineTransform) requestedGridToWorld.clone();
  2. mutableTransform.preConcatenate((AffineTransform) destinationToSourceTransform);

代码示例来源:origin: geotools/geotools

  1. (AffineTransform) finalWorldToGrid.clone();
  2. finalRasterTransformation.concatenate(finalGCgridToWorld);

代码示例来源:origin: danfickle/openhtmltopdf

  1. /**
  2. * Creates an absolute transform in document coordinates. This is typically used to figure out what pages the box will
  3. * fall on. The <code>_parentCtm</code> may be null in case the parent layer uses the identity tranform. If it is not null
  4. * it will be cloned before use.
  5. */
  6. public static AffineTransform createDocumentCoordinatesTransform(Box master, CssContext c, AffineTransform _parentCtm) {
  7. AffineTransform ctm = _parentCtm == null ? new AffineTransform() : (AffineTransform) _parentCtm.clone();
  8. createTransform(c, master, null, ctm, TransformYOrigin.DOCUMENT_TOP, -1);
  9. return ctm;
  10. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Implements {@link SVGMatrix#skewY(float)}.
  3. */
  4. public SVGMatrix skewY(float angleDeg ) {
  5. AffineTransform tr = (AffineTransform)getAffineTransform().clone();
  6. tr.concatenate
  7. (AffineTransform.getShearInstance(0, Math.tan( Math.toRadians( angleDeg ) ) ));
  8. return new SVGOMMatrix(tr);
  9. }
  10. }

相关文章