javax.swing.colorchooser

Class AbstractColorChooserPanel

public abstract class AbstractColorChooserPanel extends JPanel

AbstractColorChooserPanel
Constructor Summary
AbstractColorChooserPanel()
This is the constructor for the AbstractColorChooserPanel.
Method Summary
protected abstract voidbuildChooser()
This method constructs and does any initialization necessary for the chooser panel.
protected ColorgetColorFromModel()
This method returns the current color stored in the model for this chooser panel.
ColorSelectionModelgetColorSelectionModel()
This method returns the ColorSelectionModel for the JColorChooser associated with this chooser panel.
intgetDisplayedMnemonicIndex()
Returns the index of the character in the display name that is the mnemonic.
abstract StringgetDisplayName()
This method returns the name displayed in the tab for this chooser panel.
abstract IcongetLargeDisplayIcon()
This method sets the large icon useed in the jTabbedPane for this chooser panel.
intgetMnemonic()
Returns the key code for the mnemonic for this panel.
abstract IcongetSmallDisplayIcon()
This method sets the small icon used in the JTabbedPane for this chooser panel.
voidinstallChooserPanel(JColorChooser chooser)
This method installs the chooser panel for the given JColorChooser.
voidpaint(Graphics graphics)
This method paints the chooser panel.
voiduninstallChooserPanel(JColorChooser chooser)
This method removes the chooser panel from the given JColorChooser and does any necessary clean up for the chooser panel.
abstract voidupdateChooser()
This method updates the chooser panel when the JColorChooser's color has changed.

Constructor Detail

AbstractColorChooserPanel

public AbstractColorChooserPanel()
This is the constructor for the AbstractColorChooserPanel.

Method Detail

buildChooser

protected abstract void buildChooser()
This method constructs and does any initialization necessary for the chooser panel.

getColorFromModel

protected Color getColorFromModel()
This method returns the current color stored in the model for this chooser panel.

Returns: The current color.

getColorSelectionModel

public ColorSelectionModel getColorSelectionModel()
This method returns the ColorSelectionModel for the JColorChooser associated with this chooser panel.

Returns: The ColorSelectionModel for the JColorChooser associated with this chooser panel.

getDisplayedMnemonicIndex

public int getDisplayedMnemonicIndex()
Returns the index of the character in the display name that is the mnemonic. This method returns -1 to indicate no mnemonic, subclasses can override.

Returns: -1, to indicate no mnemonic.

Since: 1.4

See Also: getDisplayName getMnemonic

getDisplayName

public abstract String getDisplayName()
This method returns the name displayed in the tab for this chooser panel.

Returns: The name displayed in the JTabbedPane's tabs.

getLargeDisplayIcon

public abstract Icon getLargeDisplayIcon()
This method sets the large icon useed in the jTabbedPane for this chooser panel.

Returns: The large icon.

getMnemonic

public int getMnemonic()
Returns the key code for the mnemonic for this panel. This method returns zero to indicate no mnemonic, subclasses can override this.

Returns: 0, to indicate no mnemonic key code.

Since: 1.4

See Also: getDisplayedMnemonicIndex

getSmallDisplayIcon

public abstract Icon getSmallDisplayIcon()
This method sets the small icon used in the JTabbedPane for this chooser panel.

Returns: The small icon used in the JTabbedPane.

installChooserPanel

public void installChooserPanel(JColorChooser chooser)
This method installs the chooser panel for the given JColorChooser.

Parameters: chooser The JColorChooser that will have this panel installed.

paint

public void paint(Graphics graphics)
This method paints the chooser panel.

Parameters: graphics The Graphics object to paint with.

uninstallChooserPanel

public void uninstallChooserPanel(JColorChooser chooser)
This method removes the chooser panel from the given JColorChooser and does any necessary clean up for the chooser panel.

Parameters: chooser The JColorChooser that is having this panel removed.

updateChooser

public abstract void updateChooser()
This method updates the chooser panel when the JColorChooser's color has changed.