当前位置: 首页>>代码示例>>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;未经允许,请勿转载。