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.PropertyEditor
value
- the current colorpublic java.lang.Object getValue()
getValue
in interface java.beans.PropertyEditor
public boolean isPaintable()
isPaintable
in interface java.beans.PropertyEditor
public void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)
paintValue
in interface java.beans.PropertyEditor
gfx
- the graphics object to usebox
- the bounding boxpublic java.lang.String getJavaInitializationString()
getJavaInitializationString
in interface java.beans.PropertyEditor
public java.lang.String getAsText()
getAsText
in interface java.beans.PropertyEditor
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentException
setAsText
in interface java.beans.PropertyEditor
text
- textjava.lang.IllegalArgumentException
public java.lang.String[] getTags()
getTags
in interface java.beans.PropertyEditor
public java.awt.Component getCustomEditor()
getCustomEditor
in interface java.beans.PropertyEditor
public boolean supportsCustomEditor()
supportsCustomEditor
in interface java.beans.PropertyEditor
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface java.beans.PropertyEditor
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface java.beans.PropertyEditor