public class ColorEditor extends Object implements PropertyEditor
| Constructor and Description |
|---|
ColorEditor() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
String |
getAsText()
Not representable as a string
|
Component |
getCustomEditor()
Returns our JColorChooser object
|
String |
getJavaInitializationString()
Don't really need this
|
String[] |
getTags()
Not applicable - returns null
|
Object |
getValue()
Get the current color
|
boolean |
isPaintable()
We paint our current color into the supplied bounding box
|
void |
paintValue(Graphics gfx,
Rectangle box)
Paint our current color into the supplied bounding box
|
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
setAsText(String text)
Throws an exception as we are not representable in text form
|
void |
setValue(Object value)
Set the current color
|
boolean |
supportsCustomEditor()
We use JColorChooser, so return true
|
public void setValue(Object value)
setValue in interface PropertyEditorvalue - the current colorpublic Object getValue()
getValue in interface PropertyEditorpublic boolean isPaintable()
isPaintable in interface PropertyEditorpublic void paintValue(Graphics gfx, Rectangle box)
paintValue in interface PropertyEditorgfx - the graphics object to usebox - the bounding boxpublic String getJavaInitializationString()
getJavaInitializationString in interface PropertyEditorpublic String getAsText()
getAsText in interface PropertyEditorpublic void setAsText(String text) throws IllegalArgumentException
setAsText in interface PropertyEditortext - textIllegalArgumentExceptionpublic String[] getTags()
getTags in interface PropertyEditorpublic Component getCustomEditor()
getCustomEditor in interface PropertyEditorpublic boolean supportsCustomEditor()
supportsCustomEditor in interface PropertyEditorpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface PropertyEditorpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface PropertyEditorCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.