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

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

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

AffineTransform.setTransform介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public void setTransform(AffineTransform transform) {
  2. this.transform.setTransform(transform);
  3. }

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

  1. /** Checks for {@linkplain #checkPermission permission} before setting this transform. */
  2. @Override
  3. public void setTransform(
  4. double m00, double m10, double m01, double m11, double m02, double m12) {
  5. checkPermission();
  6. super.setTransform(m00, m10, m01, m11, m02, m12);
  7. }

代码示例来源:origin: dermotte/LIRE

  1. public TRModel2D clone() {
  2. TRModel2D trm = new TRModel2D();
  3. trm.affine.setTransform(affine);
  4. trm.error = error;
  5. return trm;
  6. }

代码示例来源:origin: dermotte/LIRE

  1. public TModel2D clone() {
  2. TModel2D tm = new TModel2D();
  3. tm.affine.setTransform(affine);
  4. tm.error = error;
  5. return tm;
  6. }

代码示例来源:origin: dermotte/LIRE

  1. public TModel2D clone() {
  2. TModel2D tm = new TModel2D();
  3. tm.affine.setTransform(affine);
  4. tm.error = error;
  5. return tm;
  6. }

代码示例来源:origin: dermotte/LIRE

  1. public TRModel2D clone() {
  2. TRModel2D trm = new TRModel2D();
  3. trm.affine.setTransform(affine);
  4. trm.error = error;
  5. return trm;
  6. }

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

  1. /** Checks for {@linkplain #checkPermission permission} before setting this transform. */
  2. @Override
  3. public void setTransform(AffineTransform Tx) {
  4. checkPermission();
  5. super.setTransform(Tx);
  6. }

代码示例来源:origin: dermotte/LIRE

  1. public TRModel2D toTRModel2D() {
  2. TRModel2D trm = new TRModel2D();
  3. trm.getAffine().setTransform(affine);
  4. trm.error = error;
  5. return trm;
  6. }
  7. }

代码示例来源:origin: dermotte/LIRE

  1. public TRModel2D toTRModel2D() {
  2. TRModel2D trm = new TRModel2D();
  3. trm.getAffine().setTransform(affine);
  4. trm.error = error;
  5. return trm;
  6. }
  7. }

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

  1. private void transformGraphics(Graphics2D g, Vec2 center) {
  2. Vec2 e = viewportTransform.getExtents();
  3. Vec2 vc = viewportTransform.getCenter();
  4. Mat22 vt = viewportTransform.getMat22Representation();
  5. int flip = yFlip ? -1 : 1;
  6. tr.setTransform(vt.ex.x, flip * vt.ex.y, vt.ey.x, flip * vt.ey.y, e.x, e.y);
  7. tr.translate(-vc.x, -vc.y);
  8. tr.translate(center.x, center.y);
  9. g.transform(tr);
  10. }

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

  1. /**
  2. * Checks whether the matrix coefficients are close to whole numbers. If this is the case, these
  3. * coefficients will be rounded up to the nearest whole numbers. This rounding up is useful, for
  4. * example, for speeding up image displays. Above all, it is efficient when we know that a
  5. * matrix has a chance of being close to the similarity matrix.
  6. *
  7. * @param tr The matrix to round. Rounding will be applied in place.
  8. * @param tolerance The maximal departure from integers in order to allow rounding. It is
  9. * typically a small number like {@code 1E-6}.
  10. * @since 2.3.1
  11. */
  12. public static void round(final AffineTransform tr, final double tolerance) {
  13. double r;
  14. final double m00, m01, m10, m11;
  15. if (Math.abs((m00 = Math.rint(r = tr.getScaleX())) - r) <= tolerance
  16. && Math.abs((m01 = Math.rint(r = tr.getShearX())) - r) <= tolerance
  17. && Math.abs((m11 = Math.rint(r = tr.getScaleY())) - r) <= tolerance
  18. && Math.abs((m10 = Math.rint(r = tr.getShearY())) - r) <= tolerance) {
  19. if ((m00 != 0 || m01 != 0) && (m10 != 0 || m11 != 0)) {
  20. double m02 = Math.rint(r = tr.getTranslateX());
  21. if (!(Math.abs(m02 - r) <= tolerance)) m02 = r;
  22. double m12 = Math.rint(r = tr.getTranslateY());
  23. if (!(Math.abs(m12 - r) <= tolerance)) m12 = r;
  24. tr.setTransform(m00, m10, m01, m11, m02, m12);
  25. }
  26. }
  27. }
  28. }

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

  1. final double dxRow = (grid[offset01 + X_OFFSET] - x) * sgnRow;
  2. final double dyRow = (grid[offset01 + Y_OFFSET] - y) * sgnRow;
  3. dest.setTransform(
  4. dxCol,
  5. dyCol,

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

  1. for (LineInfo line : lines) {
  2. for (LineComponent component : line.getComponents()) {
  3. lineTx.setTransform(newTransform);
  4. lineTx.translate(component.getX(), line.getY());
  5. graphics.setTransform(lineTx);

代码示例来源:origin: dermotte/LIRE

  1. affine.setTransform(cos, sin, -sin, cos, tx, ty);

代码示例来源:origin: dermotte/LIRE

  1. affine.setTransform(cos, sin, -sin, cos, tx, ty);

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

  1. tempTransform.setTransform(original);
  2. setupPointTransform(tempTransform, centroid, textStyle, painter);

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public void render(TreeLogger logger, ResourceContext context,
  3. ClientBundleFields fields, RepeatStyle repeatStyle)
  4. throws UnableToCompleteException {
  5. JClassType stringType =
  6. context.getGeneratorContext().getTypeOracle().findType(String.class.getCanonicalName());
  7. String contentsExpression = context.deploy(
  8. localized.getUrl(), null, image.isPreventInlining());
  9. normalContentsFieldName = fields.define(stringType, "externalImage",
  10. contentsExpression, true, true);
  11. if (isRtl) {
  12. // Create a transformation to mirror about the Y-axis and translate
  13. AffineTransform tx = new AffineTransform();
  14. tx.setTransform(-1, 0, 0, 1, rect.getWidth(), 0);
  15. rect.setTransform(tx);
  16. byte[] rtlData = ImageBundleBuilder.toPng(logger, rect);
  17. String rtlContentsUrlExpression = context.deploy(image.getName()
  18. + "_rtl.png", "image/png", rtlData, image.isPreventInlining());
  19. rtlContentsFieldName = fields.define(stringType, "externalImage_rtl",
  20. rtlContentsUrlExpression, true, true);
  21. }
  22. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. tx.setTransform(-1, 0, 0, 1, imageRect.getWidth(), 0);
  2. imageRect.setTransform(tx);

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

  1. tr.setTransform(global);

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

  1. tr.setTransform(0, 1, f, 0, 0, 0);
  2. assertEquals(1, XAffineTransform.getScaleX0(tr), EPS);
  3. assertEquals(1, XAffineTransform.getScaleY0(tr), EPS);

相关文章