Java Code Examples for sun.java2d.SunGraphics2D#TRANSFORM_ANY_TRANSLATE

The following examples show how to use sun.java2d.SunGraphics2D#TRANSFORM_ANY_TRANSLATE . 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: CGLSurfaceData.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 2
Source File: CGLSurfaceData.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 3
Source File: CGLSurfaceData.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 4
Source File: CGLSurfaceData.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 5
Source File: CGLSurfaceData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 6
Source File: CGLSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 7
Source File: CGLSurfaceData.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 8
Source File: CGLSurfaceData.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 9
Source File: CGLSurfaceData.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 10
Source File: CGLSurfaceData.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}
 
Example 11
Source File: CGLSurfaceData.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
                        int dx, int dy) {
    final int state = sg2d.transformState;
    if (state > SunGraphics2D.TRANSFORM_TRANSLATESCALE
        || sg2d.compositeState >= SunGraphics2D.COMP_XOR) {
        return false;
    }
    if (state <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE) {
        x += sg2d.transX;
        y += sg2d.transY;
    } else if (state == SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
        final double[] coords = {x, y, x + w, y + h, x + dx, y + dy};
        sg2d.transform.transform(coords, 0, coords, 0, 3);
        x = (int) Math.ceil(coords[0] - 0.5);
        y = (int) Math.ceil(coords[1] - 0.5);
        w = ((int) Math.ceil(coords[2] - 0.5)) - x;
        h = ((int) Math.ceil(coords[3] - 0.5)) - y;
        dx = ((int) Math.ceil(coords[4] - 0.5)) - x;
        dy = ((int) Math.ceil(coords[5] - 0.5)) - y;
    }
    oglRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy);
    return true;
}