本文整理汇总了Java中java.awt.geom.AffineTransform.setTransform方法的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform.setTransform方法的具体用法?Java AffineTransform.setTransform怎么用?Java AffineTransform.setTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.AffineTransform
的用法示例。
在下文中一共展示了AffineTransform.setTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractRotation
import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
private static AffineTransform extractRotation(Point2D.Double pt,
AffineTransform tx, boolean andTranslation) {
tx.deltaTransform(pt, pt);
AffineTransform rtx = AffineTransform.getRotateInstance(pt.x, pt.y);
try {
AffineTransform rtxi = rtx.createInverse();
double dx = tx.getTranslateX();
double dy = tx.getTranslateY();
tx.preConcatenate(rtxi);
if (andTranslation) {
if (dx != 0 || dy != 0) {
tx.setTransform(tx.getScaleX(), tx.getShearY(),
tx.getShearX(), tx.getScaleY(), 0, 0);
rtx.setTransform(rtx.getScaleX(), rtx.getShearY(),
rtx.getShearX(), rtx.getScaleY(), dx, dy);
}
}
}
catch (NoninvertibleTransformException e) {
return null;
}
return rtx;
}
示例2: getStrike
import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
public FontStrike getStrike(Font font, FontRenderContext frc) {
AffineTransform at = frc.getTransform();
double ptSize = font.getSize2D();
at.scale(ptSize, ptSize);
if (font.isTransformed()) {
at.concatenate(font.getTransform());
if (at.getTranslateX() != 0 || at.getTranslateY() != 0) {
at.setTransform(at.getScaleX(),
at.getShearY(),
at.getShearX(),
at.getScaleY(),
0.0, 0.0);
}
}
int aa = FontStrikeDesc.getAAHintIntVal(this, font, frc);
int fm = FontStrikeDesc.getFMHintIntVal(frc.getFractionalMetricsHint());
FontStrikeDesc desc = new FontStrikeDesc(frc.getTransform(),
at, font.getStyle(),
aa, fm);
return getStrike(desc, false);
}
示例3: concatfix
import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
public void concatfix(AffineTransform at) {
double m00 = at.getScaleX();
double m10 = at.getShearY();
double m01 = at.getShearX();
double m11 = at.getScaleY();
double m02 = at.getTranslateX();
double m12 = at.getTranslateY();
if (Math.abs(m00-1.0) < 1E-10) m00 = 1.0;
if (Math.abs(m11-1.0) < 1E-10) m11 = 1.0;
if (Math.abs(m02) < 1E-10) m02 = 0.0;
if (Math.abs(m12) < 1E-10) m12 = 0.0;
if (Math.abs(m01) < 1E-15) m01 = 0.0;
if (Math.abs(m10) < 1E-15) m10 = 0.0;
at.setTransform(m00, m10,
m01, m11,
m02, m12);
}