All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.GenericObjectEditor

java.lang.Object
   |
   +----weka.gui.GenericObjectEditor

public class GenericObjectEditor
extends Object
implements PropertyEditor
A PropertyEditor for objects that themselves have been defined as editable in the GenericObjectEditor configuration file, which lists possible values that can be selected from, and themselves configured. The configuration file is called "GenericObjectEditor.props" and may live in either the location given by "user.home" or the current directory (this last will take precedence), and a default properties file is read from the weka distribution. For speed, the properties file is read only once when the class is first loaded -- this may need to be changed if we ever end up running in a Java OS ;-).

Version:
$Revision: 1.14 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o GenericObjectEditor()

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener who will be notified of value changes.
 o getAsText()
Returns null as we don't support getting/setting values as text.
 o getCustomEditor()
Returns the array editing component.
 o getJavaInitializationString()
Supposedly returns an initialization string to create a Object identical to the current one, including it's state, but this doesn't appear possible given that the initialization string isn't supposed to contain multiple statements.
 o getTags()
Returns null as we don't support getting values as tags.
 o getValue()
Gets the current Object.
 o isPaintable()
Returns true to indicate that we can paint a representation of the Object.
 o main(String[])
Tests out the Object editor from the command line.
 o paintValue(Graphics, Rectangle)
Paints a representation of the current Object.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a PropertyChangeListener.
 o setAsText(String)
Returns null as we don't support getting/setting values as text.
 o setClassType(Class)
Sets the class of values that can be edited.
 o setDefaultValue()
Sets the current object to be the default, taken as the first item in the chooser
 o setEnabled(boolean)
Sets whether the editor is "enabled", meaning that the current values will be painted.
 o setValue(Object)
Sets the current Object.
 o supportsCustomEditor()
Returns true because we do support a custom editor.

Constructors

 o GenericObjectEditor
 public GenericObjectEditor()

Methods

 o setEnabled
 public void setEnabled(boolean newVal)
Sets whether the editor is "enabled", meaning that the current values will be painted.

Parameters:
newVal - a value of type 'boolean'
 o setClassType
 public void setClassType(Class type)
Sets the class of values that can be edited.

Parameters:
type - a value of type 'Class'
 o setDefaultValue
 public void setDefaultValue()
Sets the current object to be the default, taken as the first item in the chooser

 o setValue
 public void setValue(Object o)
Sets the current Object. If the Object is in the Object chooser, this becomes the selected item (and added to the chooser if necessary).

Parameters:
o - an object that must be a Object.
 o getValue
 public Object getValue()
Gets the current Object.

Returns:
the current Object
 o getJavaInitializationString
 public String getJavaInitializationString()
Supposedly returns an initialization string to create a Object identical to the current one, including it's state, but this doesn't appear possible given that the initialization string isn't supposed to contain multiple statements.

Returns:
the java source code initialisation string
 o isPaintable
 public boolean isPaintable()
Returns true to indicate that we can paint a representation of the Object.

Returns:
true
 o paintValue
 public void paintValue(Graphics gfx,
                        Rectangle box)
Paints a representation of the current Object.

Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into
 o getAsText
 public String getAsText()
Returns null as we don't support getting/setting values as text.

Returns:
null
 o setAsText
 public void setAsText(String text) throws IllegalArgumentException
Returns null as we don't support getting/setting values as text.

Parameters:
text - the text value
Throws: IllegalArgumentException
as we don't support getting/setting values as text.
 o getTags
 public String[] getTags()
Returns null as we don't support getting values as tags.

Returns:
null
 o supportsCustomEditor
 public boolean supportsCustomEditor()
Returns true because we do support a custom editor.

Returns:
true
 o getCustomEditor
 public Component getCustomEditor()
Returns the array editing component.

Returns:
a value of type 'java.awt.Component'
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener who will be notified of value changes.

Parameters:
l - a value of type 'PropertyChangeListener'
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener.

Parameters:
l - a value of type 'PropertyChangeListener'
 o main
 public static void main(String args[])
Tests out the Object editor from the command line.

Parameters:
args - may contain the class name of a Object to edit

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home