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

  Modifier and Type
  Method
  Description
  `void`
  `addPropertyChangeListener(PropertyChangeListener listener)`
  `String`
  `getAsText()`
  Not representable as a string
  `Component`
  `getCustomEditor()`
  Returns our JColorChooser object
  `String`
  `getJavaInitializationString()`
  Don't really need this
  `String[]`
  `getTags()`
  Not applicable - returns null
  `Object`
  `getValue()`
  Get the current color
  `boolean`
  `isPaintable()`
  We paint our current color into the supplied bounding box
  `void`
  `paintValue(Graphics gfx, Rectangle box)`
  Paint our current color into the supplied bounding box
  `void`
  `removePropertyChangeListener(PropertyChangeListener listener)`
  `void`
  `setAsText(String text)`
  Throws an exception as we are not representable in text form
  `void`
  `setValue(Object value)`
  Set the current color
  `boolean`
  `supportsCustomEditor()`
  We use JColorChooser, so return true

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ColorEditor

    public ColorEditor()

- ## Method Details

  - ### setValue

    public void setValue(Object value)
    Set the current color
    Specified by:
      `setValue` in interface `PropertyEditor`
    Parameters:
      `value` - the current color

  - ### getValue

    public Object getValue()
    Get the current color
    Specified by:
      `getValue` in interface `PropertyEditor`
    Returns:
      the current color

  - ### isPaintable

    public boolean isPaintable()
    We paint our current color into the supplied bounding box
    Specified by:
      `isPaintable` in interface `PropertyEditor`
    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:
      `paintValue` in interface `PropertyEditor`
    Parameters:
      `gfx` - the graphics object to use
      `box` - the bounding box

  - ### getJavaInitializationString

    public String getJavaInitializationString()
    Don't really need this
    Specified by:
      `getJavaInitializationString` in interface `PropertyEditor`
    Returns:
      some arbitrary string

  - ### getAsText

    public String getAsText()
    Not representable as a string
    Specified by:
      `getAsText` in interface `PropertyEditor`
    Returns:
      null

  - ### setAsText

    public void setAsText(String text) throws IllegalArgumentException
    Throws an exception as we are not representable in text form
    Specified by:
      `setAsText` in interface `PropertyEditor`
    Parameters:
      `text` - text
    Throws:
      `IllegalArgumentException`

  - ### getTags

    public String[] getTags()
    Not applicable - returns null
    Specified by:
      `getTags` in interface `PropertyEditor`
    Returns:
      null

  - ### getCustomEditor

    public Component getCustomEditor()
    Returns our JColorChooser object
    Specified by:
      `getCustomEditor` in interface `PropertyEditor`
    Returns:
      our JColorChooser object

  - ### supportsCustomEditor

    public boolean supportsCustomEditor()
    We use JColorChooser, so return true
    Specified by:
      `supportsCustomEditor` in interface `PropertyEditor`
    Returns:
      true

  - ### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener listener)
    Specified by:
      `addPropertyChangeListener` in interface `PropertyEditor`

  - ### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener listener)
    Specified by:
      `removePropertyChangeListener` in interface `PropertyEditor`