Package org.joshy.gfx.draw

Examples of org.joshy.gfx.draw.MultiGradientFill


    @Test public void testArrow() {

    }

    @Test public void testGradientRect() throws Exception {
        MultiGradientFill grad = new LinearGradientFill()
                .setStartX(3).setStartY(0).setEndX(97).setEndY(0)
                .addStop(0, FlatColor.BLUE)
                .addStop(1, FlatColor.RED);
        SRect rect = new SRect(0,0,100,100);
        rect.setFillPaint(grad);
View Full Code Here


        Doc xdoc = saveAndReadback(doc);
        Elem e = xdoc.xpath("/svg/linearGradient/stop").iterator().next();
        assertTrue("0.0".equals(e.attr("offset")));
    }
    @Test public void testLinearGradientRect() throws Exception {
        MultiGradientFill grad = new LinearGradientFill()
                .setStartX(0).setEndX(100)
                .setStartY(0).setEndY(0)
                .addStop(0,FlatColor.GREEN)
                .addStop(0.5,FlatColor.WHITE)
                .addStop(1.0,FlatColor.BLACK);
View Full Code Here

        //center
        s = 5;
        //g.setPaint(new FlatColor(0xa00000));
        double hue = color.getHue();
        MultiGradientFill fill = new LinearGradientFill()
                .setStartX(0).setEndX(0).setStartY(0).setEndY(s * 2)
                .addStop(0, FlatColor.hsb(hue, 0.4, 1.0))
                .addStop(1, FlatColor.hsb(hue, 1.0, 1.0));
        g.setPaint(fill);
        g.translate(x-s,y-s);
View Full Code Here

            g.fillPolygon(new double[]{0.0-s/2,0.0+yoff, s/2,0.0 +yoff,0,s+yoff});
            //center
            s = 10;
            yoff = 1;
            double hue = color.getHue();
            MultiGradientFill fill = new LinearGradientFill()
                    .setStartX(0).setEndX(0).setStartY(0).setEndY(s)
                    .addStop(0,FlatColor.hsb(hue,0.4,1.0))
                    .addStop(1,FlatColor.hsb(hue,1.0,1.0))
                    ;
            g.setPaint(fill);
            g.translate(0,0);
            g.fillPolygon(new double[]{0.0-s/2,0.0+yoff, s/2,0.0 +yoff,0,s+yoff});
            g.translate(0,0);
        } else {
            //shadow
            g.setPaint(new FlatColor(0x404040).deriveWithAlpha(0.5));
            s = 14;
            yoff = 1;
            g.fillPolygon(new double[]{0.0+yoff, 0.0-s/2, 0.0+yoff, s/2,0.0+s +yoff,0});


            //border
            g.setPaint(FlatColor.WHITE);
            s = 14;
            yoff = 0;
            g.fillPolygon(new double[]{0.0+yoff, 0.0-s/2, 0.0+yoff, s/2,0.0+s +yoff,0});
            //center
            s = 10;
            yoff = 1;
            double hue = color.getHue();
            MultiGradientFill fill = new LinearGradientFill()
                    .setStartX(0).setEndX(s).setStartY(0).setEndY(0)
                    .addStop(0,FlatColor.hsb(hue,0.4,1.0))
                    .addStop(1,FlatColor.hsb(hue,1.0,1.0))
                    ;
            g.setPaint(fill);
View Full Code Here

    @Test public void testArrow() {

    }
   
    @Test public void testGradientRect() throws IOException {
        MultiGradientFill grad = new LinearGradientFill()
                .setStartX(3).setStartY(0).setEndX(97).setEndY(0)
                .addStop(0, FlatColor.BLUE)
                .addStop(1, FlatColor.RED);
        SRect rect = new SRect(0,0,100,100);
        rect.setFillPaint(grad);
View Full Code Here

TOP

Related Classes of org.joshy.gfx.draw.MultiGradientFill

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.