Package org.jdesktop.swingx.painter

Examples of org.jdesktop.swingx.painter.AlphaPainter


   
    /**
     * @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();
View Full Code Here

TOP

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

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.