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

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

本文整理了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

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

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

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

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

public TRModel2D clone() {
  TRModel2D trm = new TRModel2D();
  trm.affine.setTransform(affine);
  trm.error = error;
  return trm;
}

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

public TModel2D clone() {
  TModel2D tm = new TModel2D();
  tm.affine.setTransform(affine);
  tm.error = error;
  return tm;
}

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

public TModel2D clone() {
  TModel2D tm = new TModel2D();
  tm.affine.setTransform(affine);
  tm.error = error;
  return tm;
}

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

public TRModel2D clone() {
  TRModel2D trm = new TRModel2D();
  trm.affine.setTransform(affine);
  trm.error = error;
  return trm;
}

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

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

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

public TRModel2D toTRModel2D() {
    TRModel2D trm = new TRModel2D();
    trm.getAffine().setTransform(affine);
    trm.error = error;
    return trm;
  }
}

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

public TRModel2D toTRModel2D() {
    TRModel2D trm = new TRModel2D();
    trm.getAffine().setTransform(affine);
    trm.error = error;
    return trm;
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@Override
public void render(TreeLogger logger, ResourceContext context,
  ClientBundleFields fields, RepeatStyle repeatStyle)
  throws UnableToCompleteException {
 JClassType stringType =
   context.getGeneratorContext().getTypeOracle().findType(String.class.getCanonicalName());
 String contentsExpression = context.deploy(
   localized.getUrl(), null, image.isPreventInlining());
 normalContentsFieldName = fields.define(stringType, "externalImage",
   contentsExpression, true, true);
 if (isRtl) {
  // Create a transformation to mirror about the Y-axis and translate
  AffineTransform tx = new AffineTransform();
  tx.setTransform(-1, 0, 0, 1, rect.getWidth(), 0);
  rect.setTransform(tx);
  byte[] rtlData = ImageBundleBuilder.toPng(logger, rect);
  String rtlContentsUrlExpression = context.deploy(image.getName()
    + "_rtl.png", "image/png", rtlData, image.isPreventInlining());
  rtlContentsFieldName = fields.define(stringType, "externalImage_rtl",
    rtlContentsUrlExpression, true, true);
 }
}

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

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

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

tr.setTransform(global);

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

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

相关文章