weka.gui.experiment
Class ResultsPanel

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

public class ResultsPanel
extends javax.swing.JPanel

This panel controls simple analysis of experimental results.

Version:
$Revision: 1.26 $
Author:
Len Trigg (trigg@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
private  java.awt.Dimension COMBO_SIZE
           
private static java.lang.String[] FOR_JFC_1_1_DCBM_BUG
          This is needed to get around a bug in Swing <= 1.1 -- Once everyone is using Swing 1.1.1 or higher just remove this variable and use the no-arg constructor to DefaultComboBoxModel
protected  javax.swing.filechooser.FileFilter m_ArffFilter
          Filter to ensure only arff files are selected for result files
protected  javax.swing.JComboBox m_CompareCombo
          Lets the user select which performance measure to analyze
protected  javax.swing.DefaultComboBoxModel m_CompareModel
          The model embedded in m_CompareCombo
protected  java.awt.event.ActionListener m_ConfigureListener
          An actionlisteners that updates ttest settings
protected  javax.swing.JButton m_DatasetKeyBut
          Click to edit the columns used to determine the scheme
protected  javax.swing.JLabel m_DatasetKeyLabel
          Displays the currently selected column names for the scheme & options
protected  javax.swing.JList m_DatasetKeyList
          Displays the list of selected columns determining the scheme
protected  javax.swing.DefaultListModel m_DatasetKeyModel
          Stores the list of attributes for selecting the scheme columns
protected  javax.swing.DefaultComboBoxModel m_DatasetModel
          The model embedded in m_DatasetCombo
protected  Experiment m_Exp
          An experiment (used for identifying a result source) -- optional
protected  javax.swing.JFileChooser m_FileChooser
          The file chooser for selecting result files
protected  javax.swing.JButton m_FromDBaseBut
          Click to load results from a database
protected  javax.swing.JButton m_FromExpBut
          Click to get results from the destination given in the experiment
protected  javax.swing.JButton m_FromFileBut
          Click to load results from a file
protected  javax.swing.JLabel m_FromLab
          Displays a message about the current result set
protected  ResultHistoryPanel m_History
          A panel controlling results viewing
protected  InstanceQuery m_InstanceQuery
          Does any database querying for us
protected  Instances m_Instances
          The instances we're extracting results from
protected  java.lang.Thread m_LoadThread
          A thread to load results instances from a file or database
protected  javax.swing.JTextArea m_OutText
          Displays the output of tests
protected  javax.swing.JButton m_PerformBut
          Click to start the test
protected  javax.swing.JButton m_ResultKeyBut
          Click to edit the columns used to determine the scheme
protected  javax.swing.JLabel m_ResultKeyLabel
          Displays the currently selected column names for the scheme & options
protected  javax.swing.JList m_ResultKeyList
          Displays the list of selected columns determining the scheme
protected  javax.swing.DefaultListModel m_ResultKeyModel
          Stores the list of attributes for selecting the scheme columns
protected  javax.swing.JComboBox m_RunCombo
          Lets the user select which column contains the run number
protected  javax.swing.DefaultComboBoxModel m_RunModel
          The model embedded in m_RunCombo
(package private)  SaveBuffer m_SaveOut
          The buffer saving object for saving output
protected  javax.swing.JButton m_SaveOutBut
          Click to save test output to a file
protected  javax.swing.JCheckBox m_ShowStdDevs
          Lets the user select whether standard deviations are to be output or not
protected  javax.swing.JTextField m_SigTex
          Lets the user edit the test significance
protected  javax.swing.JButton m_TestsButton
          Lets the user select which scheme to base comparisons against
protected  javax.swing.JList m_TestsList
          Holds the list of schemes to base the test against
protected  javax.swing.DefaultListModel m_TestsModel
          The model embedded in m_TestsList
protected  PairedTTester m_TTester
          The PairedTTester object
protected static java.lang.String NO_SOURCE
          Message shown when no experimental results have been loaded
 
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
ResultsPanel()
          Creates the results panel with no initial experiment.
 
Method Summary
static void main(java.lang.String[] args)
          Tests out the results panel from the command line.
protected  void performTest()
          Carries out a t-test using the current configuration.
protected  void saveBuffer()
          Save the currently selected result buffer to a file.
protected  void setComboSizes()
          Sets the combo-boxes to a fixed size so they don't take up too much room that would be better devoted to the test output box
 void setDatasetKeyFromDialog()
           
 void setExperiment(Experiment exp)
          Tells the panel to use a new experiment.
protected  void setFromExpEnabled()
          Updates whether the current experiment is of a type that we can determine the results destination.
 void setInstances(Instances newInstances)
          Sets up the panel with a new set of instances, attempting to guess the correct settings for various columns.
protected  void setInstancesFromDatabaseTable(java.lang.String tableName)
          Queries a database to load results from the specified table name.
protected  void setInstancesFromDBaseQuery()
          Queries the user enough to make a database query to retrieve experiment results.
protected  void setInstancesFromExp(Experiment exp)
          Examines the supplied experiment to determine the results destination and attempts to load the results.
protected  void setInstancesFromFile(java.io.File f)
          Loads results from a set of instances contained in the supplied file.
 void setResultKeyFromDialog()
           
 void setTestBaseFromDialog()
           
protected  void setTTester()
          Updates the test chooser with possible tests
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, 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, 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

NO_SOURCE

protected static final java.lang.String NO_SOURCE
Message shown when no experimental results have been loaded

See Also:
Constant Field Values

m_FromFileBut

protected javax.swing.JButton m_FromFileBut
Click to load results from a file


m_FromDBaseBut

protected javax.swing.JButton m_FromDBaseBut
Click to load results from a database


m_FromExpBut

protected javax.swing.JButton m_FromExpBut
Click to get results from the destination given in the experiment


m_FromLab

protected javax.swing.JLabel m_FromLab
Displays a message about the current result set


FOR_JFC_1_1_DCBM_BUG

private static java.lang.String[] FOR_JFC_1_1_DCBM_BUG
This is needed to get around a bug in Swing <= 1.1 -- Once everyone is using Swing 1.1.1 or higher just remove this variable and use the no-arg constructor to DefaultComboBoxModel


m_DatasetModel

protected javax.swing.DefaultComboBoxModel m_DatasetModel
The model embedded in m_DatasetCombo


m_RunModel

protected javax.swing.DefaultComboBoxModel m_RunModel
The model embedded in m_RunCombo


m_CompareModel

protected javax.swing.DefaultComboBoxModel m_CompareModel
The model embedded in m_CompareCombo


m_TestsModel

protected javax.swing.DefaultListModel m_TestsModel
The model embedded in m_TestsList


m_DatasetKeyLabel

protected javax.swing.JLabel m_DatasetKeyLabel
Displays the currently selected column names for the scheme & options


m_DatasetKeyBut

protected javax.swing.JButton m_DatasetKeyBut
Click to edit the columns used to determine the scheme


m_DatasetKeyModel

protected javax.swing.DefaultListModel m_DatasetKeyModel
Stores the list of attributes for selecting the scheme columns


m_DatasetKeyList

protected javax.swing.JList m_DatasetKeyList
Displays the list of selected columns determining the scheme


m_RunCombo

protected javax.swing.JComboBox m_RunCombo
Lets the user select which column contains the run number


m_ResultKeyLabel

protected javax.swing.JLabel m_ResultKeyLabel
Displays the currently selected column names for the scheme & options


m_ResultKeyBut

protected javax.swing.JButton m_ResultKeyBut
Click to edit the columns used to determine the scheme


m_ResultKeyModel

protected javax.swing.DefaultListModel m_ResultKeyModel
Stores the list of attributes for selecting the scheme columns


m_ResultKeyList

protected javax.swing.JList m_ResultKeyList
Displays the list of selected columns determining the scheme


m_TestsButton

protected javax.swing.JButton m_TestsButton
Lets the user select which scheme to base comparisons against


m_TestsList

protected javax.swing.JList m_TestsList
Holds the list of schemes to base the test against


m_CompareCombo

protected javax.swing.JComboBox m_CompareCombo
Lets the user select which performance measure to analyze


m_SigTex

protected javax.swing.JTextField m_SigTex
Lets the user edit the test significance


m_ShowStdDevs

protected javax.swing.JCheckBox m_ShowStdDevs
Lets the user select whether standard deviations are to be output or not


m_PerformBut

protected javax.swing.JButton m_PerformBut
Click to start the test


m_SaveOutBut

protected javax.swing.JButton m_SaveOutBut
Click to save test output to a file


m_SaveOut

SaveBuffer m_SaveOut
The buffer saving object for saving output


m_OutText

protected javax.swing.JTextArea m_OutText
Displays the output of tests


m_History

protected ResultHistoryPanel m_History
A panel controlling results viewing


m_ArffFilter

protected javax.swing.filechooser.FileFilter m_ArffFilter
Filter to ensure only arff files are selected for result files


m_FileChooser

protected javax.swing.JFileChooser m_FileChooser
The file chooser for selecting result files


m_TTester

protected PairedTTester m_TTester
The PairedTTester object


m_Instances

protected Instances m_Instances
The instances we're extracting results from


m_InstanceQuery

protected InstanceQuery m_InstanceQuery
Does any database querying for us


m_LoadThread

protected java.lang.Thread m_LoadThread
A thread to load results instances from a file or database


m_Exp

protected Experiment m_Exp
An experiment (used for identifying a result source) -- optional


m_ConfigureListener

protected java.awt.event.ActionListener m_ConfigureListener
An actionlisteners that updates ttest settings


COMBO_SIZE

private java.awt.Dimension COMBO_SIZE
Constructor Detail

ResultsPanel

public ResultsPanel()
Creates the results panel with no initial experiment.

Method Detail

setComboSizes

protected void setComboSizes()
Sets the combo-boxes to a fixed size so they don't take up too much room that would be better devoted to the test output box


setExperiment

public void setExperiment(Experiment exp)
Tells the panel to use a new experiment.

Parameters:
exp - a value of type 'Experiment'

setFromExpEnabled

protected void setFromExpEnabled()
Updates whether the current experiment is of a type that we can determine the results destination.


setInstancesFromDBaseQuery

protected void setInstancesFromDBaseQuery()
Queries the user enough to make a database query to retrieve experiment results.


setInstancesFromExp

protected void setInstancesFromExp(Experiment exp)
Examines the supplied experiment to determine the results destination and attempts to load the results.

Parameters:
exp - a value of type 'Experiment'

setInstancesFromDatabaseTable

protected void setInstancesFromDatabaseTable(java.lang.String tableName)
Queries a database to load results from the specified table name. The database connection must have already made by m_InstanceQuery.

Parameters:
tableName - the name of the table containing results to retrieve.

setInstancesFromFile

protected void setInstancesFromFile(java.io.File f)
Loads results from a set of instances contained in the supplied file.

Parameters:
f - a value of type 'File'

setInstances

public void setInstances(Instances newInstances)
Sets up the panel with a new set of instances, attempting to guess the correct settings for various columns.

Parameters:
newInstances - the new set of results.

setTTester

protected void setTTester()
Updates the test chooser with possible tests


performTest

protected void performTest()
Carries out a t-test using the current configuration.


setResultKeyFromDialog

public void setResultKeyFromDialog()

setDatasetKeyFromDialog

public void setDatasetKeyFromDialog()

setTestBaseFromDialog

public void setTestBaseFromDialog()

saveBuffer

protected void saveBuffer()
Save the currently selected result buffer to a file.


main

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

Parameters:
args - ignored