Class ExperimenterPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.workspace.AbstractWorkspacePanel
-
- adams.gui.workspace.AbstractWorkspacePanelWithStatusBar
-
- adams.gui.tools.wekamultiexperimenter.ExperimenterPanel
-
- All Implemented Interfaces:
CleanUpHandler
,StatusMessageHandler
,StatusMessageHandlerExt
,MenuBarProvider
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ExperimenterPanel extends AbstractWorkspacePanelWithStatusBar
The Experimenter panel.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILENAME
the name of the props file with the general properties.protected File
m_CurrentFile
the current file.protected WekaFileChooser
m_FileChooserResults
the filechooser for loading/saving results.protected JMenuItem
m_MenuItemExecutionReset
the reset menu item.protected JMenuItem
m_MenuItemExecutionStart
the start menu item.protected JMenuItem
m_MenuItemExecutionStop
the stop menu item.protected JMenu
m_MenuItemFileLoadRecent
the "load recent" submenu.protected JMenuItem
m_MenuItemFileSave
the save menu item.protected JMenuItem
m_MenuItemFileSaveAs
the save as menu item.protected JMenuItem
m_MenuItemPrefixDatasetsWithIndex
the prefix datasets menu item.protected JMenu
m_MenuItemResultsLoadRecent
the "load recent" submenu.protected JMenuItem
m_MenuItemResultsSave
the save results menu item.protected JMenuItem
m_MenuItemUseFilename
the use filename menu item.protected AnalysisPanel
m_PanelAnalysis
the analysis panel.protected LogPanel
m_PanelLog
the log panel.protected AbstractSetupPanel
m_PanelSetup
the current setup panel.protected static Properties
m_Properties
the properties.protected RecentFilesHandlerWithCommandline<JMenu>
m_RecentFilesHandlerResults
the recent files handler for results.protected RecentFilesHandler<JMenu>
m_RecentFilesHandlerSetups
the recent files handler for setups.protected AbstractExperimentRunner
m_Runner
the runner thread.protected BaseTabbedPane
m_TabbedPane
the tabbed pane.static String
SESSION_FILE
the file to store the recent files in.-
Fields inherited from class adams.gui.workspace.AbstractWorkspacePanelWithStatusBar
m_StatusBar
-
Fields inherited from class adams.gui.workspace.AbstractWorkspacePanel
m_MenuBar, m_TitleGenerator
-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
Fields inherited from class javax.swing.JComponent
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.Component
accessibleContext, 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
Constructors Constructor Description ExperimenterPanel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishExecution()
Stops the execution.AnalysisPanel
getAnalysisPanel()
Returns the analysis panel.protected String
getDefaultTitle()
Returns the default title.Object
getExperiment()
Returns the current experiment.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).boolean
getPrefixDatasetsWithIndex()
Returns whether to use the filename as relation name.static Properties
getProperties()
Returns the properties that define the editor.boolean
getResetResults()
Returns whether to reset the results.boolean
getUseFilename()
Returns whether to use the filename as relation name.String
handlesExperiment(Object exp)
Checks whether the experiment can be handled.protected void
initGUI()
For initializing the GUI.protected void
initialize()
For initializing members.boolean
isExecuting()
Returns whether an experiment is currently being executed.void
logError(String msg, String title)
Logs the error message and also displays an error dialog.void
logError(String msg, Throwable t, String title)
Logs the error message and also displays an error dialog.void
logMessage(String msg)
Logs the message.void
newSetup(Class setup)
Sets the new setup panel.void
openRecentResults(RecentItemEvent<JMenu,RecentFilesHandlerWithCommandline.Setup> e)
For opening a recently used results file.void
openRecentSetup(RecentItemEvent<JMenu,File> e)
For opening a recently used experiment file.void
openResults()
Loads the results from a file.void
openResults(File file, weka.core.converters.AbstractFileLoader loader)
Loads the results from the file.void
openResultsDB()
Loads the results from a database.void
openSetup()
Lets the user choose an experiment file.void
openSetup(File file)
For opening an experiment file.void
saveResults()
Saves the results to a file.void
saveResults(File file)
Saves the results to the file.protected void
saveResults(File file, weka.core.converters.AbstractFileSaver saver)
Saves the results to the file.void
saveSetup()
Allows the user to save the file.void
saveSetup(File file)
Saves the experiment to the specified file.void
saveSetupAs()
Allows the user to save the file.void
setExperiment(Object value)
Sets the experiment to use.void
showProgress(String msg)
Displays a progresss message.void
showStatus(String msg)
Displays a message.void
startExecution()
Starts the execution.void
stopExecution()
Stops the execution.protected void
updateExperimentFromMenu(Object exp)
Updates the experiment using the state of some menu items.protected void
updateMenu()
updates the enabled state of the menu items.protected void
updateMenuFromExperiment(Object exp)
Updates some menu items from the experiment.protected void
updateTitle()
Updates the title of the dialog.-
Methods inherited from class adams.gui.workspace.AbstractWorkspacePanelWithStatusBar
showStatus
-
Methods inherited from class adams.gui.workspace.AbstractWorkspacePanel
cleanUp, close, finishInit, getTitle, getTitleGenerator, logError, logMessage, setTitle, update
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
SESSION_FILE
public static final String SESSION_FILE
the file to store the recent files in.- See Also:
- Constant Field Values
-
FILENAME
public static final String FILENAME
the name of the props file with the general properties.- See Also:
- Constant Field Values
-
m_Properties
protected static Properties m_Properties
the properties.
-
m_RecentFilesHandlerSetups
protected RecentFilesHandler<JMenu> m_RecentFilesHandlerSetups
the recent files handler for setups.
-
m_RecentFilesHandlerResults
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandlerResults
the recent files handler for results.
-
m_MenuItemFileLoadRecent
protected JMenu m_MenuItemFileLoadRecent
the "load recent" submenu.
-
m_MenuItemFileSave
protected JMenuItem m_MenuItemFileSave
the save menu item.
-
m_MenuItemFileSaveAs
protected JMenuItem m_MenuItemFileSaveAs
the save as menu item.
-
m_MenuItemExecutionReset
protected JMenuItem m_MenuItemExecutionReset
the reset menu item.
-
m_MenuItemExecutionStart
protected JMenuItem m_MenuItemExecutionStart
the start menu item.
-
m_MenuItemExecutionStop
protected JMenuItem m_MenuItemExecutionStop
the stop menu item.
-
m_MenuItemUseFilename
protected JMenuItem m_MenuItemUseFilename
the use filename menu item.
-
m_MenuItemPrefixDatasetsWithIndex
protected JMenuItem m_MenuItemPrefixDatasetsWithIndex
the prefix datasets menu item.
-
m_MenuItemResultsLoadRecent
protected JMenu m_MenuItemResultsLoadRecent
the "load recent" submenu.
-
m_MenuItemResultsSave
protected JMenuItem m_MenuItemResultsSave
the save results menu item.
-
m_CurrentFile
protected File m_CurrentFile
the current file.
-
m_TabbedPane
protected BaseTabbedPane m_TabbedPane
the tabbed pane.
-
m_PanelSetup
protected AbstractSetupPanel m_PanelSetup
the current setup panel.
-
m_PanelAnalysis
protected AnalysisPanel m_PanelAnalysis
the analysis panel.
-
m_PanelLog
protected LogPanel m_PanelLog
the log panel.
-
m_FileChooserResults
protected WekaFileChooser m_FileChooserResults
the filechooser for loading/saving results.
-
m_Runner
protected AbstractExperimentRunner m_Runner
the runner thread.
-
-
Method Detail
-
initialize
protected void initialize()
For initializing members.- Overrides:
initialize
in classAbstractWorkspacePanel
-
initGUI
protected void initGUI()
For initializing the GUI.- Overrides:
initGUI
in classAbstractWorkspacePanelWithStatusBar
-
getDefaultTitle
protected String getDefaultTitle()
Returns the default title.- Specified by:
getDefaultTitle
in classAbstractWorkspacePanel
- Returns:
- the default title
-
newSetup
public void newSetup(Class setup)
Sets the new setup panel.- Parameters:
setup
- the new setup panel
-
openSetup
public void openSetup()
Lets the user choose an experiment file.
-
openSetup
public void openSetup(File file)
For opening an experiment file.- Parameters:
file
- the file to open
-
openRecentSetup
public void openRecentSetup(RecentItemEvent<JMenu,File> e)
For opening a recently used experiment file.- Parameters:
e
- the event
-
saveSetup
public void saveSetup()
Allows the user to save the file. Prompts user with dialog if no filename set currently.
-
saveSetup
public void saveSetup(File file)
Saves the experiment to the specified file.
-
saveSetupAs
public void saveSetupAs()
Allows the user to save the file. Prompts user with dialog.
-
isExecuting
public boolean isExecuting()
Returns whether an experiment is currently being executed.- Returns:
- true if an experiment is running
-
startExecution
public void startExecution()
Starts the execution.
-
stopExecution
public void stopExecution()
Stops the execution.
-
finishExecution
public void finishExecution()
Stops the execution.
-
openResults
public void openResults()
Loads the results from a file.
-
openRecentResults
public void openRecentResults(RecentItemEvent<JMenu,RecentFilesHandlerWithCommandline.Setup> e)
For opening a recently used results file.- Parameters:
e
- the event
-
openResults
public void openResults(File file, weka.core.converters.AbstractFileLoader loader)
Loads the results from the file.- Parameters:
file
- the file to load the results from
-
openResultsDB
public void openResultsDB()
Loads the results from a database.
-
saveResults
public void saveResults()
Saves the results to a file.
-
saveResults
public void saveResults(File file)
Saves the results to the file.- Parameters:
file
- the file to save the results to
-
saveResults
protected void saveResults(File file, weka.core.converters.AbstractFileSaver saver)
Saves the results to the file.- Parameters:
file
- the file to save the results tosaver
- the saver to use
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBar
in interfaceMenuBarProvider
- Specified by:
getMenuBar
in classAbstractWorkspacePanel
- Returns:
- the menu bar
-
updateTitle
protected void updateTitle()
Updates the title of the dialog.- Specified by:
updateTitle
in classAbstractWorkspacePanel
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.- Specified by:
updateMenu
in classAbstractWorkspacePanel
-
updateMenuFromExperiment
protected void updateMenuFromExperiment(Object exp)
Updates some menu items from the experiment.- Parameters:
exp
- the experiment to use
-
updateExperimentFromMenu
protected void updateExperimentFromMenu(Object exp)
Updates the experiment using the state of some menu items.- Parameters:
exp
- the experiment to update
-
getExperiment
public Object getExperiment()
Returns the current experiment.- Returns:
- the experiment
-
setExperiment
public void setExperiment(Object value)
Sets the experiment to use.- Parameters:
value
- the experiment
-
handlesExperiment
public String handlesExperiment(Object exp)
Checks whether the experiment can be handled.- Parameters:
exp
- the experiment to check- Returns:
- true if can be handled
-
getAnalysisPanel
public AnalysisPanel getAnalysisPanel()
Returns the analysis panel.- Returns:
- the panel
-
getResetResults
public boolean getResetResults()
Returns whether to reset the results.- Returns:
- true if to reset the results
-
getUseFilename
public boolean getUseFilename()
Returns whether to use the filename as relation name.- Returns:
- true if to use filename
-
getPrefixDatasetsWithIndex
public boolean getPrefixDatasetsWithIndex()
Returns whether to use the filename as relation name.- Returns:
- true if to use filename
-
logMessage
public void logMessage(String msg)
Logs the message.- Specified by:
logMessage
in classAbstractWorkspacePanel
- Parameters:
msg
- the log message
-
logError
public void logError(String msg, String title)
Logs the error message and also displays an error dialog.- Specified by:
logError
in classAbstractWorkspacePanel
- Parameters:
msg
- the error messagetitle
- the title for the dialog
-
logError
public void logError(String msg, Throwable t, String title)
Logs the error message and also displays an error dialog.- Overrides:
logError
in classAbstractWorkspacePanel
- Parameters:
msg
- the error messaget
- the exceptiontitle
- the title for the dialog
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceStatusMessageHandler
- Overrides:
showStatus
in classAbstractWorkspacePanelWithStatusBar
- Parameters:
msg
- the message to display
-
showProgress
public void showProgress(String msg)
Displays a progresss message.- Parameters:
msg
- the message to display
-
getProperties
public static Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-