Class 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.AbstractWorkspacePanelWithStatusBar
    The Experimenter panel.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • 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_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.
    • Constructor Detail

      • ExperimenterPanel

        public ExperimenterPanel()
    • Method Detail

      • initialize

        protected void initialize()
        For initializing members.
        Overrides:
        initialize in class adams.gui.workspace.AbstractWorkspacePanel
      • initGUI

        protected void initGUI()
        For initializing the GUI.
        Overrides:
        initGUI in class adams.gui.workspace.AbstractWorkspacePanelWithStatusBar
      • getDefaultTitle

        protected String getDefaultTitle()
        Returns the default title.
        Specified by:
        getDefaultTitle in class adams.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 to
        saver - 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 interface adams.gui.core.MenuBarProvider
        Specified by:
        getMenuBar in class adams.gui.workspace.AbstractWorkspacePanel
        Returns:
        the menu bar
      • updateTitle

        protected void updateTitle()
        Updates the title of the dialog.
        Specified by:
        updateTitle in class adams.gui.workspace.AbstractWorkspacePanel
      • updateMenu

        protected void updateMenu()
        updates the enabled state of the menu items.
        Specified by:
        updateMenu in class adams.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:
        logMessage in class adams.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:
        logError in class adams.gui.workspace.AbstractWorkspacePanel
        Parameters:
        msg - the error message
        title - 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 class adams.gui.workspace.AbstractWorkspacePanel
        Parameters:
        msg - the error message
        t - the exception
        title - the title for the dialog
      • showStatus

        public void showStatus​(String msg)
        Displays a message.
        Specified by:
        showStatus in interface adams.core.StatusMessageHandler
        Overrides:
        showStatus in class adams.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