Class FlowRunnerPanel

    • Field Detail

      • m_Properties

        protected static Properties m_Properties
        the properties.
      • m_RunningSwingWorker

        protected boolean m_RunningSwingWorker
        whether a flow is currently being loaded, etc. using a SwingWorker.
      • m_CurrentFlow

        protected Actor m_CurrentFlow
        the current flow.
      • m_CurrentFile

        protected File m_CurrentFile
        the filename of the current flow.
      • m_FileChooser

        protected FlowFileChooser m_FileChooser
        the filedialog for loading/saving flows.
      • m_TitleGenerator

        protected TitleGenerator m_TitleGenerator
        for generating the title.
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar, if used.
      • m_MenuItemLoadRecent

        protected JMenu m_MenuItemLoadRecent
        the "load recent" submenu.
      • m_ActionPauseAndResume

        protected AbstractBaseAction m_ActionPauseAndResume
        the "pause" item.
      • m_ActionExecutionLogErrors

        protected AbstractBaseAction m_ActionExecutionLogErrors
        the "log errors" action.
      • m_ActionExecutionDisplayErrors

        protected AbstractBaseAction m_ActionExecutionDisplayErrors
        the "display errors" action.
      • m_ActionNewWindow

        protected AbstractBaseAction m_ActionNewWindow
        the "new window" action.
      • m_ActionDuplicateWindow

        protected AbstractBaseAction m_ActionDuplicateWindow
        the "duplicate window" action.
      • m_ParameterScrollPane

        protected BaseScrollPane m_ParameterScrollPane
        the scroll pane for the parameters.
      • m_PanelParameters

        protected JPanel m_PanelParameters
        the panel for the SetVariable singletons.
      • m_LabelFlowAnnotation

        protected JLabel m_LabelFlowAnnotation
        the label for the flow annotation.
      • m_CurrentSetVariables

        protected List<SetVariable> m_CurrentSetVariables
        the current SetVariable singletons (used for displaying the parameters).
      • m_CurrentParameters

        protected List<BaseTextField> m_CurrentParameters
        the textfields for the current SetVariable singletons.
      • m_CurrentHelpButtons

        protected List<BaseButton> m_CurrentHelpButtons
        the buttons for the current SetVariable singletons.
      • m_CurrentWorker

        protected FlowWorker m_CurrentWorker
        the current worker.
      • m_CurrentThread

        protected Thread m_CurrentThread
        the current worker thread.
      • m_LastFlow

        protected Actor m_LastFlow
        the last flow that was run.
      • m_PanelBottom

        protected BasePanel m_PanelBottom
        the panel at the bottom.
      • m_SplitPane

        protected BaseSplitPane m_SplitPane
        the split pane to use for tree and notification area.
    • Constructor Detail

      • FlowRunnerPanel

        public FlowRunnerPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class ToolBarPanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class ToolBarPanel
      • getMenuBar

        public JMenuBar getMenuBar()
        Creates a menu bar (singleton per panel object). Can be used in frames.
        Specified by:
        getMenuBar in interface MenuBarProvider
        Returns:
        the menu bar
      • updateActions

        protected void updateActions()
        updates the enabled state of the menu items.
        Specified by:
        updateActions in class ToolBarPanel
      • updateWidgets

        protected void updateWidgets()
        Updates the enabled state of the widgets.
      • update

        public void update()
        updates the enabled state etc. of all the GUI elements.
        Specified by:
        update in interface FlowWorkerHandler
      • findSetVariableActors

        protected void findSetVariableActors​(Actor parent,
                                             List<SetVariable> list)
        Locates all the SetVariable singleton actors below the parent.
        Parameters:
        parent - the actor to search below
        list - for storing the SetVariable actors
      • updateAnnotation

        protected void updateAnnotation()
        Updates the top-level annotation.
        See Also:
        m_LabelFlowAnnotation
      • updateParameters

        protected void updateParameters()
        Makes any top-level SetVariable singletons in the GUI available.
        See Also:
        m_PanelParameters
      • getTitleGenerator

        public TitleGenerator getTitleGenerator()
        Returns the title generator in use.
        Returns:
        the generator
      • updateTitle

        protected void updateTitle()
        Updates the title of the dialog.
      • setCurrentFile

        protected void setCurrentFile​(File value)
        Sets the current file.
        Parameters:
        value - the file
      • getCurrentFile

        public File getCurrentFile()
        Returns the current file in use.
        Returns:
        the current file, can be null
      • loadUnsafe

        public void loadUnsafe​(File file)
        Attempts to load the file. If non-existent, then a new flow will be created and the current filename set to the provided one.
        Parameters:
        file - the file to load
      • runUnsafe

        public void runUnsafe​(File file)
        Attempts to load/run the file. If non-existent, then a new flow will be created and the current filename set to the provided one.
        Parameters:
        file - the file to load/run
      • load

        protected void load​(FlowReader reader,
                            File file)
        Loads a flow.
        Parameters:
        reader - the reader to use
        file - the flow to load
      • load

        protected void load​(FlowReader reader,
                            File file,
                            boolean execute)
        Loads a flow.
        Parameters:
        reader - the reader to use
        file - the flow to load
      • reset

        protected void reset()
        Resets the GUI to default values.
      • setCurrentFlow

        public void setCurrentFlow​(Actor flow)
        Sets the flow to work on.
        Parameters:
        flow - the flow to use
      • setCurrentFlow

        public void setCurrentFlow​(Node flow)
        Sets the flow to work on.
        Parameters:
        flow - the flow to use
      • getCurrentFlow

        public Actor getCurrentFlow()
        Returns the current flow.
        Returns:
        the current flow, can be null
      • open

        protected void open()
        Opens a flow.
      • run

        public void run()
        Executes the flow.
      • run

        public void run​(boolean showNotification,
                        boolean debug)
        Executes the flow.
        Parameters:
        showNotification - whether to show notifications about errors/stopped/finished
        debug - whether to run in debug mode
      • isRunning

        public boolean isRunning()
        Returns whether a flow is currently running.
        Returns:
        true if a flow is being executed
      • isStopping

        public boolean isStopping()
        Returns whether a flow is currently being stopped.
        Returns:
        true if a flow is currently being stopped
      • isRunningSwingWorker

        public boolean isRunningSwingWorker()
        Returns whether a swing worker is currently running.
        Returns:
        true if a swing worker is being executed
      • pauseAndResume

        protected boolean pauseAndResume()
        Pauses/resumes the flow.
        Returns:
        true if paused, otherwise false
      • stop

        public void stop()
        Stops the flow. Does not cleanUp.
        See Also:
        stop(boolean)
      • stop

        public void stop​(boolean cleanUp)
        Stops the flow.
        Parameters:
        cleanUp - whether to clean up as well
      • displayErrors

        public void displayErrors()
        Displays the errors from the last run.
      • cleanUp

        public void cleanUp​(boolean destroy)
        Cleans up the last flow that was run.
        Parameters:
        destroy - whether to destroy the
      • close

        protected void close()
        Closes the dialog or frame.
      • newWindow

        protected void newWindow()
        Displays a new flow editor window/frame.
      • duplicateWindow

        protected void duplicateWindow()
        Duplicates the current window/frame, including the current flow.
      • showMessage

        protected void showMessage()
        Displays the message in the status bar in a separate dialog.
      • showMessage

        protected void showMessage​(String msg)
        Displays the given message in a separate dialog.
        Parameters:
        msg - the message to display
      • setCurrentDirectory

        public void setCurrentDirectory​(File dir)
        Sets the current directory in the FileChooser use for opening flows.
        Parameters:
        dir - the new current directory to use
      • getCurrentDirectory

        public File getCurrentDirectory()
        Returns the current directory set in the FileChooser used for opening the flows.
        Returns:
        the current directory
      • isHeadless

        public boolean isHeadless()
        Returns whether the flow gets executed in headless mode.
        Specified by:
        isHeadless in interface FlowWorkerHandler
        Returns:
        true if the flow gets executed in headless mode
      • getRunGC

        public boolean getRunGC()
        Returns whether the GC gets called after the flow execution.
        Specified by:
        getRunGC in interface FlowWorkerHandler
        Returns:
        always false
      • isModified

        public boolean isModified()
        Returns whether the flow is flagged as modified.
        Specified by:
        isModified in interface FlowWorkerHandler
        Returns:
        always false
      • showNotification

        public void showNotification​(JComponent comp,
                                     String icon)
        Displays the notification component.
        Specified by:
        showNotification in interface FlowWorkerHandler
        Parameters:
        comp - the component to display
        icon - the icon to display, null for none
      • cleanUp

        public void cleanUp()
        Cleans up the last flow that was run.
        Specified by:
        cleanUp in interface CleanUpHandler
      • setLastFlow

        public void setLastFlow​(Actor value)
        Sets the flow that was last executed.
        Specified by:
        setLastFlow in interface FlowWorkerHandler
        Parameters:
        value - the flow
      • getLastFlow

        public Actor getLastFlow()
        Returns the last executed flow (if any).
        Specified by:
        getLastFlow in interface FlowWorkerHandler
        Returns:
        the flow, null if not available
      • finishedExecution

        public void finishedExecution()
        Finishes up the execution, setting the worker to null.
        Specified by:
        finishedExecution in interface FlowWorkerHandler
      • getProperties

        public static Properties getProperties()
        Returns the properties that define the editor.
        Returns:
        the properties