Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JColorChooser
Nested Class Summary | |
protected class |
|
Nested classes/interfaces inherited from class javax.swing.JComponent | |
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary | |
static String |
|
static String |
|
static String |
|
protected AccessibleContext |
|
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
static JDialog |
|
AccessibleContext |
|
AbstractColorChooserPanel[] |
|
Color |
|
boolean |
|
JComponent |
|
ColorSelectionModel |
|
ColorChooserUI |
|
String |
|
protected String |
|
AbstractColorChooserPanel |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
static Color |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static final String CHOOSER_PANELS_PROPERTY
The property fired by the JColorChooser when the chooserPanels property changes.
- Field Value:
- "chooserPanels"
public static final String PREVIEW_PANEL_PROPERTY
The property fired by the JColorChooser when the previewPanel property changes.
- Field Value:
- "previewPanel"
public static final String SELECTION_MODEL_PROPERTY
The property fired by the JColorChooser when the selectionModel property changes.
- Field Value:
- "selectionModel"
public JColorChooser()
This method creates a new JColorChooser with the default initial color.
public JColorChooser(Color initial)
This method creates a new JColorChooser with the given initial color.
- Parameters:
initial
- The initial color.
public JColorChooser(ColorSelectionModel model)
This method creates a new JColorChooser with the given model. The model will dictate what the initial color for the JColorChooser is.
- Parameters:
model
- The Model to use with the JColorChooser.
public void addChooserPanel(AbstractColorChooserPanel panel)
This method adds the given AbstractColorChooserPanel to the list of the JColorChooser's chooserPanels.
- Parameters:
panel
- The AbstractColorChooserPanel to add.
public static JDialog createDialog(Component component, String title, boolean modal, JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener)
This method will take the given JColorChooser and place it in a JDialog with the given modal property. Three buttons are displayed in the JDialog: OK, Cancel and Reset. If OK or Cancel are pressed, the JDialog is hidden. If Reset is pressed, then the JColorChooser will take on its default color value. The given okListener will be registered to the OK button and the cancelListener will be registered to the Cancel button. If the modal property is set, then the JDialog will block until it is hidden.
- Parameters:
component
- The Component that will parent the JDialog.title
- The title displayed in the JDialog.modal
- The modal property.chooserPane
- The JColorChooser to place in the JDialog.okListener
- The ActionListener to register to the OK button.cancelListener
- The ActionListener to register to the Cancel button.
- Returns:
- A JDialog with the JColorChooser inside of it.
public AccessibleContext getAccessibleContext()
getAccessibleContext
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JComponent
- Returns:
- AccessibleContext
public AbstractColorChooserPanel[] getChooserPanels()
This method returns the AbstractColorChooserPanels used with this JColorChooser.
- Returns:
- The AbstractColorChooserPanels used with this JColorChooser.
public Color getColor()
This method returns the current color for the JColorChooser.
- Returns:
- The current color for the JColorChooser.
public JComponent getPreviewPanel()
This method returns the current previewPanel used with this JColorChooser.
- Returns:
- The current previewPanel.
public ColorSelectionModel getSelectionModel()
This method returns the ColorSelectionModel used with this JColorChooser.
- Returns:
- The ColorSelectionModel.
public ColorChooserUI getUI()
This method returns the UI Component used for this JColorChooser.
- Returns:
- The UI Component for this JColorChooser.
public String getUIClassID()
This method returns a String identifier for the UI Class to be used with the JColorChooser.
- Overrides:
- getUIClassID in interface JComponent
- Returns:
- The String identifier for the UI Class.
protected String paramString()
This method returns a String describing the JColorChooser.
- Overrides:
- paramString in interface JComponent
- Returns:
- A String describing the JColorChooser.
public AbstractColorChooserPanel removeChooserPanel(AbstractColorChooserPanel panel)
This method removes the given AbstractColorChooserPanel from the JColorChooser's list of chooserPanels.
- Parameters:
panel
- The AbstractColorChooserPanel to remove.
- Returns:
- The AbstractColorChooserPanel that was removed.
public void setChooserPanels(AbstractColorChooserPanel[] panels)
This method sets the chooserPanels property for this JColorChooser.
- Parameters:
panels
- The new set of AbstractColorChooserPanels to use.
public void setColor(int color)
This method sets the current color for the JColorChooser using the integer value. Bits 0-7 represent the blue value. Bits 8-15 represent the green value. Bits 16-23 represent the red value.
- Parameters:
color
- The new current color of the JColorChooser.
public void setColor(int r, int g, int b)
This method sets the current color for the JColorChooser using RGB values.
- Parameters:
r
- The red value.g
- The green value.b
- The blue value.
public void setColor(Color color)
This method sets the current color for the JColorChooser.
- Parameters:
color
- The new color for the JColorChooser.
public void setPreviewPanel(JComponent component)
This method changes the previewPanel property for the JTabbedPane. The previewPanel is responsible for indicating the current color of the JColorChooser.
- Parameters:
component
- The Component that will act as the previewPanel.
public void setSelectionModel(ColorSelectionModel model)
This method sets the ColorSelectionModel to be used with this JColorChooser.
- Parameters:
model
- The ColorSelectionModel to be used with this JColorChooser.
public void setUI(ColorChooserUI ui)
This method sets the UI Component used for this JColorChooser.
- Parameters:
ui
- The UI Component to use with this JColorChooser.
public static Color showDialog(Component component, String title, Color initial)
This method shows a JColorChooser inside a JDialog. The JDialog will block until it is hidden. The JDialog comes with three buttons: OK, Cancel, and Reset. Pressing OK or Cancel hide the JDialog. Pressing Reset will reset the JColorChooser to its initial value.
- Parameters:
component
- The Component that parents the JDialog.title
- The title displayed in the JDialog.initial
- The initial color.
- Returns:
- The selected color.
public void updateUI()
This method resets the UI Component property to the Look and Feel default.
- Overrides:
- updateUI in interface JComponent