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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNot representable as a stringReturns our JColorChooser objectDon't really need thisString[]getTags()Not applicable - returns nullgetValue()Get the current colorbooleanWe paint our current color into the supplied bounding boxvoidpaintValue(Graphics gfx, Rectangle box) Paint our current color into the supplied bounding boxvoidvoidThrows an exception as we are not representable in text formvoidSet the current colorbooleanWe use JColorChooser, so return true
-
Constructor Details
-
ColorEditor
public ColorEditor()
-
-
Method Details
-
setValue
Set the current color- Specified by:
setValuein interfacePropertyEditor- Parameters:
value- the current color
-
getValue
Get the current color- Specified by:
getValuein interfacePropertyEditor- Returns:
- the current color
-
isPaintable
public boolean isPaintable()We paint our current color into the supplied bounding box- Specified by:
isPaintablein interfacePropertyEditor- Returns:
- true as we are paintable
-
paintValue
Paint our current color into the supplied bounding box- Specified by:
paintValuein interfacePropertyEditor- Parameters:
gfx- the graphics object to usebox- the bounding box
-
getJavaInitializationString
Don't really need this- Specified by:
getJavaInitializationStringin interfacePropertyEditor- Returns:
- some arbitrary string
-
getAsText
Not representable as a string- Specified by:
getAsTextin interfacePropertyEditor- Returns:
- null
-
setAsText
Throws an exception as we are not representable in text form- Specified by:
setAsTextin interfacePropertyEditor- Parameters:
text- text- Throws:
IllegalArgumentException
-
getTags
Not applicable - returns null- Specified by:
getTagsin interfacePropertyEditor- Returns:
- null
-
getCustomEditor
Returns our JColorChooser object- Specified by:
getCustomEditorin interfacePropertyEditor- Returns:
- our JColorChooser object
-
supportsCustomEditor
public boolean supportsCustomEditor()We use JColorChooser, so return true- Specified by:
supportsCustomEditorin interfacePropertyEditor- Returns:
- true
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfacePropertyEditor
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfacePropertyEditor
-