Class FlowEditorPanel

    • Field Detail

      • FILENAME

        public static final String FILENAME
        the name of the props file with the general properties.
        See Also:
        Constant Field Values
      • FILENAME_TREEPOPUPMENU

        public static final String FILENAME_TREEPOPUPMENU
        the name of the props file with the tree menu.
        See Also:
        Constant Field Values
      • FILENAME_TREEQUICKACTIONMENU

        public static final String FILENAME_TREEQUICKACTIONMENU
        the name of the props file with the tree quick action menu.
        See Also:
        Constant Field Values
      • ACTORPROCESSORS_SESSION_FILE

        public static final String ACTORPROCESSORS_SESSION_FILE
        the file to store the recent actor processors in.
        See Also:
        Constant Field Values
      • m_Properties

        protected static Properties m_Properties
        the general properties.
      • m_PropertiesMenu

        protected static Properties m_PropertiesMenu
        the menu properties.
      • m_PropertiesTreePopup

        protected static Properties m_PropertiesTreePopup
        the tree popup menu properties.
      • m_PropertiesTreeQuickAction

        protected static Properties m_PropertiesTreeQuickAction
        the tree quick action menu properties.
      • m_MenuBar

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

        protected JMenu m_MenuFileNew
        the "new" sub-menu.
      • m_ActionFileOpen

        protected FlowEditorAction m_ActionFileOpen
        the "open" action.
      • m_MenuFileOpenRecent

        protected JMenu m_MenuFileOpenRecent
        the "open recent" submenu.
      • m_ActionFileNewFromClipboard

        protected FlowEditorAction m_ActionFileNewFromClipboard
        the "new from clipboard" action.
      • m_ActionFileSave

        protected FlowEditorAction m_ActionFileSave
        the "save" action.
      • m_ActionFileSaveAs

        protected FlowEditorAction m_ActionFileSaveAs
        the "save as" action.
      • m_ActionFileCheckOnSave

        protected FlowEditorAction m_ActionFileCheckOnSave
        the "check on save" action.
      • m_ActionFileRevert

        protected FlowEditorAction m_ActionFileRevert
        the "revert" action.
      • m_ActionFileExport

        protected FlowEditorAction m_ActionFileExport
        the "export" action.
      • m_ActionFileImport

        protected FlowEditorAction m_ActionFileImport
        the "import" action.
      • m_ActionFileProperties

        protected FlowEditorAction m_ActionFileProperties
        the "properties" action.
      • m_ActionFileClosePage

        protected FlowEditorAction m_ActionFileClosePage
        the "close page" action.
      • m_ActionFileClose

        protected FlowEditorAction m_ActionFileClose
        the "close" action.
      • m_ActionEditEnableUndo

        protected FlowEditorAction m_ActionEditEnableUndo
        the toggle undo action.
      • m_ActionEditUndo

        protected FlowEditorAction m_ActionEditUndo
        the undo action.
      • m_ActionEditRedo

        protected FlowEditorAction m_ActionEditRedo
        the redo action.
      • m_ActionEditDiff

        protected FlowEditorAction m_ActionEditDiff
        the diff action.
      • m_ActionEditClearClipboard

        protected FlowEditorAction m_ActionEditClearClipboard
        the clear clipboard action.
      • m_ActionEditFind

        protected FlowEditorAction m_ActionEditFind
        the find action.
      • m_ActionEditLocateActor

        protected FlowEditorAction m_ActionEditLocateActor
        the locate actor action.
      • m_ActionEditLocateVariable

        protected FlowEditorAction m_ActionEditLocateVariable
        the locate variable action.
      • m_ActionEditLocateStorageName

        protected FlowEditorAction m_ActionEditLocateStorageName
        the locate storage name action.
      • m_ActionEditCleanUpFlow

        protected FlowEditorAction m_ActionEditCleanUpFlow
        the remove disabled actors action.
      • m_ActionEditCheckVariables

        protected FlowEditorAction m_ActionEditCheckVariables
        the check variables action.
      • m_ActionEditInteractiveActors

        protected FlowEditorAction m_ActionEditInteractiveActors
        the interactive actors action.
      • m_ActionEditTimedActors

        protected FlowEditorAction m_ActionEditTimedActors
        the timed actors action.
      • m_ActionEditIgnoreNameChanges

        protected FlowEditorAction m_ActionEditIgnoreNameChanges
        the ignore name changes action.
      • m_ActionEditListTODOs

        protected FlowEditorAction m_ActionEditListTODOs
        the "list TODOs" action.
      • m_ActionEditProcessActors

        protected FlowEditorAction m_ActionEditProcessActors
        the "process actors" action.
      • m_MenuEditRecentActorProcessors

        protected JMenu m_MenuEditRecentActorProcessors
        recent actor processors menu.
      • m_ActionRunEnableAllBreakpoints

        protected FlowEditorAction m_ActionRunEnableAllBreakpoints
        the "enable all breakpoints" action.
      • m_ActionRunRemoveAllBreakpoints

        protected FlowEditorAction m_ActionRunRemoveAllBreakpoints
        the "remove all breakpoints" action.
      • m_ActionRunDisableAllBreakpoints

        protected FlowEditorAction m_ActionRunDisableAllBreakpoints
        the "disable all breakpoints" action.
      • m_ActionRunVariables

        protected FlowEditorAction m_ActionRunVariables
        the "variables" action.
      • m_ActionRunStorage

        protected FlowEditorAction m_ActionRunStorage
        the "storage" action.
      • m_ActionRunHeadless

        protected FlowEditorAction m_ActionRunHeadless
        the "headless" action.
      • m_ActionRunValidateSetup

        protected FlowEditorAction m_ActionRunValidateSetup
        the "check setup" action.
      • m_ActionRunRunAll

        protected FlowEditorAction m_ActionRunRunAll
        the "run all" action.
      • m_ActionRunDebug

        protected FlowEditorAction m_ActionRunDebug
        the "run (debug)" action.
      • m_ActionRunPauseAndResume

        protected FlowEditorAction m_ActionRunPauseAndResume
        the "pause" action.
      • m_ActionRunStop

        protected FlowEditorAction m_ActionRunStop
        the "stop" action.
      • m_ActionRunStopAll

        protected FlowEditorAction m_ActionRunStopAll
        the "stop all" action.
      • m_ActionRunKill

        protected FlowEditorAction m_ActionRunKill
        the "kill" action.
      • m_ActionRunDisplayErrors

        protected FlowEditorAction m_ActionRunDisplayErrors
        the "display errors" action.
      • m_ActionRunParseError

        protected FlowEditorAction m_ActionRunParseError
        the parse error action.
      • m_ActionRunClearGraphicalOutput

        protected FlowEditorAction m_ActionRunClearGraphicalOutput
        the "Clear graphical output" action.
      • m_MenuActive

        protected JMenu m_MenuActive
        the "active" menu.
      • m_ActionActiveVariables

        protected FlowEditorAction m_ActionActiveVariables
        the "variables" action.
      • m_ActionActiveStorage

        protected FlowEditorAction m_ActionActiveStorage
        the "storage" action.
      • m_ActionActiveHeadless

        protected FlowEditorAction m_ActionActiveHeadless
        the "headless" action.
      • m_ActionActiveGC

        protected FlowEditorAction m_ActionActiveGC
        the "gc" action.
      • m_ActionActiveValidateSetup

        protected FlowEditorAction m_ActionActiveValidateSetup
        the "check setup" action.
      • m_ActionActiveRun

        protected FlowEditorAction m_ActionActiveRun
        the "run" action.
      • m_ActionActiveDebug

        protected FlowEditorAction m_ActionActiveDebug
        the "run (debug)" action.
      • m_ActionActivePauseAndResume

        protected FlowEditorAction m_ActionActivePauseAndResume
        the "pause" action.
      • m_ActionActiveStop

        protected FlowEditorAction m_ActionActiveStop
        the "stop" action.
      • m_ActionActiveKill

        protected FlowEditorAction m_ActionActiveKill
        the "kill" action.
      • m_ActionActiveDisplayErrors

        protected FlowEditorAction m_ActionActiveDisplayErrors
        the "display errors" action.
      • m_ActionActiveClearGraphicalOutput

        protected FlowEditorAction m_ActionActiveClearGraphicalOutput
        the "Clear graphical output" action.
      • m_ActionViewShowToolbar

        protected FlowEditorAction m_ActionViewShowToolbar
        the "show toolbar" action.
      • m_ActionViewShowQuickInfo

        protected FlowEditorAction m_ActionViewShowQuickInfo
        the "show quick info" action.
      • m_ActionViewShowAnnotations

        protected FlowEditorAction m_ActionViewShowAnnotations
        the "show annotations" action.
      • m_ActionViewShowInputOutput

        protected FlowEditorAction m_ActionViewShowInputOutput
        the "show input/output" action.
      • m_ActionViewShowSource

        protected FlowEditorAction m_ActionViewShowSource
        the "show source" action.
      • m_ActionViewFullExpansion

        protected FlowEditorAction m_ActionViewFullExpansion
        the "full expansion" action.
      • m_ActionViewStatistics

        protected FlowEditorAction m_ActionViewStatistics
        the "statistic" action.
      • m_ActionViewRedraw

        protected FlowEditorAction m_ActionViewRedraw
        the "redraw" action.
      • m_ActionViewZoom

        protected FlowEditorAction m_ActionViewZoom
        the "zoom" action.
      • m_ActionNewWindow

        protected FlowEditorAction m_ActionNewWindow
        the "new window" action.
      • m_ActionMoveToNewWindow

        protected FlowEditorAction m_ActionMoveToNewWindow
        the "move to new window" action.
      • m_ActionDuplicateTabInNewWindow

        protected FlowEditorAction m_ActionDuplicateTabInNewWindow
        the "duplicate tab in new window" action.
      • m_ActionHalfWidth

        protected FlowEditorAction m_ActionHalfWidth
        the "half width" action.
      • m_ActionHalfHeight

        protected FlowEditorAction m_ActionHalfHeight
        the "half height" action.
      • m_ActionDuplicateTab

        protected FlowEditorAction m_ActionDuplicateTab
        the "duplicate tab" action.
      • m_ActionHelpActors

        protected FlowEditorAction m_ActionHelpActors
        the "help actors" action.
      • m_ActionHelpClasses

        protected FlowEditorAction m_ActionHelpClasses
        the "help classes" action.
      • m_ActionHelpVariables

        protected FlowEditorAction m_ActionHelpVariables
        the "help variables" action.
      • m_ActionHelpBooleanExpression

        protected FlowEditorAction m_ActionHelpBooleanExpression
        the "help boolean expression" action.
      • m_ActionHelpMathematicalExpression

        protected FlowEditorAction m_ActionHelpMathematicalExpression
        the "help math expression" action.
      • m_ActionHelpStringExpression

        protected FlowEditorAction m_ActionHelpStringExpression
        the "help string expression" action.
      • m_FileChooser

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

        protected FilenameProposer m_FilenameProposer
        for proposing filenames for new flows.
      • m_SplitPane

        protected BaseSplitPane m_SplitPane
        the split pane for displaying flow and tabs.
      • m_FlowPanels

        protected FlowMultiPagePane m_FlowPanels
        the tabbedpane for the flow panels.
      • m_Tabs

        protected FlowTabManager m_Tabs
        the tabbedpane for the tabs.
      • m_ToolBarActiveButtons

        protected List<JButton> m_ToolBarActiveButtons
        the "active" buttons in the toolbar.
    • Constructor Detail

      • FlowEditorPanel

        public FlowEditorPanel()
    • 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
      • addAdditionalMenuitems

        protected void addAdditionalMenuitems()
        Adds the additional menu items to the menubar.
      • 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
      • getTabs

        public FlowTabManager getTabs()
        Returns the tab manager.
        Returns:
        the tabs
      • getFlowPanels

        public FlowMultiPagePane getFlowPanels()
        Returns the flow panels.
        Returns:
        the flow panels
      • updateActions

        public 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.
      • checkForModified

        public boolean checkForModified()
        Returns whether we can proceed with the operation or not, depending on whether the user saved the flow or discarded the changes.
        Returns:
        true if safe to proceed
      • checkForModified

        public boolean checkForModified​(FlowPanel panel)
        Returns whether we can proceed with the operation or not, depending on whether the user saved the flow or discarded the changes.
        Returns:
        true if safe to proceed
      • getFileChooser

        public FlowFileChooser getFileChooser()
        Returns the filechooser in use.
        Returns:
        the filechooser
      • newFlow

        protected void newFlow​(Actor actor)
        Adds new panel with the specified actor.
        Parameters:
        actor - the actor to display in the new panel
      • setCurrentFile

        public 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
      • getReaderForFile

        public FlowReader getReaderForFile​(File file)
        Returns the reader for the file.
        Parameters:
        file - the file to get a reader for
        Returns:
        the suggested reader (based on file ext)
      • 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
      • setCurrentFlow

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

        public boolean hasCurrentPanel()
        Returns whether a flow panel is available.
        Returns:
        true if flow panel available
      • getCurrentPanel

        public FlowPanel getCurrentPanel()
        Returns the current flow panel.
        Returns:
        the current flow panel, null if not available
      • hasActivePanel

        public boolean hasActivePanel()
        Returns whether an active panel is set.
        Returns:
        true if active panel set
      • getActivePanel

        public FlowPanel getActivePanel()
        Returns the active panel (if any).
        Returns:
        the active panel, null if not set
      • getCurrentRoot

        public Actor getCurrentRoot()
        Returns the current root actor without its children.
        Returns:
        the current root, null if not available
        See Also:
        getCurrentFlow()
      • getActiveRoot

        public Actor getActiveRoot()
        Returns the active root actor without its children.
        Returns:
        the active root, null if not available
        See Also:
        getActiveFlow()
      • getCurrentFlow

        public Actor getCurrentFlow()
        Returns the current flow.

        WARNING: Recreates an actor hierarchy based on the tree. Method gets very slow for large flows. If you only need the root actor, then use getCurrentRoot() instead.
        Returns:
        the current flow, null if not available
      • getCurrentFlow

        public Actor getCurrentFlow​(StringBuilder errors)
        Returns the current flow.

        WARNING: Recreates an actor hierarchy based on the tree. Method gets very slow for large flows. If you only need the root actor, then use getCurrentRoot() instead.
        Parameters:
        errors - for storing errors, use null to ignore
        Returns:
        the current flow, null if not available
      • getActiveFlow

        public Actor getActiveFlow()
        Returns the active flow.

        WARNING: Recreates an actor hierarchy based on the tree. Method gets very slow for large flows. If you only need the root actor, then use getActiveRoot() instead.
        Returns:
        the active flow, null if not available
      • getActiveFlow

        public Actor getActiveFlow​(StringBuilder errors)
        Returns the active flow.

        WARNING: Recreates an actor hierarchy based on the tree. Method gets very slow for large flows. If you only need the root actor, then use getActiveRoot() instead.
        Parameters:
        errors - for storing errors, use null to ignore
        Returns:
        the active flow, null if not available
      • getRunningFlow

        public Actor getRunningFlow()
        Returns the currently running flow.
        Returns:
        the currently running flow, null if not available
      • getLastFlow

        public Actor getLastFlow()
        Returns the last flow executed (currently selected flow).
        Returns:
        the last executed flow, null if not available
      • setModified

        public void setModified​(boolean value)
        Sets whether the flow is modified or not.
        Parameters:
        value - true if the flow is to be flagged as modified
      • isModified

        public boolean isModified()
        Returns whether the flow is flagged as modified.
        Returns:
        true if the flow is modified
      • newTab

        public void newTab()
        Adds a new tab.
      • open

        public void open()
        Opens a flow.
      • revert

        protected void revert()
        Reverts a flow.
      • save

        public void save()
        Saves the flow.
      • saveAs

        public void saveAs()
        Saves the 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
      • isAnyRunning

        public boolean isAnyRunning()
        Returns whether any flow is currently running.
        Returns:
        true if at least one 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
      • isAnyStopping

        public boolean isAnyStopping()
        Returns whether any flow is currently stopping.
        Returns:
        true if at least one flow is being stopped
      • isPaused

        public boolean isPaused()
        Returns whether the current flow is paused.
        Returns:
        true if flow is paused
      • isAnyPaused

        public boolean isAnyPaused()
        Returns whether any flow is currently paused.
        Returns:
        true if at least one flow is paused
      • isSwingWorkerRunning

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

        public boolean isAnySwingWorkerRunning()
        Returns whether any swing worker is currently running.
        Returns:
        true if at least one swing worker is being executed
      • stop

        public void stop()
        Stops the flow.
      • kill

        public void kill()
        Kills the flow.
      • cleanUp

        public void cleanUp()
        Cleans up the last flow that was run.
      • setVisibleAgain

        protected void setVisibleAgain()
        Used by the close() method to re-display the flow, in case the flow cannot or should not be closed after all.
        See Also:
        close()
      • close

        public void close()
        Closes the dialog or frame. But only if no flows are running, being stopped or are modified (in the latter, the user can choose to save the flow).
      • newWindow

        public FlowEditorPanel newWindow()
        Displays a new flow editor window/frame.
        Returns:
        the new editor panel
      • newWindow

        public FlowEditorPanel newWindow​(Actor actor)
        Displays a new flow editor window/frame with the specified actor.
        Parameters:
        actor - the actor to display, use null to ignore
        Returns:
        the new editor panel
      • showMessage

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

        protected void showMessage​(String msg,
                                   boolean isError)
        Displays the given message in a separate dialog.
        Parameters:
        msg - the message to display
        isError - whether it is an error message
      • showStatus

        public void showStatus​(boolean left,
                               String msg)
        Displays a message.
        Specified by:
        showStatus in interface StatusMessageHandlerExt
        Parameters:
        left - whether to show the message on the left or right
        msg - the message to display
      • undoOccurred

        public void undoOccurred​(UndoEvent e)
        An undo event occurred.
        Parameters:
        e - the event
      • setCurrentDirectory

        public void setCurrentDirectory​(File value)
        Sets the current directory in the FileChooser use for opening flows.
        Parameters:
        value - 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
      • grabFocus

        public void grabFocus()
        Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. This component must be displayable, visible, and focusable for the request to be granted.
        Overrides:
        grabFocus in class JComponent
      • refreshTabs

        public void refreshTabs()
        Refreshes the tabs.
      • getCurrentTree

        public Tree getCurrentTree()
        Returns the tree.
        Returns:
        the tree, null if none available
      • hasSendToItem

        public boolean hasSendToItem​(Class[] cls)
        Checks whether something to send is available.
        Specified by:
        hasSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        true if an object is available for sending
      • getSendToItem

        public Object getSendToItem​(Class[] cls)
        Returns the object to send.
        Specified by:
        getSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        the item to send
      • getPreferredToolBarLocation

        public ToolBarPanel.ToolBarLocation getPreferredToolBarLocation()
        Returns the preferred toolbar location.
        Returns:
        the location
      • addRecentActorProcessor

        public void addRecentActorProcessor​(ActorProcessor processor)
        For adding an actor processor to the recent list.
        Parameters:
        processor - the processor to add
      • getPropertiesEditor

        public static Properties getPropertiesEditor()
        Returns the properties that define the editor.
        Returns:
        the properties
      • getPropertiesMenu

        public static Properties getPropertiesMenu()
        Returns the properties that define the menu in the editor.
        Returns:
        the properties
      • getPropertiesTreePopup

        public static Properties getPropertiesTreePopup()
        Returns the properties for the tree popup menu.
        Returns:
        the properties
      • getPropertiesTreeQuickAction

        public static Properties getPropertiesTreeQuickAction()
        Returns the properties for the tree quick action menu.
        Returns:
        the properties