Package org.jdesktop.swingx.painter

Examples of org.jdesktop.swingx.painter.PinstripePainter


     * @return
     */
    public static Painter createAnimatedPainter() {
        final AlphaPainter alpha = new AlphaPainter();
        alpha.setAlpha(1f);
        final PinstripePainter pinstripePainter = new PinstripePainter(PINSTRIPE_COLOR,45,3,3);
        alpha.setPainters(new MattePainter(MATCH_COLOR), pinstripePainter);
        ActionListener l = new ActionListener() {
            boolean add;
            public void actionPerformed(ActionEvent e) {
                float a = add ? (alpha.getAlpha() + 0.1f) : (alpha.getAlpha() - 0.1f);
                if (a > 1.0) {
                    a = 1f;
                    add = false;
                } else if (a < 0) {
                    a = 0;
                    add = true;
                }
                alpha.setAlpha(a);
                pinstripePainter.setAngle(pinstripePainter.getAngle()+10);
            }
           
        };
        new Timer(100, l).start();
        return alpha;
View Full Code Here


   
    private MutableTreeNode createPinstripePainterDemos() {
        DefaultMutableTreeNode node = createInfoNode("Pinstripe Painter Demos", null);
        MattePainter black = new MattePainter(Color.BLACK);
       
        PinstripePainter pp = new PinstripePainter(Color.WHITE, 45, 1, 10);
        CompoundPainter<Object> cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("45deg white pinstripe on black", cp));
       
        pp = new PinstripePainter(Color.WHITE, 0, 1, 10);
        pp.setAntialiasing(true);
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("vertical white pinstripe on black", cp));
       
        pp = new PinstripePainter(Color.WHITE, 90, 1, 10);
        pp.setAntialiasing(true);
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("horizontal white pinstripe on black", cp));
       
        pp = new PinstripePainter(Color.WHITE, 45, 3, 10);
        pp.setAntialiasing(true);
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("3px wide white pinstripe on black", cp));
       
        pp = new PinstripePainter(Color.WHITE, 45, 10, 2);
        pp.setAntialiasing(true);
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("10px wide pinstripe w/ 2px spacing on black", cp));
       
        pp = new PinstripePainter(Color.WHITE, 45, 3, 15);
        pp.setAntialiasing(true);
        pp.setPaint(
                new GradientPaint(new Point(0, 0), Color.WHITE, new Point(10, 10), Color.BLACK));
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("pinstripe w/ 10px gradient", cp));
       
        pp = new PinstripePainter(Color.WHITE, 45, 3, 15);
        pp.setAntialiasing(true);
        pp.setPaint(
                new GradientPaint(new Point(0, 0), Color.WHITE, new Point(200, 200), Color.BLACK));
        cp = new CompoundPainter<Object>(black, pp);
        node.add(createInfoNode("pinstripe w/ 200px gradient", cp));
       
        return node;
View Full Code Here

   
    private MutableTreeNode createCompoundPainterDemos() {
        DefaultMutableTreeNode node = createInfoNode("Compound Painter Gradient Demos", null);
       
        MattePainter mp = new MattePainter(Color.GREEN);
        PinstripePainter pp = new PinstripePainter(Color.BLUE);
        CompoundPainter<Object> cp = new CompoundPainter<Object>(mp, pp);
        node.add(createInfoNode("panel w/ blue pinstripe fg, green matte bg", cp));
       
        mp = new MattePainter(Color.GREEN);
        RectanglePainter rp = new RectanglePainter(new Insets(20, 20, 20, 20), 50,
                50, 10, 10, true, Color.RED, 5, Color.RED.darker());
        pp = new PinstripePainter(Color.BLUE);
        cp = new CompoundPainter<Object>(mp, rp, pp);
        node.add(createInfoNode("panel, blue stripe fg, green bg, red rect comp", cp));
               
        rp = new RectanglePainter(20, 20, 5, Color.BLUE);
        TextPainter tp = new TextPainter("Some Text");
View Full Code Here

    private void setupPainters() {
        GlossPainter gloss = new GlossPainter(new Color(1.0f, 1.0f, 1.0f, 0.2f),
                GlossPainter.GlossPosition.TOP);

        PinstripePainter stripes = new PinstripePainter();
        stripes.setPaint(new Color(1.0f, 1.0f, 1.0f, 0.17f));
        stripes.setSpacing(5.0);

        MattePainter matte = new MattePainter(new Color(02, 98, 35));

        header.setBackgroundPainter(new CompoundPainter(matte, stripes, gloss));
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.painter.PinstripePainter

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.