|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.vizzini.ui.ColorChooser
public class ColorChooser
Provides a generic GUI component for selection of colors.
A color changed event can be obtained by registering a
java.beans.PropertyChangeListener
using
addColorListener()
.
Listener example:
_colorUI.addColorListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
ColorChooser chooser = (ColorChooser)event.getSource();
Color color = (Color)event.getNewValue();
// Do something
}
} );
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
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 |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
ColorChooser(String label)
Construct this object with the given parameter. |
|
ColorChooser(String label,
String colorChooserTitle)
Construct this object with the given parameter. |
Method Summary | |
---|---|
void |
addColorListener(PropertyChangeListener listener)
Add a property listener for the color property. |
Color |
getColor()
Return the chosen color. |
boolean |
isDirty()
|
void |
removeColorListener(PropertyChangeListener listener)
Remove a property listener for the color property. |
void |
setColor(Color color)
Set the chosen color. |
void |
setDirty(boolean isDirty)
|
void |
setEnabled(boolean enabled)
Set the enabled state of this widget. |
void |
setTitle(String title)
Create a titled border with the given string. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColorChooser(String label)
label
- Label for the color button.public ColorChooser(String label, String colorChooserTitle)
label
- Label for the color button.Method Detail |
---|
public void addColorListener(PropertyChangeListener listener)
public Color getColor()
public boolean isDirty()
public void removeColorListener(PropertyChangeListener listener)
public void setColor(Color color)
color
- The new color.
IllegalArgumentException
- if color is null.public void setDirty(boolean isDirty)
isDirty
- The isDirty to set.public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void setTitle(String title)
title
- The title for the titled border.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |