Top Fields Constructors Methods
javax.swing.colorchooser

pack-priv final Class ColorChooserPanel

extends AbstractColorChooserPanel
implements PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener
Annotations
@SuppressWarnings:serial
Imports
java.awt.Color, .Component, .Container, .GridBagConstraints, .GridBagLayout, java.beans.PropertyChangeEvent, .PropertyChangeListener, javax.swing.Icon, .JComponent, .JFormattedTextField, .JLabel, .SwingConstants

Field Summary

Modifier and TypeField and Description
private final DiagramComponent
private final JLabel
private static final int
private final ColorModel
private final ColorPanel
private final DiagramComponent
private final JFormattedTextField
Inherited from javax.swing.colorchooser.AbstractColorChooserPanel:
TRANSPARENCY_ENABLED_PROPERTY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
buildChooser()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.buildChooser.

Builds a new chooser panel.

public int
getDisplayedMnemonicIndex()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayedMnemonicIndex.

Provides a hint to the look and feel as to the index of the character in getDisplayName that should be visually identified as the mnemonic.

public String
getDisplayName()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayName.

Returns a string containing the display name of the panel.

public Icon
getLargeDisplayIcon()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getLargeDisplayIcon.

Returns the large display icon for the panel.

public int
getMnemonic()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.getMnemonic.

Provides a hint to the look and feel as to the KeyEvent.VK constant that can be used as a mnemonic to access the panel.

public Icon
getSmallDisplayIcon()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getSmallDisplayIcon.

Returns the small display icon for the panel.

public boolean
isColorTransparencySelectionEnabled()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.isColorTransparencySelectionEnabled.

Gets whether color chooser panel allows to select the transparency (alpha value) of a color.

public void
propertyChange(PropertyChangeEvent
A PropertyChangeEvent object describing the event source and the property that has changed.
event
)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

public void
setColorTransparencySelectionEnabled(boolean
true if the transparency of a color can be selected
b
)

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.setColorTransparencySelectionEnabled.

Sets whether color chooser panel allows to select the transparency (alpha value) of a color.

public void
setEnabled(boolean
true if this component should be enabled, false otherwise
enabled
)

Overrides javax.swing.JComponent.setEnabled.

Sets whether or not this component is enabled.

private static void
setEnabled(Container container, boolean enabled)

private static void
setInheritsPopupMenu(JComponent
the root component of the tree
component
,
boolean
whether or not the popup menu is inherited
value
)

Allows to show context popup for all components recursively.

public void
updateChooser()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.updateChooser.

Invoked automatically when the model's state changes.

Inherited from javax.swing.colorchooser.AbstractColorChooserPanel:
getColorFromModelgetColorSelectionModelgetIntinstallChooserPanelpaintsetSelectedColoruninstallChooserPanel

Field Detail

diagramback to summary
private final DiagramComponent diagram
labelback to summary
private final JLabel label
MASKback to summary
private static final int MASK
modelback to summary
private final ColorModel model
panelback to summary
private final ColorPanel panel
sliderback to summary
private final DiagramComponent slider
textback to summary
private final JFormattedTextField text

Constructor Detail

ColorChooserPanelback to summary
pack-priv ColorChooserPanel(ColorModel model)

Method Detail

buildChooserback to summary
protected void buildChooser()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.buildChooser.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.buildChooser.

Builds a new chooser panel.

Annotations
@Override
getDisplayedMnemonicIndexback to summary
public int getDisplayedMnemonicIndex()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayedMnemonicIndex.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayedMnemonicIndex.

Provides a hint to the look and feel as to the index of the character in getDisplayName that should be visually identified as the mnemonic. The look and feel should only use this if getMnemonic returns a value > 0.

The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. For example, a look and feel may wish to render each AbstractColorChooserPanel in a JTabbedPane, and further use this return value to underline a character in the getDisplayName.

This implementation returns -1, indicating the AbstractColorChooserPanel does not support a mnemonic, subclasses wishing a mnemonic will need to override this.

Returns:int

Character index to render mnemonic for; -1 to provide no visual identifier for this panel.

Annotations
@Override
getDisplayNameback to summary
public String getDisplayName()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayName.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.getDisplayName.

Returns a string containing the display name of the panel.

Returns:String

the name of the display panel

Annotations
@Override
getLargeDisplayIconback to summary
public Icon getLargeDisplayIcon()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getLargeDisplayIcon.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.getLargeDisplayIcon.

Returns the large display icon for the panel.

Returns:Icon

the large display icon

Annotations
@Override
getMnemonicback to summary
public int getMnemonic()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.getMnemonic.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.getMnemonic.

Provides a hint to the look and feel as to the KeyEvent.VK constant that can be used as a mnemonic to access the panel. A return value <= 0 indicates there is no mnemonic.

The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way.

This implementation returns 0, indicating the AbstractColorChooserPanel does not support a mnemonic, subclasses wishing a mnemonic will need to override this.

Returns:int

KeyEvent.VK constant identifying the mnemonic; <= 0 for no mnemonic

Annotations
@Override
getSmallDisplayIconback to summary
public Icon getSmallDisplayIcon()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.getSmallDisplayIcon.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.getSmallDisplayIcon.

Returns the small display icon for the panel.

Returns:Icon

the small display icon

Annotations
@Override
isColorTransparencySelectionEnabledback to summary
public boolean isColorTransparencySelectionEnabled()

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.isColorTransparencySelectionEnabled.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.isColorTransparencySelectionEnabled.

Gets whether color chooser panel allows to select the transparency (alpha value) of a color.

Returns:boolean

true if the transparency of a color can be selected

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent event)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Parameters
event:PropertyChangeEvent

A PropertyChangeEvent object describing the event source and the property that has changed.

setColorTransparencySelectionEnabledback to summary
public void setColorTransparencySelectionEnabled(boolean b)

Overrides javax.swing.colorchooser.AbstractColorChooserPanel.setColorTransparencySelectionEnabled.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.setColorTransparencySelectionEnabled.

Sets whether color chooser panel allows to select the transparency (alpha value) of a color. This method fires a property-changed event, using the string value of TRANSPARENCY_ENABLED_PROPERTY as the name of the property.

The value is a hint and may not be applicable to all types of chooser panel.

The default value is true.

Parameters
b:boolean

true if the transparency of a color can be selected

Annotations
@Override
setEnabledback to summary
public void setEnabled(boolean enabled)

Overrides javax.swing.JComponent.setEnabled.

Doc from javax.swing.JComponent.setEnabled.

Sets whether or not this component is enabled. A component that is enabled may respond to user input, while a component that is not enabled cannot respond to user input. Some components may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input.

Note

Disabling a component does not disable its children.

Note

Disabling a lightweight component does not prevent it from receiving MouseEvents.

Parameters
enabled:boolean

true if this component should be enabled, false otherwise

Annotations
@Override
setEnabledback to summary
private static void setEnabled(Container container, boolean enabled)
setInheritsPopupMenuback to summary
private static void setInheritsPopupMenu(JComponent component, boolean value)

Allows to show context popup for all components recursively.

Parameters
component:JComponent

the root component of the tree

value:boolean

whether or not the popup menu is inherited

updateChooserback to summary
public void updateChooser()

Implements abstract javax.swing.colorchooser.AbstractColorChooserPanel.updateChooser.

Doc from javax.swing.colorchooser.AbstractColorChooserPanel.updateChooser.

Invoked automatically when the model's state changes. It is also called by installChooserPanel to allow you to set up the initial state of your chooser. Override this method to update your ChooserPanel.

Annotations
@Override