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