|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.gui.GenericObjectEditor
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 ;-).
Nested Class Summary | |
class |
GenericObjectEditor.GOEPanel
Handles the GUI side of editing values. |
Field Summary | |
protected static String |
PROPERTY_FILE
The name of the properties file |
Constructor Summary | |
GenericObjectEditor()
|
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener who will be notified of value changes. |
String |
getAsText()
Returns null as we don't support getting/setting values as text. |
protected Vector |
getClassesFromProperties()
Called when the class of object being edited changes. |
Component |
getCustomEditor()
Returns the array editing component. |
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. |
String[] |
getTags()
Returns null as we don't support getting values as tags. |
Object |
getValue()
Gets the current Object. |
boolean |
isPaintable()
Returns true to indicate that we can paint a representation of the Object. |
static void |
main(String[] args)
Tests out the Object editor from the command line. |
void |
paintValue(Graphics gfx,
Rectangle box)
Paints a representation of the current Object. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener. |
void |
setAsText(String text)
Returns null as we don't support getting/setting values as text. |
void |
setClassType(Class type)
Sets the class of values that can be edited. |
void |
setDefaultValue()
Sets the current object to be the default, taken as the first item in the chooser |
void |
setEnabled(boolean newVal)
Sets whether the editor is "enabled", meaning that the current values will be painted. |
void |
setValue(Object o)
Sets the current Object. |
boolean |
supportsCustomEditor()
Returns true because we do support a custom editor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static String PROPERTY_FILE
Constructor Detail |
public GenericObjectEditor()
Method Detail |
protected Vector getClassesFromProperties()
public void setEnabled(boolean newVal)
newVal
- a value of type 'boolean'public void setClassType(Class type)
type
- a value of type 'Class'public void setDefaultValue()
public void setValue(Object o)
setValue
in interface PropertyEditor
o
- an object that must be a Object.public Object getValue()
getValue
in interface PropertyEditor
public String getJavaInitializationString()
getJavaInitializationString
in interface PropertyEditor
public boolean isPaintable()
isPaintable
in interface PropertyEditor
public void paintValue(Graphics gfx, Rectangle box)
paintValue
in interface PropertyEditor
gfx
- the graphics context to usebox
- the area we are allowed to paint intopublic String getAsText()
getAsText
in interface PropertyEditor
public void setAsText(String text) throws IllegalArgumentException
setAsText
in interface PropertyEditor
text
- the text value
IllegalArgumentException
- as we don't support
getting/setting values as text.public String[] getTags()
getTags
in interface PropertyEditor
public boolean supportsCustomEditor()
supportsCustomEditor
in interface PropertyEditor
public Component getCustomEditor()
getCustomEditor
in interface PropertyEditor
public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface PropertyEditor
l
- a value of type 'PropertyChangeListener'public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface PropertyEditor
l
- a value of type 'PropertyChangeListener'public static void main(String[] args)
args
- may contain the class name of a Object to edit
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |