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:
adams.core.CleanUpHandler,adams.core.StatusMessageHandler,adams.core.StatusMessageHandlerExt,adams.gui.core.MenuBarProvider,ImageObserver,MenuContainer,Serializable,Accessible
public class ExperimenterPanel extends adams.gui.workspace.AbstractWorkspacePanelWithStatusBarThe 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 StringFILENAMEthe name of the props file with the general properties.protected Filem_CurrentFilethe current file.protected WekaFileChooserm_FileChooserResultsthe filechooser for loading/saving results.protected JMenuItemm_MenuItemExecutionResetthe reset menu item.protected JMenuItemm_MenuItemExecutionStartthe start menu item.protected JMenuItemm_MenuItemExecutionStopthe stop menu item.protected JMenum_MenuItemFileLoadRecentthe "load recent" submenu.protected JMenuItemm_MenuItemFileSavethe save menu item.protected JMenuItemm_MenuItemFileSaveAsthe save as menu item.protected JMenuItemm_MenuItemPrefixDatasetsWithIndexthe prefix datasets menu item.protected JMenum_MenuItemResultsLoadRecentthe "load recent" submenu.protected JMenuItemm_MenuItemResultsSavethe save results menu item.protected JMenuItemm_MenuItemUseFilenamethe use filename menu item.protected AnalysisPanelm_PanelAnalysisthe analysis panel.protected LogPanelm_PanelLogthe log panel.protected AbstractSetupPanelm_PanelSetupthe current setup panel.protected static adams.core.Propertiesm_Propertiesthe properties.protected adams.gui.core.RecentFilesHandlerWithCommandline<JMenu>m_RecentFilesHandlerResultsthe recent files handler for results.protected adams.gui.core.RecentFilesHandler<JMenu>m_RecentFilesHandlerSetupsthe recent files handler for setups.protected AbstractExperimentRunnerm_Runnerthe runner thread.protected adams.gui.core.BaseTabbedPanem_TabbedPanethe tabbed pane.static StringSESSION_FILEthe file to store the recent files in.-
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 voidfinishExecution()Stops the execution.AnalysisPanelgetAnalysisPanel()Returns the analysis panel.protected StringgetDefaultTitle()Returns the default title.ObjectgetExperiment()Returns the current experiment.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).booleangetPrefixDatasetsWithIndex()Returns whether to use the filename as relation name.static adams.core.PropertiesgetProperties()Returns the properties that define the editor.booleangetResetResults()Returns whether to reset the results.booleangetUseFilename()Returns whether to use the filename as relation name.StringhandlesExperiment(Object exp)Checks whether the experiment can be handled.protected voidinitGUI()For initializing the GUI.protected voidinitialize()For initializing members.booleanisExecuting()Returns whether an experiment is currently being executed.voidlogError(String msg, String title)Logs the error message and also displays an error dialog.voidlogError(String msg, Throwable t, String title)Logs the error message and also displays an error dialog.voidlogMessage(String msg)Logs the message.voidnewSetup(Class setup)Sets the new setup panel.voidopenRecentResults(adams.gui.event.RecentItemEvent<JMenu,adams.gui.core.RecentFilesHandlerWithCommandline.Setup> e)For opening a recently used results file.voidopenRecentSetup(adams.gui.event.RecentItemEvent<JMenu,File> e)For opening a recently used experiment file.voidopenResults()Loads the results from a file.voidopenResults(File file, weka.core.converters.AbstractFileLoader loader)Loads the results from the file.voidopenResultsDB()Loads the results from a database.voidopenSetup()Lets the user choose an experiment file.voidopenSetup(File file)For opening an experiment file.voidsaveResults()Saves the results to a file.voidsaveResults(File file)Saves the results to the file.protected voidsaveResults(File file, weka.core.converters.AbstractFileSaver saver)Saves the results to the file.voidsaveSetup()Allows the user to save the file.voidsaveSetup(File file)Saves the experiment to the specified file.voidsaveSetupAs()Allows the user to save the file.voidsetExperiment(Object value)Sets the experiment to use.voidshowProgress(String msg)Displays a progresss message.voidshowStatus(String msg)Displays a message.voidstartExecution()Starts the execution.voidstopExecution()Stops the execution.protected voidupdateExperimentFromMenu(Object exp)Updates the experiment using the state of some menu items.protected voidupdateMenu()updates the enabled state of the menu items.protected voidupdateMenuFromExperiment(Object exp)Updates some menu items from the experiment.protected voidupdateTitle()Updates the title of the dialog.-
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 adams.core.Properties m_Properties
the properties.
-
m_RecentFilesHandlerSetups
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentFilesHandlerSetups
the recent files handler for setups.
-
m_RecentFilesHandlerResults
protected adams.gui.core.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 adams.gui.core.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:
initializein classadams.gui.workspace.AbstractWorkspacePanel
-
initGUI
protected void initGUI()
For initializing the GUI.- Overrides:
initGUIin classadams.gui.workspace.AbstractWorkspacePanelWithStatusBar
-
getDefaultTitle
protected String getDefaultTitle()
Returns the default title.- Specified by:
getDefaultTitlein classadams.gui.workspace.AbstractWorkspacePanel- 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(adams.gui.event.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(adams.gui.event.RecentItemEvent<JMenu,adams.gui.core.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:
getMenuBarin interfaceadams.gui.core.MenuBarProvider- Specified by:
getMenuBarin classadams.gui.workspace.AbstractWorkspacePanel- Returns:
- the menu bar
-
updateTitle
protected void updateTitle()
Updates the title of the dialog.- Specified by:
updateTitlein classadams.gui.workspace.AbstractWorkspacePanel
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.- Specified by:
updateMenuin classadams.gui.workspace.AbstractWorkspacePanel
-
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:
logMessagein classadams.gui.workspace.AbstractWorkspacePanel- 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:
logErrorin classadams.gui.workspace.AbstractWorkspacePanel- 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:
logErrorin classadams.gui.workspace.AbstractWorkspacePanel- Parameters:
msg- the error messaget- the exceptiontitle- the title for the dialog
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatusin interfaceadams.core.StatusMessageHandler- Overrides:
showStatusin classadams.gui.workspace.AbstractWorkspacePanelWithStatusBar- 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 adams.core.Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-