Package weka.gui
Class ColorEditor
- java.lang.Object
-
- weka.gui.ColorEditor
-
- All Implemented Interfaces:
PropertyEditor
public class ColorEditor extends Object implements 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 Constructor Description ColorEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)StringgetAsText()Not representable as a stringComponentgetCustomEditor()Returns our JColorChooser objectStringgetJavaInitializationString()Don't really need thisString[]getTags()Not applicable - returns nullObjectgetValue()Get the current colorbooleanisPaintable()We paint our current color into the supplied bounding boxvoidpaintValue(Graphics gfx, Rectangle box)Paint our current color into the supplied bounding boxvoidremovePropertyChangeListener(PropertyChangeListener listener)voidsetAsText(String text)Throws an exception as we are not representable in text formvoidsetValue(Object value)Set the current colorbooleansupportsCustomEditor()We use JColorChooser, so return true
-
-
-
Method Detail
-
setValue
public void setValue(Object value)
Set the current color- Specified by:
setValuein interfacePropertyEditor- Parameters:
value- the current color
-
getValue
public Object 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
public void paintValue(Graphics gfx, Rectangle box)
Paint our current color into the supplied bounding box- Specified by:
paintValuein interfacePropertyEditor- Parameters:
gfx- the graphics object to usebox- the bounding box
-
getJavaInitializationString
public String getJavaInitializationString()
Don't really need this- Specified by:
getJavaInitializationStringin interfacePropertyEditor- Returns:
- some arbitrary string
-
getAsText
public String getAsText()
Not representable as a string- Specified by:
getAsTextin interfacePropertyEditor- Returns:
- null
-
setAsText
public void setAsText(String text) throws IllegalArgumentException
Throws an exception as we are not representable in text form- Specified by:
setAsTextin interfacePropertyEditor- Parameters:
text- text- Throws:
IllegalArgumentException
-
getTags
public String[] getTags()
Not applicable - returns null- Specified by:
getTagsin interfacePropertyEditor- Returns:
- null
-
getCustomEditor
public Component 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
public void addPropertyChangeListener(PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfacePropertyEditor
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfacePropertyEditor
-
-