Package weka.gui
Class ColorEditor
java.lang.Object
weka.gui.ColorEditor
- All Implemented Interfaces:
PropertyEditor
A property editor for colors that uses JColorChooser as the
underlying editor.
- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Not representable as a stringReturns our JColorChooser objectDon't really need thisString[]
getTags()
Not applicable - returns nullgetValue()
Get the current colorboolean
We paint our current color into the supplied bounding boxvoid
paintValue
(Graphics gfx, Rectangle box) Paint our current color into the supplied bounding boxvoid
void
Throws an exception as we are not representable in text formvoid
Set the current colorboolean
We use JColorChooser, so return true
-
Constructor Details
-
ColorEditor
public ColorEditor()
-
-
Method Details
-
setValue
Set the current color- Specified by:
setValue
in interfacePropertyEditor
- Parameters:
value
- the current color
-
getValue
Get the current color- Specified by:
getValue
in interfacePropertyEditor
- Returns:
- the current color
-
isPaintable
public boolean isPaintable()We paint our current color into the supplied bounding box- Specified by:
isPaintable
in interfacePropertyEditor
- Returns:
- true as we are paintable
-
paintValue
Paint our current color into the supplied bounding box- Specified by:
paintValue
in interfacePropertyEditor
- Parameters:
gfx
- the graphics object to usebox
- the bounding box
-
getJavaInitializationString
Don't really need this- Specified by:
getJavaInitializationString
in interfacePropertyEditor
- Returns:
- some arbitrary string
-
getAsText
Not representable as a string- Specified by:
getAsText
in interfacePropertyEditor
- Returns:
- null
-
setAsText
Throws an exception as we are not representable in text form- Specified by:
setAsText
in interfacePropertyEditor
- Parameters:
text
- text- Throws:
IllegalArgumentException
-
getTags
Not applicable - returns null- Specified by:
getTags
in interfacePropertyEditor
- Returns:
- null
-
getCustomEditor
Returns our JColorChooser object- Specified by:
getCustomEditor
in interfacePropertyEditor
- Returns:
- our JColorChooser object
-
supportsCustomEditor
public boolean supportsCustomEditor()We use JColorChooser, so return true- Specified by:
supportsCustomEditor
in interfacePropertyEditor
- Returns:
- true
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListener
in interfacePropertyEditor
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListener
in interfacePropertyEditor
-