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


Java AffineTransform.TYPE_IDENTITY屬性代碼示例

本文整理匯總了Java中java.awt.geom.AffineTransform.TYPE_IDENTITY屬性的典型用法代碼示例。如果您正苦於以下問題:Java AffineTransform.TYPE_IDENTITY屬性的具體用法?Java AffineTransform.TYPE_IDENTITY怎麽用?Java AffineTransform.TYPE_IDENTITY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.geom.AffineTransform的用法示例。


在下文中一共展示了AffineTransform.TYPE_IDENTITY屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTransformType

/**
 * Returns the integer type of the affine transform for this
 * <code>FontRenderContext</code> as specified by
 * {@link java.awt.geom.AffineTransform#getType()}
 * @return the type of the transform.
 * @see AffineTransform
 * @since 1.6
 */
public int getTransformType() {
    if (!defaulting) {
        if (tx == null) {
            return AffineTransform.TYPE_IDENTITY;
        } else {
            return tx.getType();
        }
    } else {
        return getTransform().getType();
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:19,代碼來源:FontRenderContext.java

示例2: getTransformType

/**
 * Returns the integer type of the affine transform for this
 * {@code FontRenderContext} as specified by
 * {@link java.awt.geom.AffineTransform#getType()}
 * @return the type of the transform.
 * @see AffineTransform
 * @since 1.6
 */
public int getTransformType() {
    if (!defaulting) {
        if (tx == null) {
            return AffineTransform.TYPE_IDENTITY;
        } else {
            return tx.getType();
        }
    } else {
        return getTransform().getType();
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:19,代碼來源:FontRenderContext.java

示例3: invalidateTransform

protected void invalidateTransform() {
    int type = transform.getType();
    int origTransformState = transformState;
    if (type == AffineTransform.TYPE_IDENTITY) {
        transformState = TRANSFORM_ISIDENT;
        transX = transY = 0;
    } else if (type == AffineTransform.TYPE_TRANSLATION) {
        double dtx = transform.getTranslateX();
        double dty = transform.getTranslateY();
        transX = (int) Math.floor(dtx + 0.5);
        transY = (int) Math.floor(dty + 0.5);
        if (dtx == transX && dty == transY) {
            transformState = TRANSFORM_INT_TRANSLATE;
        } else {
            transformState = TRANSFORM_ANY_TRANSLATE;
        }
    } else if ((type & (AffineTransform.TYPE_FLIP |
                        AffineTransform.TYPE_MASK_ROTATION |
                        AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0)
    {
        transformState = TRANSFORM_TRANSLATESCALE;
        transX = transY = 0;
    } else {
        transformState = TRANSFORM_GENERIC;
        transX = transY = 0;
    }

    if (transformState >= TRANSFORM_TRANSLATESCALE ||
        origTransformState >= TRANSFORM_TRANSLATESCALE)
    {
        /* Its only in this case that the previous or current transform
         * was more than a translate that font info is invalidated
         */
        cachedFRC = null;
        this.validFontInfo = false;
        this.fontMetrics = null;
        this.glyphVectorFontInfo = null;

        if (transformState != origTransformState) {
            invalidatePipe();
        }
    }
    if (strokeState != STROKE_CUSTOM) {
        validateBasicStroke((BasicStroke) stroke);
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:46,代碼來源:SunGraphics2D.java


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