adams.gui.goe
Class WekaExperimentFileEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by adams.gui.goe.AbstractPropertyEditorSupport
          extended by adams.gui.goe.WekaExperimentFileEditor
All Implemented Interfaces:
CustomStringRepresentationHandler, InlineEditorSupport, PropertyEditor

public class WekaExperimentFileEditor
extends AbstractPropertyEditorSupport
implements CustomStringRepresentationHandler, InlineEditorSupport

A PropertyEditor for WekaExperimentFile objects that lets the user select a file.

Version:
$Revision: 5090 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Nested Class Summary
static class WekaExperimentFileEditor.SimpleSetupDialog
          A dialog for displaying the simple setup of an experiment.
 
Field Summary
protected  JButton m_ButtonCancel
          the Cancel button.
protected  JButton m_ButtonEdit
          the button to bring up the dialog for editing the experiment.
protected  JButton m_ButtonOK
          the OK button.
protected  BasePanel m_PanelEditor
          the editor panel.
protected  FileChooserPanel m_PanelFile
          the panel for selecting the experiment file.
 
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, m_ChosenOption, m_CustomEditor, m_WindowAdapter
 
Constructor Summary
WekaExperimentFileEditor()
           
 
Method Summary
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.
static String toString(AbstractOption option, Object object)
          Returns the file as string.
static Object valueOf(AbstractOption option, String str)
          Returns a file generated from the string.
 
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createWindowAdapter, getChosenOption, getCustomEditor, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_PanelFile

protected FileChooserPanel m_PanelFile
the panel for selecting the experiment file.


m_PanelEditor

protected BasePanel m_PanelEditor
the editor panel.


m_ButtonEdit

protected JButton m_ButtonEdit
the button to bring up the dialog for editing the experiment.


m_ButtonOK

protected JButton m_ButtonOK
the OK button.


m_ButtonCancel

protected JButton m_ButtonCancel
the Cancel button.

Constructor Detail

WekaExperimentFileEditor

public WekaExperimentFileEditor()
Method Detail

toString

public static String toString(AbstractOption option,
                              Object object)
Returns the file as string.

Parameters:
option - the current option
object - the file object to convert
Returns:
the generated string

valueOf

public static Object valueOf(AbstractOption option,
                             String str)
Returns a file generated from the string.

Parameters:
option - the current option
str - the string to convert to a file
Returns:
the generated file

toCustomStringRepresentation

public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.

Specified by:
toCustomStringRepresentation in interface 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 interface 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 interface PropertyEditor
Overrides:
getJavaInitializationString in class PropertyEditorSupport
Returns:
a value of type 'String'

createCustomEditor

protected JComponent createCustomEditor()
Gets the custom editor component.

Specified by:
createCustomEditor in class AbstractPropertyEditorSupport
Returns:
a value of type 'Component'

initForDisplay

protected void initForDisplay()
Initializes the display of the value.

Overrides:
initForDisplay in class AbstractPropertyEditorSupport

paintValue

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

Specified by:
paintValue in interface PropertyEditor
Overrides:
paintValue in class PropertyEditorSupport
Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into

isInlineEditingAvailable

public boolean isInlineEditingAvailable()
Checks whether inline editing is available.

Specified by:
isInlineEditingAvailable in interface InlineEditorSupport
Returns:
true if editing available

setInlineValue

public void setInlineValue(String value)
Sets the value to use.

Specified by:
setInlineValue in interface InlineEditorSupport
Parameters:
value - the value to use

getInlineValue

public String getInlineValue()
Returns the current value.

Specified by:
getInlineValue in interface InlineEditorSupport
Returns:
the current value

isInlineValueValid

public boolean isInlineValueValid(String value)
Checks whether the value id valid.

Specified by:
isInlineValueValid in interface InlineEditorSupport
Parameters:
value - the value to check
Returns:
true if valid


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.