FileDocCategorySizeDatePackage
SynthColorChooserUI.javaAPI DocJava SE 5 API3706Fri Aug 26 14:58:12 BST 2005javax.swing.plaf.synth

SynthColorChooserUI

public class SynthColorChooserUI extends BasicColorChooserUI implements sun.swing.plaf.synth.SynthUI, PropertyChangeListener
Synth's ColorChooserUI.
version
1.11, 12/19/03
author
Tom Santos
author
Steve Wilson

Fields Summary
private SynthStyle
style
Constructors Summary
Methods Summary
protected javax.swing.colorchooser.AbstractColorChooserPanel[]createDefaultChoosers()

        SynthContext context = getContext(chooser, ENABLED);
        AbstractColorChooserPanel[] panels = (AbstractColorChooserPanel[])
                     context.getStyle().get(context, "ColorChooser.panels");
        context.dispose();

        if (panels == null) {
            panels = ColorChooserComponentFactory.getDefaultChooserPanels();
        }
	return panels;
    
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)

	return new SynthColorChooserUI();
    
private intgetComponentState(javax.swing.JComponent c)

        return SynthLookAndFeel.getComponentState(c);
    
public javax.swing.plaf.synth.SynthContextgetContext(javax.swing.JComponent c)

        return getContext(c, getComponentState(c));
    
private javax.swing.plaf.synth.SynthContextgetContext(javax.swing.JComponent c, int state)

        return SynthContext.getContext(SynthContext.class, c,
                    SynthLookAndFeel.getRegion(c), style, state);
    
private javax.swing.plaf.synth.RegiongetRegion(javax.swing.JComponent c)

        return SynthLookAndFeel.getRegion(c);
    
protected voidinstallDefaults()

        updateStyle(chooser);
    
protected voidinstallListeners()

        super.installListeners();
        chooser.addPropertyChangeListener(this);
    
public voidpaint(java.awt.Graphics g, javax.swing.JComponent c)

        SynthContext context = getContext(c);

        paint(context, g);
        context.dispose();
    
protected voidpaint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)

    
public voidpaintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)

        context.getPainter().paintColorChooserBorder(context, g, x, y,w,h);
    
public voidpropertyChange(java.beans.PropertyChangeEvent e)

        if (SynthLookAndFeel.shouldUpdateStyle(e)) {
            updateStyle((JColorChooser)e.getSource());
        }
    
protected voiduninstallDefaults()

        SynthContext context = getContext(chooser, ENABLED);

        style.uninstallDefaults(context);
        context.dispose();
        style = null;
        super.uninstallDefaults();
    
protected voiduninstallListeners()

        chooser.removePropertyChangeListener(this);
        super.uninstallListeners();
    
public voidupdate(java.awt.Graphics g, javax.swing.JComponent c)

        SynthContext context = getContext(c);

        SynthLookAndFeel.update(context, g);
        context.getPainter().paintColorChooserBackground(context, g, 0, 0,
                                                  c.getWidth(), c.getHeight());
        paint(context, g);
        context.dispose();
    
private voidupdateStyle(javax.swing.JComponent c)

        SynthContext context = getContext(c, ENABLED);
        style = SynthLookAndFeel.updateStyle(context, this);
        context.dispose();