Package adams.gui.flow
Class FlowEditorPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.core.ToolBarPanel
-
- adams.gui.flow.FlowEditorPanel
-
- All Implemented Interfaces:
StatusMessageHandler
,StatusMessageHandlerExt
,BaseStatusBar.PopupMenuCustomizer
,MenuBarProvider
,SendToActionSupporter
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class FlowEditorPanel extends ToolBarPanel implements MenuBarProvider, StatusMessageHandlerExt, SendToActionSupporter, BaseStatusBar.PopupMenuCustomizer
A panel for setting up, modifying, saving and loading "simple" flows.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.gui.core.ToolBarPanel
ToolBarPanel.ToolBarLocation
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTORPROCESSORS_SESSION_FILE
the file to store the recent actor processors in.static String
DEFAULT_TITLE
the default title for dialogs/frames.static String
FILENAME
the name of the props file with the general properties.static String
FILENAME_MENU
the name of the props file with the menu.static String
FILENAME_TREEPOPUPMENU
the name of the props file with the tree menu.static String
FILENAME_TREEQUICKACTIONMENU
the name of the props file with the tree quick action menu.protected FlowEditorAction
m_ActionActiveClearGraphicalOutput
the "Clear graphical output" action.protected FlowEditorAction
m_ActionActiveDebug
the "run (debug)" action.protected FlowEditorAction
m_ActionActiveDisplayErrors
the "display errors" action.protected FlowEditorAction
m_ActionActiveGC
the "gc" action.protected FlowEditorAction
m_ActionActiveHeadless
the "headless" action.protected FlowEditorAction
m_ActionActiveKill
the "kill" action.protected FlowEditorAction
m_ActionActivePauseAndResume
the "pause" action.protected FlowEditorAction
m_ActionActiveRun
the "run" action.protected FlowEditorAction
m_ActionActiveStop
the "stop" action.protected FlowEditorAction
m_ActionActiveStorage
the "storage" action.protected FlowEditorAction
m_ActionActiveValidateSetup
the "check setup" action.protected FlowEditorAction
m_ActionActiveVariables
the "variables" action.protected FlowEditorAction
m_ActionDuplicateTab
the "duplicate tab" action.protected FlowEditorAction
m_ActionDuplicateTabInNewWindow
the "duplicate tab in new window" action.protected FlowEditorAction
m_ActionEditCheckVariables
the check variables action.protected FlowEditorAction
m_ActionEditCleanUpFlow
the remove disabled actors action.protected FlowEditorAction
m_ActionEditClearClipboard
the clear clipboard action.protected FlowEditorAction
m_ActionEditDiff
the diff action.protected FlowEditorAction
m_ActionEditEnableUndo
the toggle undo action.protected FlowEditorAction
m_ActionEditFind
the find action.protected FlowEditorAction
m_ActionEditIgnoreNameChanges
the ignore name changes action.protected FlowEditorAction
m_ActionEditInteractiveActors
the interactive actors action.protected FlowEditorAction
m_ActionEditListTODOs
the "list TODOs" action.protected FlowEditorAction
m_ActionEditLocateActor
the locate actor action.protected FlowEditorAction
m_ActionEditLocateStorageName
the locate storage name action.protected FlowEditorAction
m_ActionEditLocateVariable
the locate variable action.protected FlowEditorAction
m_ActionEditProcessActors
the "process actors" action.protected FlowEditorAction
m_ActionEditRedo
the redo action.protected FlowEditorAction
m_ActionEditTimedActors
the timed actors action.protected FlowEditorAction
m_ActionEditUndo
the undo action.protected FlowEditorAction
m_ActionFileCheckOnSave
the "check on save" action.protected FlowEditorAction
m_ActionFileClose
the "close" action.protected FlowEditorAction
m_ActionFileClosePage
the "close page" action.protected FlowEditorAction
m_ActionFileExport
the "export" action.protected FlowEditorAction
m_ActionFileImport
the "import" action.protected FlowEditorAction
m_ActionFileNew
the "new" action.protected FlowEditorAction
m_ActionFileNewFromClipboard
the "new from clipboard" action.protected FlowEditorAction
m_ActionFileOpen
the "open" action.protected FlowEditorAction
m_ActionFileProperties
the "properties" action.protected FlowEditorAction
m_ActionFileRevert
the "revert" action.protected FlowEditorAction
m_ActionFileSave
the "save" action.protected FlowEditorAction
m_ActionFileSaveAs
the "save as" action.protected FlowEditorAction
m_ActionHalfHeight
the "half height" action.protected FlowEditorAction
m_ActionHalfWidth
the "half width" action.protected FlowEditorAction
m_ActionHelpActors
the "help actors" action.protected FlowEditorAction
m_ActionHelpBooleanExpression
the "help boolean expression" action.protected FlowEditorAction
m_ActionHelpClasses
the "help classes" action.protected FlowEditorAction
m_ActionHelpMathematicalExpression
the "help math expression" action.protected FlowEditorAction
m_ActionHelpStringExpression
the "help string expression" action.protected FlowEditorAction
m_ActionHelpVariables
the "help variables" action.protected FlowEditorAction
m_ActionMoveToNewWindow
the "move to new window" action.protected FlowEditorAction
m_ActionNewWindow
the "new window" action.protected FlowEditorAction
m_ActionRunClearGraphicalOutput
the "Clear graphical output" action.protected FlowEditorAction
m_ActionRunDebug
the "run (debug)" action.protected FlowEditorAction
m_ActionRunDisableAllBreakpoints
the "disable all breakpoints" action.protected FlowEditorAction
m_ActionRunDisplayErrors
the "display errors" action.protected FlowEditorAction
m_ActionRunEnableAllBreakpoints
the "enable all breakpoints" action.protected FlowEditorAction
m_ActionRunGC
the "gc" action.protected FlowEditorAction
m_ActionRunHeadless
the "headless" action.protected FlowEditorAction
m_ActionRunKill
the "kill" action.protected FlowEditorAction
m_ActionRunParseError
the parse error action.protected FlowEditorAction
m_ActionRunPauseAndResume
the "pause" action.protected FlowEditorAction
m_ActionRunRemoveAllBreakpoints
the "remove all breakpoints" action.protected FlowEditorAction
m_ActionRunRun
the "run" action.protected FlowEditorAction
m_ActionRunRunAll
the "run all" action.protected FlowEditorAction
m_ActionRunStop
the "stop" action.protected FlowEditorAction
m_ActionRunStopAll
the "stop all" action.protected FlowEditorAction
m_ActionRunStorage
the "storage" action.protected FlowEditorAction
m_ActionRunValidateSetup
the "check setup" action.protected FlowEditorAction
m_ActionRunVariables
the "variables" action.protected FlowEditorAction
m_ActionViewFullExpansion
the "full expansion" action.protected FlowEditorAction
m_ActionViewRedraw
the "redraw" action.protected FlowEditorAction
m_ActionViewShowAnnotations
the "show annotations" action.protected FlowEditorAction
m_ActionViewShowInputOutput
the "show input/output" action.protected FlowEditorAction
m_ActionViewShowQuickInfo
the "show quick info" action.protected FlowEditorAction
m_ActionViewShowSource
the "show source" action.protected FlowEditorAction
m_ActionViewShowToolbar
the "show toolbar" action.protected FlowEditorAction
m_ActionViewStatistics
the "statistic" action.protected FlowEditorAction
m_ActionViewZoom
the "zoom" action.protected List<AbstractFlowEditorMenuItem>
m_AdditionalMenuItems
additional menu items.protected FlowFileChooser
m_FileChooser
the filedialog for loading/saving flows.protected FilenameProposer
m_FilenameProposer
for proposing filenames for new flows.protected FlowMultiPagePane
m_FlowPanels
the tabbedpane for the flow panels.protected JMenu
m_MenuActive
the "active" menu.protected JMenuBar
m_MenuBar
the menu bar, if used.protected JMenu
m_MenuEditRecentActorProcessors
recent actor processors menu.protected JMenu
m_MenuFileNew
the "new" sub-menu.protected JMenu
m_MenuFileOpenRecent
the "open recent" submenu.protected List<FlowEditorAction>
m_MenuItems
menu items.protected ToolBarPanel.ToolBarLocation
m_PreferredToolBarLocation
the default toolbar location to use.protected static Properties
m_Properties
the general properties.protected static Properties
m_PropertiesMenu
the menu properties.protected static Properties
m_PropertiesTreePopup
the tree popup menu properties.protected static Properties
m_PropertiesTreeQuickAction
the tree quick action menu properties.protected RecentActorProcessorHandler<JMenu>
m_RecentActorProcessorHandler
Recent file handler for actor processorsprotected RecentFilesHandlerWithCommandline<JMenu>
m_RecentFilesHandler
the recent files handler.protected FlowEditorPanel
m_Self
the panel itself.protected BaseSplitPane
m_SplitPane
the split pane for displaying flow and tabs.protected BaseStatusBar
m_StatusBar
the status.protected FlowTabManager
m_Tabs
the tabbedpane for the tabs.protected List<JButton>
m_ToolBarActiveButtons
the "active" buttons in the toolbar.static String
MENU_ACTIVE
the Active menu text.static String
MENU_EDIT
the Edit menu text.static String
MENU_FILE
the File menu text.static String
MENU_HELP
the Help menu text.static String
MENU_RUN
the Run menu text.static String
MENU_VIEW
the View menu text.static String
MENU_WINDOW
the Window menu text.static String
SESSION_FILE
the file to store the recent files in.-
Fields inherited from class adams.gui.core.ToolBarPanel
m_ContentPanel, m_Location, m_ToolBar
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description FlowEditorPanel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAdditionalMenuitems()
Adds the additional menu items to the menubar.void
addRecentActorProcessor(ActorProcessor processor)
For adding an actor processor to the recent list.boolean
checkForModified()
Returns whether we can proceed with the operation or not, depending on whether the user saved the flow or discarded the changes.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.void
cleanUp()
Cleans up the last flow that was run.void
close()
Closes the dialog or frame.void
customizePopupMenu(BaseStatusBar source, boolean left, JPopupMenu menu)
For customizing the popup menu.Actor
getActiveFlow()
Returns the active flow.Actor
getActiveFlow(StringBuilder errors)
Returns the active flow.FlowPanel
getActivePanel()
Returns the active panel (if any).Actor
getActiveRoot()
Returns the active root actor without its children.File
getCurrentDirectory()
Returns the current directory set in the FileChooser used for opening the flows.File
getCurrentFile()
Returns the current file in use.Actor
getCurrentFlow()
Returns the current flow.Actor
getCurrentFlow(StringBuilder errors)
Returns the current flow.FlowPanel
getCurrentPanel()
Returns the current flow panel.Actor
getCurrentRoot()
Returns the current root actor without its children.Tree
getCurrentTree()
Returns the tree.FlowFileChooser
getFileChooser()
Returns the filechooser in use.FlowMultiPagePane
getFlowPanels()
Returns the flow panels.Actor
getLastFlow()
Returns the last flow executed (currently selected flow).JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).ToolBarPanel.ToolBarLocation
getPreferredToolBarLocation()
Returns the preferred toolbar location.static Properties
getPropertiesEditor()
Returns the properties that define the editor.static Properties
getPropertiesMenu()
Returns the properties that define the menu in the editor.static Properties
getPropertiesTreePopup()
Returns the properties for the tree popup menu.static Properties
getPropertiesTreeQuickAction()
Returns the properties for the tree quick action menu.FlowReader
getReaderForFile(File file)
Returns the reader for the file.RecentFilesHandlerWithCommandline<JMenu>
getRecentFilesHandler()
Returns the recent files handler in use.Actor
getRunningFlow()
Returns the currently running flow.Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.FlowTabManager
getTabs()
Returns the tab manager.void
grabFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.boolean
hasActivePanel()
Returns whether an active panel is set.boolean
hasCurrentPanel()
Returns whether a flow panel is available.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected void
initActions()
Initializes the actions.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.protected void
initToolBar()
Initializes the toolbar.boolean
isAnyPaused()
Returns whether any flow is currently paused.boolean
isAnyRunning()
Returns whether any flow is currently running.boolean
isAnyStopping()
Returns whether any flow is currently stopping.boolean
isAnySwingWorkerRunning()
Returns whether any swing worker is currently running.boolean
isModified()
Returns whether the flow is flagged as modified.boolean
isPaused()
Returns whether the current flow is paused.boolean
isRunning()
Returns whether a flow is currently running.boolean
isStopping()
Returns whether a flow is currently being stopped.boolean
isSwingWorkerRunning()
Returns whether a swing worker is currently running.void
kill()
Kills the flow.void
loadUnsafe(File file)
Attempts to load the file.protected void
newFlow(Actor actor)
Adds new panel with the specified actor.void
newTab()
Adds a new tab.FlowEditorPanel
newWindow()
Displays a new flow editor window/frame.FlowEditorPanel
newWindow(Actor actor)
Displays a new flow editor window/frame with the specified actor.void
open()
Opens a flow.void
refreshTabs()
Refreshes the tabs.protected void
revert()
Reverts a flow.void
run()
Executes the flow.void
run(boolean showNotification, boolean debug)
Executes the flow.void
runUnsafe(File file)
Attempts to load/run the file.void
save()
Saves the flow.void
saveAs()
Saves the flow.void
setCurrentDirectory(File value)
Sets the current directory in the FileChooser use for opening flows.void
setCurrentFile(File value)
Sets the current file.void
setCurrentFlow(Actor flow)
Sets the flow to work on.void
setModified(boolean value)
Sets whether the flow is modified or not.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.protected void
showMessage()
Displays the message in the status bar in a separate dialog.protected void
showMessage(String msg, boolean isError)
Displays the given message in a separate dialog.void
showStatus(boolean left, String msg)
Displays a message.void
showStatus(String msg)
Displays a message.void
stop()
Stops the flow.void
undoOccurred(UndoEvent e)
An undo event occurred.void
update()
updates the enabled state etc.void
updateActions()
updates the enabled state of the menu items.protected void
updateWidgets()
Updates the enabled state of the widgets.-
Methods inherited from class adams.gui.core.ToolBarPanel
addSeparator, addToToolBar, addToToolBar, finishInit, getContentPanel, getToolBar, getToolBarComponentAtIndex, getToolBarComponentCount, getToolBarLocation, isFloatable, removeFromToolBar, setFloatable, setToolBarLocation
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
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, 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, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
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
-
Methods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
MENU_FILE
public static final String MENU_FILE
the File menu text.- See Also:
- Constant Field Values
-
MENU_EDIT
public static final String MENU_EDIT
the Edit menu text.- See Also:
- Constant Field Values
-
MENU_RUN
public static final String MENU_RUN
the Run menu text.- See Also:
- Constant Field Values
-
MENU_ACTIVE
public static final String MENU_ACTIVE
the Active menu text.- See Also:
- Constant Field Values
-
MENU_VIEW
public static final String MENU_VIEW
the View menu text.- See Also:
- Constant Field Values
-
MENU_WINDOW
public static final String MENU_WINDOW
the Window menu text.- See Also:
- Constant Field Values
-
MENU_HELP
public static final String MENU_HELP
the Help menu text.- See Also:
- Constant Field Values
-
FILENAME
public static final String FILENAME
the name of the props file with the general properties.- See Also:
- Constant Field Values
-
FILENAME_MENU
public static final String FILENAME_MENU
the name of the props file with the menu.- 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
-
SESSION_FILE
public static final String SESSION_FILE
the file to store the recent files in.- 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
-
DEFAULT_TITLE
public static final String DEFAULT_TITLE
the default title for dialogs/frames.- 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_Self
protected FlowEditorPanel m_Self
the panel itself.
-
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_ActionFileNew
protected FlowEditorAction m_ActionFileNew
the "new" action.
-
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_RecentActorProcessorHandler
protected RecentActorProcessorHandler<JMenu> m_RecentActorProcessorHandler
Recent file handler for actor processors
-
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_ActionRunGC
protected FlowEditorAction m_ActionRunGC
the "gc" action.
-
m_ActionRunValidateSetup
protected FlowEditorAction m_ActionRunValidateSetup
the "check setup" action.
-
m_ActionRunRun
protected FlowEditorAction m_ActionRunRun
the "run" 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_MenuItems
protected List<FlowEditorAction> m_MenuItems
menu items.
-
m_AdditionalMenuItems
protected List<AbstractFlowEditorMenuItem> m_AdditionalMenuItems
additional menu items.
-
m_FileChooser
protected FlowFileChooser m_FileChooser
the filedialog for loading/saving flows.
-
m_StatusBar
protected BaseStatusBar m_StatusBar
the status.
-
m_RecentFilesHandler
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
the recent files handler.
-
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_PreferredToolBarLocation
protected ToolBarPanel.ToolBarLocation m_PreferredToolBarLocation
the default toolbar location to use.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classToolBarPanel
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classToolBarPanel
-
initActions
protected void initActions()
Initializes the actions.- Specified by:
initActions
in classToolBarPanel
- See Also:
AbstractBaseAction
-
initToolBar
protected void initToolBar()
Initializes the toolbar.- Specified by:
initToolBar
in classToolBarPanel
- See Also:
ToolBarPanel.initActions()
-
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 interfaceMenuBarProvider
- 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 classToolBarPanel
-
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/finisheddebug
- 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 displayisError
- whether it is an error message
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceStatusMessageHandler
- Parameters:
msg
- the message to display
-
showStatus
public void showStatus(boolean left, String msg)
Displays a message.- Specified by:
showStatus
in interfaceStatusMessageHandlerExt
- Parameters:
left
- whether to show the message on the left or rightmsg
- 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 classJComponent
-
refreshTabs
public void refreshTabs()
Refreshes the tabs.
-
getCurrentTree
public Tree getCurrentTree()
Returns the tree.- Returns:
- the tree, null if none available
-
getRecentFilesHandler
public RecentFilesHandlerWithCommandline<JMenu> getRecentFilesHandler()
Returns the recent files handler in use.- Returns:
- the handler
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceSendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceSendToActionSupporter
- 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 interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- the item to send
-
customizePopupMenu
public void customizePopupMenu(BaseStatusBar source, boolean left, JPopupMenu menu)
For customizing the popup menu.- Specified by:
customizePopupMenu
in interfaceBaseStatusBar.PopupMenuCustomizer
- Parameters:
source
- the source statusbarleft
- whether left or right statusmenu
- the menu to customize
-
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
-
-