public class Experimenter extends MekaPanel implements MenuBarProvider, CommandLineArgsHandler, IterationNotificationListener, LogListener, StatisticsNotificationListener, ExecutionStageListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected HashMap<AbstractExperimenterMenuItem,AbstractAction> |
m_AdditionalMenuItems
additional menu items.
|
protected File |
m_CurrentFile
the current file.
|
protected Experiment |
m_Experiment
the current experiment.
|
protected ExperimentFileChooser |
m_FileChooser
the file chooser for the experiments.
|
protected LogTab |
m_LogTab
the log tab.
|
protected JMenuBar |
m_MenuBar
the menu bar.
|
protected JMenu |
m_MenuFileOpenRecent
the "load recent" submenu.
|
protected JMenuItem |
m_MenuItemExecutionStart
the "start" menu item.
|
protected JMenuItem |
m_MenuItemExecutionStop
the "stop" menu item.
|
protected JMenuItem |
m_MenuItemFileClose
the "close" menu item.
|
protected JMenu |
m_MenuItemFileNew
the "new" menu.
|
protected JMenuItem |
m_MenuItemFileOpen
the "open" menu item.
|
protected JMenuItem |
m_MenuItemFileSave
the "save" menu item.
|
protected JMenuItem |
m_MenuItemFileSaveAs
the "save as" menu item.
|
protected RecentFilesHandlerWithCommandline<JMenu> |
m_RecentFilesHandler
the recent files handler.
|
protected StatusBar |
m_StatusBar
the statusbar to use.
|
protected JTabbedPane |
m_TabbedPane
the tabbed pane for the various panels.
|
protected ArrayList<AbstractExperimenterTab> |
m_Tabs
the tabs.
|
static String |
SESSION_FILE
the file to store the recent files in.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Experimenter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the experimenter.
|
void |
experimentStage(ExecutionStageEvent e)
Gets called when the experiment enters a new stage.
|
protected void |
finishInit()
Finishes the initialization.
|
Experiment |
getCurrentExperiment()
Returns the current experiment, null if not available.
|
File |
getCurrentFile()
Returns the filename of the currently loaded data.
|
JMenuBar |
getMenuBar()
Returns the menu bar to use.
|
StatusBar |
getStatusBar()
Returns the status bar.
|
String |
handleException(AbstractExperimenterTab tab,
String msg,
Throwable t)
Logs the stacktrace along with the message on the log tab and returns a
combination of both of them as string.
|
protected void |
initGUI()
Initializes the widgets.
|
protected void |
initialize()
Initializes the members.
|
protected void |
log(AbstractExperimenterTab tab,
String msg)
For logging messages.
|
void |
logMessage(LogEvent e)
Gets called if there is a new log message.
|
static void |
main(String[] args)
Starts the GUI.
|
void |
newSetup(Class cls)
Instantiates an experiment from the provided class.
|
void |
nextIteration(IterationNotificationEvent e)
Gets called if there is a new iteration (classifier/dataset combination) occurring in the experiment.
|
void |
notifyTabsExperimentChanged(AbstractExperimenterTab source,
Experiment exp)
Notifies all the tabs that the experiment has changed.
|
void |
open()
Opens an experiment.
|
void |
open(File file,
ExperimentFileHandler handler)
Opens the specified experiment file.
|
void |
processCommandLineArgs(String[] args)
Processes the commandline arguments.
|
void |
save()
Saves the current experiment.
|
void |
save(File file,
ExperimentFileHandler handler)
Saves the experiment to the specified file.
|
void |
saveAs()
Saves the current experiment under a new name.
|
void |
start()
Starts the experiment.
|
void |
statisticsAvailable(StatisticsNotificationEvent e)
Gets called if new statistics have become available.
|
void |
stop()
Stops the current experiment.
|
protected void |
updateMenu()
Updates the enabled/disabled state of the menu items.
|
closeParent, getParentDialog, getParentFrame
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, setVisible, unregisterKeyboardAction, update
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String SESSION_FILE
protected JTabbedPane m_TabbedPane
protected ArrayList<AbstractExperimenterTab> m_Tabs
protected JMenuBar m_MenuBar
protected JMenu m_MenuItemFileNew
protected JMenuItem m_MenuItemFileOpen
protected JMenuItem m_MenuItemFileSave
protected JMenu m_MenuFileOpenRecent
protected JMenuItem m_MenuItemFileSaveAs
protected JMenuItem m_MenuItemFileClose
protected JMenuItem m_MenuItemExecutionStart
protected JMenuItem m_MenuItemExecutionStop
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
protected StatusBar m_StatusBar
protected File m_CurrentFile
protected LogTab m_LogTab
protected ExperimentFileChooser m_FileChooser
protected Experiment m_Experiment
protected HashMap<AbstractExperimenterMenuItem,AbstractAction> m_AdditionalMenuItems
protected void initialize()
initialize
in class MekaPanel
protected void finishInit()
finishInit
in class MekaPanel
public void notifyTabsExperimentChanged(AbstractExperimenterTab source, Experiment exp)
source
- not null if a tab triggered this callexp
- the new experiment to usepublic JMenuBar getMenuBar()
getMenuBar
in interface MenuBarProvider
protected void updateMenu()
public StatusBar getStatusBar()
public Experiment getCurrentExperiment()
public File getCurrentFile()
public void newSetup(Class cls)
cls
- the experiment class to usepublic void open()
public void open(File file, ExperimentFileHandler handler)
file
- the file to openhandler
- the handler to usepublic void save(File file, ExperimentFileHandler handler)
file
- the file to save the experiment tohandler
- the saver to use, determines it automatically if nullpublic void save()
public void saveAs()
public void close()
public void start()
public void stop()
public void nextIteration(IterationNotificationEvent e)
nextIteration
in interface IterationNotificationListener
e
- the eventpublic void logMessage(LogEvent e)
logMessage
in interface LogListener
e
- the eventpublic void statisticsAvailable(StatisticsNotificationEvent e)
statisticsAvailable
in interface StatisticsNotificationListener
e
- the eventpublic void experimentStage(ExecutionStageEvent e)
experimentStage
in interface ExecutionStageListener
e
- the eventprotected void log(AbstractExperimenterTab tab, String msg)
tab
- the origin of the messagemsg
- the message to outputpublic String handleException(AbstractExperimenterTab tab, String msg, Throwable t)
tab
- the origin of the messagemsg
- the message for the exceptiont
- the exceptionpublic void processCommandLineArgs(String[] args)
processCommandLineArgs
in interface CommandLineArgsHandler
args
- the argumentsCopyright © 2017. All Rights Reserved.