本文整理汇总了Java中java.awt.geom.AffineTransform.createInverse方法的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform.createInverse方法的具体用法?Java AffineTransform.createInverse怎么用?Java AffineTransform.createInverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.AffineTransform
的用法示例。
在下文中一共展示了AffineTransform.createInverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScreentoWorld
import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
public static Point2D getScreentoWorld(double x, double y) throws Exception {
Rectangle imageBounds=null;
ReferencedEnvelope mapBounds=null;
try{
// mapBounds=map.getLayerBounds();
imageBounds = mapFrame.getBounds();
int width = (int)imageBounds.getWidth();
int height = (int)imageBounds.getHeight();
}catch(Exception e){
}
AffineTransform world2screen =
RendererUtilities.worldToScreenTransform(mapBounds, imageBounds);
AffineTransform screen2world = world2screen.createInverse();
Point2D pointScreenAbsolute = new Point2D.Double(x, y);
Point2D pointScreen = screen2world.transform(pointScreenAbsolute, null);
return pointScreen;
}
示例2: 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;
}
示例3: TexturePaintContext
import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
TexturePaintContext(ColorModel cm, AffineTransform xform,
int bWidth, int bHeight, int maxw) {
this.colorModel = getInternedColorModel(cm);
this.bWidth = bWidth;
this.bHeight = bHeight;
this.maxWidth = maxw;
try {
xform = xform.createInverse();
} catch (NoninvertibleTransformException e) {
xform.setToScale(0, 0);
}
this.incXAcross = mod(xform.getScaleX(), bWidth);
this.incYAcross = mod(xform.getShearY(), bHeight);
this.incXDown = mod(xform.getShearX(), bWidth);
this.incYDown = mod(xform.getScaleY(), bHeight);
this.xOrg = xform.getTranslateX();
this.yOrg = xform.getTranslateY();
this.colincx = (int) incXAcross;
this.colincy = (int) incYAcross;
this.colincxerr = fractAsInt(incXAcross);
this.colincyerr = fractAsInt(incYAcross);
this.rowincx = (int) incXDown;
this.rowincy = (int) incYDown;
this.rowincxerr = fractAsInt(incXDown);
this.rowincyerr = fractAsInt(incYDown);
}