Java Code Examples for java.awt.geom.AffineTransform#TYPE_FLIP

The following examples show how to use java.awt.geom.AffineTransform#TYPE_FLIP . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WPathGraphics.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 2
Source File: WPathGraphics.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 3
Source File: WPathGraphics.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 4
Source File: WPathGraphics.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 5
Source File: WPathGraphics.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 6
Source File: WPathGraphics.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 7
Source File: WPathGraphics.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 8
Source File: WPathGraphics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 9
Source File: WPathGraphics.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 10
Source File: WPathGraphics.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example 11
Source File: AffineTransforms2DTest.java    From sis with Apache License 2.0 4 votes vote down vote up
/**
 * Gets the flip state using standard {@code AffineTransform} API.
 */
private static int getFlipFromType(final AffineTransform tr) {
    return (tr.getType() & AffineTransform.TYPE_FLIP) != 0 ? -1 : +1;
}
 
Example 12
Source File: SunGraphics2D.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
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);
    }
}
 
Example 13
Source File: SunGraphics2D.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 14
Source File: SunGraphics2D.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 15
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 16
Source File: SunGraphics2D.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 17
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 18
Source File: SunGraphics2D.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 19
Source File: SunGraphics2D.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example 20
Source File: SunGraphics2D.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}