weka.gui.experiment
Class SimpleSetupPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byweka.gui.experiment.SimpleSetupPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SimpleSetupPanel
extends javax.swing.JPanel

This panel controls the configuration of an experiment.

Version:
$Revision: 1.3 $
Author:
Richard kirkby (rkirkby@cs.waikato.ac.nz)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String DEST_ARFF_TEXT
           
protected static java.lang.String DEST_CSV_TEXT
           
protected static java.lang.String DEST_DATABASE_TEXT
          The strings used to identify the combo box choices
protected  AlgorithmListPanel m_AlgorithmListPanel
          The panel for configuring selected algorithms
protected  ExtensionFileFilter m_arffFileFilter
          FIlter for choosing ARFF files
protected  javax.swing.JButton m_BrowseDestinationButton
          Button for browsing destination files
protected  ExtensionFileFilter m_csvFileFilter
          Filter for choosing CSV files
protected  DatasetListPanel m_DatasetListPanel
          The panel for configuring selected datasets
protected  javax.swing.JFileChooser m_DestFileChooser
          The file chooser for selecting result destinations
protected  java.lang.String m_destinationDatabaseURL
          The database destination URL to store results into
protected  java.lang.String m_destinationFilename
          The filename to store results into
protected  Experiment m_Exp
          The experiment being configured
protected  javax.swing.JRadioButton m_ExpClassificationRBut
          Radio button for choosing classification experiment
protected  javax.swing.JLabel m_ExperimentParameterLabel
          Label for parameter field
protected  javax.swing.JTextField m_ExperimentParameterTField
          Input field for experiment parameter
protected  javax.swing.JComboBox m_ExperimentTypeCBox
          Combo box for choosing experiment type
protected  javax.swing.filechooser.FileFilter m_ExpFilter
          A filter to ensure only experiment files get shown in the chooser
protected  javax.swing.JRadioButton m_ExpRegressionRBut
          Radio button for choosing regression experiment
protected  javax.swing.JFileChooser m_FileChooser
          The file chooser for selecting experiments
protected  SetupModePanel m_modePanel
          The panel which switched between simple and advanced setup modes
protected  javax.swing.JButton m_NewBut
          Click to create a new experiment with default settings
protected  javax.swing.JTextArea m_NotesText
          Area for user notes Default of 5 rows
protected  javax.swing.JTextField m_NumberOfRepetitionsTField
          Input field for number of repetitions
protected  int m_numFolds
          The number of folds for a cross-validation experiment
protected  int m_numRepetitions
          The number of times to repeat the sub-experiment
protected  javax.swing.JButton m_OpenBut
          Click to load an experiment
protected  javax.swing.JRadioButton m_OrderAlgorithmsFirstRBut
          Radio button for choosing algorithms first in order of execution
protected  javax.swing.JRadioButton m_OrderDatasetsFirstRBut
          Radio button for choosing datasets first in order of execution
protected  javax.swing.JComboBox m_ResultsDestinationCBox
          Combo box for choosing experiment destination type
protected  javax.swing.JLabel m_ResultsDestinationPathLabel
          Label for destination field
protected  javax.swing.JTextField m_ResultsDestinationPathTField
          Input field for result destination path
protected  javax.swing.JButton m_SaveBut
          Click to save an experiment
protected  java.beans.PropertyChangeSupport m_Support
          Manages sending notifications to people when we change the experiment, at this stage, only the resultlistener so the resultpanel can update.
protected  double m_trainPercent
          The training percentage for a train/test split experiment
protected  boolean m_userHasBeenAskedAboutConversion
          Whether or not the user has consented for the experiment to be simplified
protected static java.lang.String TYPE_CROSSVALIDATION_TEXT
           
protected static java.lang.String TYPE_FIXEDSPLIT_TEXT
           
protected static java.lang.String TYPE_RANDOMSPLIT_TEXT
           
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SimpleSetupPanel()
          Creates the setup panel with no initial experiment.
SimpleSetupPanel(Experiment exp)
          Creates the setup panel with the supplied initial experiment.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a PropertyChangeListener who will be notified of value changes.
private  void chooseDestinationFile()
          Lets user browse for a destination file..
private  void chooseURLUsername()
          Lets user enter username/password/URL.
private  void destinationAddressChanged()
          Responds to a change in the destination address.
private  void destinationTypeChanged()
          Responds to a change in the destination type.
private  void expParamChanged()
          Responds to a change in the experiment parameter.
private  void expTypeChanged()
          Responds to a change in the experiment type.
 Experiment getExperiment()
          Gets the currently configured experiment.
static void main(java.lang.String[] args)
          Tests out the experiment setup from the command line.
private  void numRepetitionsChanged()
          Responds to a change in the number of repetitions.
private  void openExperiment()
          Prompts the user to select an experiment file and loads it.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a PropertyChangeListener.
private  void saveExperiment()
          Prompts the user for a filename to save the experiment to, then saves the experiment.
 boolean setExperiment(Experiment exp)
          Sets the experiment to configure.
 void setModePanel(SetupModePanel modePanel)
          Sets the panel used to switch between simple and advanced modes.
private  boolean userWantsToConvert()
          Gets te users consent for converting the experiment to a simpler form.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Exp

protected Experiment m_Exp
The experiment being configured


m_modePanel

protected SetupModePanel m_modePanel
The panel which switched between simple and advanced setup modes


m_destinationDatabaseURL

protected java.lang.String m_destinationDatabaseURL
The database destination URL to store results into


m_destinationFilename

protected java.lang.String m_destinationFilename
The filename to store results into


m_numFolds

protected int m_numFolds
The number of folds for a cross-validation experiment


m_trainPercent

protected double m_trainPercent
The training percentage for a train/test split experiment


m_numRepetitions

protected int m_numRepetitions
The number of times to repeat the sub-experiment


m_userHasBeenAskedAboutConversion

protected boolean m_userHasBeenAskedAboutConversion
Whether or not the user has consented for the experiment to be simplified


m_csvFileFilter

protected ExtensionFileFilter m_csvFileFilter
Filter for choosing CSV files


m_arffFileFilter

protected ExtensionFileFilter m_arffFileFilter
FIlter for choosing ARFF files


m_OpenBut

protected javax.swing.JButton m_OpenBut
Click to load an experiment


m_SaveBut

protected javax.swing.JButton m_SaveBut
Click to save an experiment


m_NewBut

protected javax.swing.JButton m_NewBut
Click to create a new experiment with default settings


m_ExpFilter

protected javax.swing.filechooser.FileFilter m_ExpFilter
A filter to ensure only experiment files get shown in the chooser


m_FileChooser

protected javax.swing.JFileChooser m_FileChooser
The file chooser for selecting experiments


m_DestFileChooser

protected javax.swing.JFileChooser m_DestFileChooser
The file chooser for selecting result destinations


m_ResultsDestinationCBox

protected javax.swing.JComboBox m_ResultsDestinationCBox
Combo box for choosing experiment destination type


m_ResultsDestinationPathLabel

protected javax.swing.JLabel m_ResultsDestinationPathLabel
Label for destination field


m_ResultsDestinationPathTField

protected javax.swing.JTextField m_ResultsDestinationPathTField
Input field for result destination path


m_BrowseDestinationButton

protected javax.swing.JButton m_BrowseDestinationButton
Button for browsing destination files


m_ExperimentTypeCBox

protected javax.swing.JComboBox m_ExperimentTypeCBox
Combo box for choosing experiment type


m_ExperimentParameterLabel

protected javax.swing.JLabel m_ExperimentParameterLabel
Label for parameter field


m_ExperimentParameterTField

protected javax.swing.JTextField m_ExperimentParameterTField
Input field for experiment parameter


m_ExpClassificationRBut

protected javax.swing.JRadioButton m_ExpClassificationRBut
Radio button for choosing classification experiment


m_ExpRegressionRBut

protected javax.swing.JRadioButton m_ExpRegressionRBut
Radio button for choosing regression experiment


m_NumberOfRepetitionsTField

protected javax.swing.JTextField m_NumberOfRepetitionsTField
Input field for number of repetitions


m_OrderDatasetsFirstRBut

protected javax.swing.JRadioButton m_OrderDatasetsFirstRBut
Radio button for choosing datasets first in order of execution


m_OrderAlgorithmsFirstRBut

protected javax.swing.JRadioButton m_OrderAlgorithmsFirstRBut
Radio button for choosing algorithms first in order of execution


DEST_DATABASE_TEXT

protected static java.lang.String DEST_DATABASE_TEXT
The strings used to identify the combo box choices


DEST_ARFF_TEXT

protected static java.lang.String DEST_ARFF_TEXT

DEST_CSV_TEXT

protected static java.lang.String DEST_CSV_TEXT

TYPE_CROSSVALIDATION_TEXT

protected static java.lang.String TYPE_CROSSVALIDATION_TEXT

TYPE_RANDOMSPLIT_TEXT

protected static java.lang.String TYPE_RANDOMSPLIT_TEXT

TYPE_FIXEDSPLIT_TEXT

protected static java.lang.String TYPE_FIXEDSPLIT_TEXT

m_DatasetListPanel

protected DatasetListPanel m_DatasetListPanel
The panel for configuring selected datasets


m_AlgorithmListPanel

protected AlgorithmListPanel m_AlgorithmListPanel
The panel for configuring selected algorithms


m_NotesText

protected javax.swing.JTextArea m_NotesText
Area for user notes Default of 5 rows


m_Support

protected java.beans.PropertyChangeSupport m_Support
Manages sending notifications to people when we change the experiment, at this stage, only the resultlistener so the resultpanel can update.

Constructor Detail

SimpleSetupPanel

public SimpleSetupPanel(Experiment exp)
Creates the setup panel with the supplied initial experiment.

Parameters:
exp - a value of type 'Experiment'

SimpleSetupPanel

public SimpleSetupPanel()
Creates the setup panel with no initial experiment.

Method Detail

userWantsToConvert

private boolean userWantsToConvert()
Gets te users consent for converting the experiment to a simpler form.

Returns:
true if the user has given consent, false otherwise

setModePanel

public void setModePanel(SetupModePanel modePanel)
Sets the panel used to switch between simple and advanced modes.

Parameters:
modePanel - the panel

setExperiment

public boolean setExperiment(Experiment exp)
Sets the experiment to configure.

Parameters:
exp - a value of type 'Experiment'
Returns:
true if experiment could be configured, false otherwise

getExperiment

public Experiment getExperiment()
Gets the currently configured experiment.

Returns:
the currently configured experiment.

openExperiment

private void openExperiment()
Prompts the user to select an experiment file and loads it.


saveExperiment

private void saveExperiment()
Prompts the user for a filename to save the experiment to, then saves the experiment.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener who will be notified of value changes.

Parameters:
l - a value of type 'PropertyChangeListener'

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener.

Parameters:
l - a value of type 'PropertyChangeListener'

destinationTypeChanged

private void destinationTypeChanged()
Responds to a change in the destination type.


destinationAddressChanged

private void destinationAddressChanged()
Responds to a change in the destination address.


expTypeChanged

private void expTypeChanged()
Responds to a change in the experiment type.


expParamChanged

private void expParamChanged()
Responds to a change in the experiment parameter.


numRepetitionsChanged

private void numRepetitionsChanged()
Responds to a change in the number of repetitions.


chooseURLUsername

private void chooseURLUsername()
Lets user enter username/password/URL.


chooseDestinationFile

private void chooseDestinationFile()
Lets user browse for a destination file..


main

public static void main(java.lang.String[] args)
Tests out the experiment setup from the command line.

Parameters:
args - arguments to the program.