Package weka.gui
Class ColorEditor
- java.lang.Object
-
- weka.gui.ColorEditor
-
- All Implemented Interfaces:
java.beans.PropertyEditor
public class ColorEditor extends java.lang.Object implements java.beans.PropertyEditorA 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(java.beans.PropertyChangeListener listener)java.lang.StringgetAsText()Not representable as a stringjava.awt.ComponentgetCustomEditor()Returns our JColorChooser objectjava.lang.StringgetJavaInitializationString()Don't really need thisjava.lang.String[]getTags()Not applicable - returns nulljava.lang.ObjectgetValue()Get the current colorbooleanisPaintable()We paint our current color into the supplied bounding boxvoidpaintValue(java.awt.Graphics gfx, java.awt.Rectangle box)Paint our current color into the supplied bounding boxvoidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)voidsetAsText(java.lang.String text)Throws an exception as we are not representable in text formvoidsetValue(java.lang.Object value)Set the current colorbooleansupportsCustomEditor()We use JColorChooser, so return true
-
-
-
Method Detail
-
setValue
public void setValue(java.lang.Object value)
Set the current color- Specified by:
setValuein interfacejava.beans.PropertyEditor- Parameters:
value- the current color
-
getValue
public java.lang.Object getValue()
Get the current color- Specified by:
getValuein interfacejava.beans.PropertyEditor- Returns:
- the current color
-
isPaintable
public boolean isPaintable()
We paint our current color into the supplied bounding box- Specified by:
isPaintablein interfacejava.beans.PropertyEditor- Returns:
- true as we are paintable
-
paintValue
public void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)Paint our current color into the supplied bounding box- Specified by:
paintValuein interfacejava.beans.PropertyEditor- Parameters:
gfx- the graphics object to usebox- the bounding box
-
getJavaInitializationString
public java.lang.String getJavaInitializationString()
Don't really need this- Specified by:
getJavaInitializationStringin interfacejava.beans.PropertyEditor- Returns:
- some arbitrary string
-
getAsText
public java.lang.String getAsText()
Not representable as a string- Specified by:
getAsTextin interfacejava.beans.PropertyEditor- Returns:
- null
-
setAsText
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentExceptionThrows an exception as we are not representable in text form- Specified by:
setAsTextin interfacejava.beans.PropertyEditor- Parameters:
text- text- Throws:
java.lang.IllegalArgumentException
-
getTags
public java.lang.String[] getTags()
Not applicable - returns null- Specified by:
getTagsin interfacejava.beans.PropertyEditor- Returns:
- null
-
getCustomEditor
public java.awt.Component getCustomEditor()
Returns our JColorChooser object- Specified by:
getCustomEditorin interfacejava.beans.PropertyEditor- Returns:
- our JColorChooser object
-
supportsCustomEditor
public boolean supportsCustomEditor()
We use JColorChooser, so return true- Specified by:
supportsCustomEditorin interfacejava.beans.PropertyEditor- Returns:
- true
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfacejava.beans.PropertyEditor
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfacejava.beans.PropertyEditor
-
-