當前位置: 首頁>>代碼示例>>Java>>正文


Java AffineTransform.createInverse方法代碼示例

本文整理匯總了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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:21,代碼來源:WorldScreen.java

示例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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:26,代碼來源:AttributeValues.java

示例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);

}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:29,代碼來源:TexturePaintContext.java


注:本文中的java.awt.geom.AffineTransform.createInverse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。