sun.java2d.xr.XRSurfaceData.XRInternalSurfaceData Java Examples

The following examples show how to use sun.java2d.xr.XRSurfaceData.XRInternalSurfaceData. 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: XRPaints.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #2
Source File: XRPaints.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #3
Source File: XRPaints.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #4
Source File: XRPaints.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #5
Source File: XRPaints.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #6
Source File: XRPaints.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #7
Source File: XRPaints.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #8
Source File: XRPaints.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #9
Source File: XRPaints.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();
    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    try {
       at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #10
Source File: XRPaints.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();
    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    AffineTransform at = paint.getTransform();

    try {
       at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #11
Source File: XRPaints.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #12
Source File: XRPaints.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #13
Source File: XRPaints.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #14
Source File: XRPaints.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    LinearGradientPaint paint = (LinearGradientPaint) pt;

    Color[] colors = paint.getColors();
    Point2D pt1 = paint.getStartPoint();
    Point2D pt2 = paint.getEndPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #15
Source File: XRPaints.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #16
Source File: XRPaints.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #17
Source File: XRPaints.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #18
Source File: XRPaints.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #19
Source File: XRPaints.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #20
Source File: XRPaints.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #21
Source File: XRPaints.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #22
Source File: XRPaints.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #23
Source File: XRPaints.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #24
Source File: XRPaints.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #25
Source File: XRPaints.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #26
Source File: XRPaints.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #27
Source File: XRPaints.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #28
Source File: XRPaints.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}
 
Example #29
Source File: XRPaints.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    GradientPaint paint = (GradientPaint) pt;

    int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
    float fractions[] = {0, 1};
    int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() });

    Point2D pt1 = paint.getPoint1();
    Point2D pt2 = paint.getPoint2();

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat);
    xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient));
}
 
Example #30
Source File: XRPaints.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
void setXRPaint(SunGraphics2D sg2d, Paint pt) {
    RadialGradientPaint paint = (RadialGradientPaint) pt;
    Color[] colors = paint.getColors();
    Point2D center = paint.getCenterPoint();

    int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
    float[] fractions = paint.getFractions();
    int[] pixels = convertToIntArgbPixels(colors);
    float radius = paint.getRadius();

    float cx = (float) center.getX();
    float cy = (float) center.getY();

    AffineTransform at = paint.getTransform();
    try {
        at.invert();
    } catch (NoninvertibleTransformException ex) {
        ex.printStackTrace();
    }

    XRBackend con = xrCompMan.getBackend();
    int gradient = con.createRadialGradient(cx, cy, 0, radius, fractions, pixels, repeat);
    XRInternalSurfaceData x11sd = new XRSurfaceData.XRInternalSurfaceData(con, gradient);
    x11sd.setStaticSrcTx(at);
    xrCompMan.setGradientPaint(x11sd);
}