Package adams.gui.goe
Class WekaExperimentFileEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.WekaExperimentFileEditor
-
- All Implemented Interfaces:
adams.core.HelpProvider
,adams.gui.goe.CustomStringRepresentationHandler
,adams.gui.goe.InlineEditorSupport
,PropertyEditor
public class WekaExperimentFileEditor extends adams.gui.goe.AbstractPropertyEditorSupport implements adams.gui.goe.CustomStringRepresentationHandler, adams.gui.goe.InlineEditorSupport
A PropertyEditor for WekaExperimentFile objects that lets the user select a file.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WekaExperimentFileEditor.SimpleSetupDialog
A dialog for displaying the simple setup of an experiment.
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.core.BaseButton
m_ButtonCancel
the Cancel button.protected adams.gui.core.BaseButton
m_ButtonEdit
the button to bring up the dialog for editing the experiment.protected adams.gui.core.BaseButton
m_ButtonOK
the OK button.protected adams.gui.core.BasePanel
m_PanelEditor
the editor panel.protected adams.gui.chooser.FileChooserPanel
m_PanelFile
the panel for selecting the experiment file.
-
Constructor Summary
Constructors Constructor Description WekaExperimentFileEditor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JComponent
createCustomEditor()
Gets the custom editor component.Object
fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.String
getInlineValue()
Returns the current value.String
getJavaInitializationString()
Returns a representation of the current property value as java source.protected void
initForDisplay()
Initializes the display of the value.boolean
isInlineEditingAvailable()
Checks whether inline editing is available.boolean
isInlineValueValid(String value)
Checks whether the value id valid.static weka.experiment.Experiment
newExperiment()
Generates a new (simple) experiment.void
paintValue(Graphics gfx, Rectangle box)
Paints a representation of the current Object.void
setInlineValue(String value)
Sets the value to use.String
toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
-
-
-
-
Field Detail
-
m_PanelFile
protected adams.gui.chooser.FileChooserPanel m_PanelFile
the panel for selecting the experiment file.
-
m_PanelEditor
protected adams.gui.core.BasePanel m_PanelEditor
the editor panel.
-
m_ButtonEdit
protected adams.gui.core.BaseButton m_ButtonEdit
the button to bring up the dialog for editing the experiment.
-
m_ButtonOK
protected adams.gui.core.BaseButton m_ButtonOK
the OK button.
-
m_ButtonCancel
protected adams.gui.core.BaseButton m_ButtonCancel
the Cancel button.
-
-
Method Detail
-
toCustomStringRepresentation
public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.- Specified by:
toCustomStringRepresentation
in interfaceadams.gui.goe.CustomStringRepresentationHandler
- Parameters:
obj
- the object to turn into a string- Returns:
- the string representation
-
fromCustomStringRepresentation
public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.- Specified by:
fromCustomStringRepresentation
in interfaceadams.gui.goe.CustomStringRepresentationHandler
- Parameters:
str
- the string to turn into an object- Returns:
- the object
-
newExperiment
public static weka.experiment.Experiment newExperiment()
Generates a new (simple) experiment.- Returns:
- the generated experiment
-
getJavaInitializationString
public String getJavaInitializationString()
Returns a representation of the current property value as java source.- Specified by:
getJavaInitializationString
in interfacePropertyEditor
- Overrides:
getJavaInitializationString
in classPropertyEditorSupport
- Returns:
- a value of type 'String'
-
createCustomEditor
protected JComponent createCustomEditor()
Gets the custom editor component.- Specified by:
createCustomEditor
in classadams.gui.goe.AbstractPropertyEditorSupport
- Returns:
- a value of type 'Component'
-
initForDisplay
protected void initForDisplay()
Initializes the display of the value.- Overrides:
initForDisplay
in classadams.gui.goe.AbstractPropertyEditorSupport
-
paintValue
public void paintValue(Graphics gfx, Rectangle box)
Paints a representation of the current Object.- Specified by:
paintValue
in interfacePropertyEditor
- Overrides:
paintValue
in classPropertyEditorSupport
- Parameters:
gfx
- the graphics context to usebox
- the area we are allowed to paint into
-
isInlineEditingAvailable
public boolean isInlineEditingAvailable()
Checks whether inline editing is available.- Specified by:
isInlineEditingAvailable
in interfaceadams.gui.goe.InlineEditorSupport
- Returns:
- true if editing available
-
setInlineValue
public void setInlineValue(String value)
Sets the value to use.- Specified by:
setInlineValue
in interfaceadams.gui.goe.InlineEditorSupport
- Parameters:
value
- the value to use
-
getInlineValue
public String getInlineValue()
Returns the current value.- Specified by:
getInlineValue
in interfaceadams.gui.goe.InlineEditorSupport
- Returns:
- the current value
-
isInlineValueValid
public boolean isInlineValueValid(String value)
Checks whether the value id valid.- Specified by:
isInlineValueValid
in interfaceadams.gui.goe.InlineEditorSupport
- Parameters:
value
- the value to check- Returns:
- true if valid
-
-