Package org.jdesktop.swingx.painter

Examples of org.jdesktop.swingx.painter.MattePainter


    public static final Color MATCH_COLOR = Color.YELLOW;
    public static final Color PINSTRIPE_COLOR = Color.GREEN;
   
    public static Painter createPlainPainter() {
        return new MattePainter(MATCH_COLOR);
    }
View Full Code Here


     */
    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) {
View Full Code Here

                new ColorBlendHighlighter(new Color(0, 180, 0, 80), null)));
        info.add(new HighlighterInfo("Green Orb Icon",
                new IconHighlighter(Application.getInstance().getContext()
                        .getResourceMap(HighlighterDemo.class).getIcon("greenOrb"))));
        info.add(new HighlighterInfo("Aerith Gradient Painter",
                new PainterHighlighter(new MattePainter(PaintUtils.AERITH, true))));
        info.add(new HighlighterInfo("Star Shape Painter",
                new PainterHighlighter(new ShapePainter(
                        ShapeUtils.generatePolygon(5, 10, 5, true), PaintUtils.NIGHT_GRAY_LIGHT))));
        info.add(new HighlighterInfo("10pt. Bold Dialog Font",
                new FontHighlighter(new Font("Dialog", Font.BOLD, 10))));
View Full Code Here

        private Timeline fadeInTimeline;
        private MattePainter matte;
        private Color base = ColorUtil.setSaturation(Color.MAGENTA, .7f);
       
        public HighlighterControl() {
            matte = new MattePainter(ColorUtil.setAlpha(base, 125));
            tableValueBasedHighlighter = new RelativePainterHighlighter(matte);
            table.addHighlighter(tableValueBasedHighlighter);
            treeTable.addHighlighter(tableValueBasedHighlighter);

            valueBasedHighlighter = new RelativePainterHighlighter(matte);
View Full Code Here

       
        bind();
    }

    private void createBusyLabelDemo() {
        setBackgroundPainter(new MattePainter(PaintUtils.BLUE_EXPERIENCE, true));
       
        //TODO uncomment when SwingX #999 is fixed
//        label = new JXBusyLabel();
        label = new JXBusyLabel(new Dimension(50, 50));
        label.setName("busyLabel");
View Full Code Here

    public GradientChooserDemo() {
        float[] vals = { 0.0f, 1.0f };
        Color[] colors = { Color.WHITE, Color.BLUE };
        gradient = new LinearGradientPaint(0f, 0f, 1f, 1f, vals, colors);
       
        setBackgroundPainter(new MattePainter(gradient, true));
       
        createGradientChooserDemo();
       
        Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
       
View Full Code Here

    private void bind() {
        showChooser.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                gradient = JXGradientChooser.showDialog(GradientChooserDemo.this,
                        "Pick a Gradient", gradient);
                setBackgroundPainter(new MattePainter(gradient));
            }
        });
    }
View Full Code Here

        return node;
    }
   
    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));
       
View Full Code Here

    private MutableTreeNode createMattePainterDemos() {
        DefaultMutableTreeNode node = createInfoNode("Matte Painter Gradient Demos", null);
       
        Paint gradient = new GradientPaint(new Point(30, 30), Color.RED,
                new Point(80, 30),  Color.GREEN);
        MattePainter mp = new MattePainter(gradient);
        node.add(createInfoNode("single stop, horiz", mp));
       
        gradient = new GradientPaint(new Point(30, 30), Color.RED,
                new Point(30, 80), Color.GREEN);
        node.add(createInfoNode("single stop, vert", new MattePainter(gradient)));
       
        gradient = new GradientPaint(new Point(30, 30), Color.RED,
                new Point(80, 80), Color.GREEN);
        node.add(createInfoNode("single stop, diag", new MattePainter(gradient)));
       
        gradient = new LinearGradientPaint(new Point(30,30), new Point(80,30),
                new float[] {0f, 0.5f, 1f},
                new Color[] {Color.RED, Color.GREEN, Color.BLUE} );
        node.add(createInfoNode("multi stop horiz", new MattePainter(gradient)));
       
        gradient = new LinearGradientPaint(new Point(30,30), new Point(30,80),
                new float[] {0f, 0.5f, 1f},
                new Color[] {Color.RED, Color.GREEN, Color.BLUE} );
        node.add(createInfoNode("multi stop vert", new MattePainter(gradient)));
       
        gradient = new LinearGradientPaint(new Point(30,30), new Point(30,80),
                new float[] {0f, 0.5f, 1f},
                new Color[] {Color.RED, Color.GREEN, Color.BLUE} );
        node.add(createInfoNode("multi stop diag", new MattePainter(gradient)));
       
        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");
        cp = new CompoundPainter<Object>(rp, tp);
        node.add(createInfoNode("text on blue", cp));
       
        mp = new MattePainter(Color.BLACK);
        tp = new TextPainter("Neon");
        tp.setFont(new Font("SansSerif", Font.BOLD, 100));
        tp.setFillPaint(Color.BLACK);
        NeonBorderEffect effect = new NeonBorderEffect(Color.BLACK, Color.RED.brighter(), 10);
        effect.setBorderPosition(NeonBorderEffect.BorderPosition.Centered);
        tp.setAreaEffects(effect);
        cp = new CompoundPainter<Object>(mp, tp);
        node.add(createInfoNode("A Cool Logo", cp));
       
        mp = new MattePainter(Color.GRAY);
        ShapePainter sp = new ShapePainter(
                ShapeUtils.generatePolygon(30, 50, 45, true), Color.RED);
        sp.setStyle(ShapePainter.Style.FILLED);
        sp.setBorderPaint(Color.BLUE);
        ShadowPathEffect starShadow = new ShadowPathEffect();
View Full Code Here

TOP

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

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.