Class AbstractTextualDisplay

    • Field Detail

      • m_ShowFlowControlSubMenu

        protected boolean m_ShowFlowControlSubMenu
        whether to show flow control sub-menu.
      • m_Font

        protected Font m_Font
        the font to use.
      • m_AlwaysClear

        protected boolean m_AlwaysClear
        whether to always clear the display before a token is processed.
      • m_MenuBar

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

        protected JMenuItem m_MenuItemFileClear
        the "clear" menu item.
      • m_MenuItemFileSaveAs

        protected JMenuItem m_MenuItemFileSaveAs
        the "save as" menu item.
      • m_MenuItemFileClose

        protected JMenuItem m_MenuItemFileClose
        the "exit" menu item.
      • m_MenuItemFlowPauseResume

        protected JMenuItem m_MenuItemFlowPauseResume
        the "pause/resume" menu item.
      • m_MenuItemFlowStop

        protected JMenuItem m_MenuItemFlowStop
        the "stop" menu item.
      • m_FileChooser

        protected transient TextFileChooser m_FileChooser
        the filedialog for loading/saving flows.
    • Constructor Detail

      • AbstractTextualDisplay

        public AbstractTextualDisplay()
    • Method Detail

      • getFileChooser

        protected TextFileChooser getFileChooser()
        Returns (and initializes if necessary) the file chooser.
        Returns:
        the file chooser
      • setWriter

        public void setWriter​(AbstractTextWriter value)
        Sets the writer.
        Parameters:
        value - the writer
      • getWriter

        public AbstractTextWriter getWriter()
        Returns the writer.
        Returns:
        the writer
      • writerTipText

        public String writerTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setShowFlowControlSubMenu

        public void setShowFlowControlSubMenu​(boolean value)
        Sets whether to show a flow control sub-menu in the menubar.
        Parameters:
        value - true if to show
      • getShowFlowControlSubMenu

        public boolean getShowFlowControlSubMenu()
        Returns whether to show a flow control sub-menu in the menubar.
        Returns:
        true if to show
      • showFlowControlSubMenuTipText

        public String showFlowControlSubMenuTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultFont

        protected Font getDefaultFont()
        Returns the default font for the dialog.
        Returns:
        the default font
      • setFont

        public void setFont​(Font value)
        Sets the font of the dialog.
        Parameters:
        value - the font
      • getFont

        public Font getFont()
        Returns the currently set font of the dialog.
        Returns:
        the font
      • fontTipText

        public String fontTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAlwaysClear

        public void setAlwaysClear​(boolean value)
        Sets whether to always clear the display before processing a token. Only available if supportsClear() returns true.
        Parameters:
        value - if true the display is always cleared
        See Also:
        supportsClear()
      • getAlwaysClear

        public boolean getAlwaysClear()
        Returns whether the display is always cleared before processing a token. Only available if supportsClear() returns true.
        Returns:
        true if the display is always cleared
      • alwaysClearTipText

        public String alwaysClearTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • createFileMenu

        protected JMenu createFileMenu()
        Creates the "File" menu.
        Returns:
        the generated menu
      • createFlowMenu

        protected JMenu createFlowMenu()
        Creates the flow control sub-menu.
        Returns:
        the menu
      • indexOfMenuItem

        protected int indexOfMenuItem​(JMenu menu,
                                      JMenuItem menuitem)
        Determines the index of the menu item in the specified menu.
        Parameters:
        menu - the menu to search in
        menuitem - the menu item to get the index for
        Returns:
        the index, -1 if not found
      • createMenuBar

        protected JMenuBar createMenuBar()
        Assembles the menu bar.
        Returns:
        the menu bar
      • 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
      • updateMenu

        protected void updateMenu()
        updates the enabled state of the menu items.
      • supportsClear

        public boolean supportsClear()
        Whether "clear" is supported and shows up in the menu.

        Default implementation returns "false".
        Specified by:
        supportsClear in interface ClearableDisplay
        Returns:
        true if supported
      • clear

        public void clear()
        Clears the display.

        Default implementation does nothing.
        Specified by:
        clear in interface ClearableDisplay
      • saveAs

        protected void saveAs()
        Saves the setups.
      • close

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

        protected boolean canPauseOrResume()
        Returns whether the flow can be paused/resumed.
        Returns:
        true if pause/resume available
      • isPaused

        protected boolean isPaused()
        Returns whether the flow is currently paused.
        Returns:
        true if currently paused
      • pauseResumeFlow

        protected void pauseResumeFlow()
        Pauses or resumes the flow.
      • stopFlow

        protected void stopFlow()
        Stops the flow.
      • getCustomTextFileFilter

        public ExtensionFileFilter getCustomTextFileFilter()
        Returns a custom file filter for the file chooser.

        Default implementation returns null.
        Specified by:
        getCustomTextFileFilter in interface TextSupplier
        Returns:
        the file filter, null if to use default one
      • preDisplay

        protected void preDisplay​(Token token)
        Before the token is displayed.
        Overrides:
        preDisplay in class AbstractDisplay
        Parameters:
        token - the token to display
      • doExecute

        protected String doExecute()
        Executes the flow item.

        Outputs the token on the command-line in headless mode.
        Overrides:
        doExecute in class AbstractDisplay
        Returns:
        null if everything is fine, otherwise error message
      • cleanUpGUI

        protected void cleanUpGUI()
        Removes all graphical components.
        Overrides:
        cleanUpGUI in class AbstractDisplay
      • 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
      • wrapUp

        public void wrapUp()
        Cleans up after the execution has finished.
        Specified by:
        wrapUp in interface Actor
        Overrides:
        wrapUp in class AbstractDisplay