Package adams.gui.flow
Class FlowPanel
-
- All Implemented Interfaces:
CleanUpHandler,LoggingSupporter,StatusMessageHandler,StatusMessageHandlerExt,KnownParentSupporter,MultiPageIconSupporter,UndoHandler,UndoHandlerWithQuickAccess,UndoListener,FlowTreeHandler,FlowWorkerHandler,SendToActionSupporter,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class FlowPanel extends UndoPanel implements StatusMessageHandlerExt, SendToActionSupporter, FlowTreeHandler, MultiPageIconSupporter, FlowWorkerHandler, UndoHandlerWithQuickAccess, KnownParentSupporter, LoggingSupporter
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 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 protected Booleanm_CheckLargeFlowsOnSavewhether to check large flows before saving.protected booleanm_CheckOnSavewhether to check before saving.protected Filem_CurrentFilethe filename of the current flow.protected Threadm_CurrentThreadthe current worker thread.protected FlowWorkerm_CurrentWorkerthe current worker.protected Treem_DebugTreethe tree displaying the debug flow structure.protected MultiMonitorm_FlowFileMonitorfor monitoring file changes.protected booleanm_Headlesswhether to execute the flow in headless mode.protected Actorm_LastFlowthe last flow that was run.protected FlowReaderm_LastReaderthe last flow reader used.protected Stringm_LastVariableSearchthe last variable search performed.protected FlowWriterm_LastWriterthe last flow writer used.protected Loggerm_Loggerthe logger instance.protected FlowMultiPagePanem_Ownerthe owner.protected BasePanelm_PanelBottomthe bottom panel.protected JPanelm_PanelDebugTreethe panel with the debug tree.protected JPanelm_PanelDebugTreeLabelthe panel with the debug tree label.protected FlowPanelNotificationAream_PanelNotificationthe panel for showing notifications.protected StoragePanelm_PanelStoragethe panel with the variables.protected JPanelm_PanelTreethe panel with the tree.protected JPanelm_PanelTreeLabelthe panel with label.protected VariableManagementPanelm_PanelVariablesthe panel with the variables.protected static Propertiesm_Propertiesthe properties.protected RecentFilesHandlerWithCommandline<JMenu>m_RecentFilesHandlerthe recent files handler.protected booleanm_RunGCwhether to perform a GC after the flow execution.protected booleanm_RunningSwingWorkerwhether a swingworker is currently running.protected BaseSplitPanem_SplitPaneEditorthe split pane to use for tree and notification area.protected BaseSplitPanem_SplitPaneTreesthe split pane for the trees (edit/debug).protected Stringm_Statusthe current status.protected List<AbstractTabHandler>m_TabHandlersthe tab handlers.protected Stringm_Titlethe current title.protected TitleGeneratorm_TitleGeneratorfor generating the title of the dialog/frame.protected Treem_Treethe tree displaying the flow structure.static StringPREFIX_FLOWthe prefix for the title of custom set flows.static StringPREFIX_NEWthe prefix for the title of new tabs.-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
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 FlowPanel()Initializes the panel with no owner.FlowPanel(FlowMultiPagePane owner)Initializes the panel with an owner.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUndoPoint(String comment)Adds an undo point with the given comment.voidaddUndoPoint(String statusMsg, String undoComment)Adds an undo point, if possible.booleancanRevert()Returns whether a revert action is possible.voidcleanUp()Cleans up the last flow that was run.voidclearNotification()Removes the notification.voidclose()Cleans up and closes the tab.voidcloseStorage()Closes the storage dialog if currently open.static voidconfigureUI(Tree tree)Configures the UI of the tree with parameters from the properties.voidenableBreakpoints(boolean enable)Enables/disables all breakpoints in the flow (before execution).voidexportFlow(OptionProducer producer, File file)Exports the flow.voidfinishedExecution()Finishes up the execution, setting the worker to null.protected voidfinishInit()Finishes up the initialization.StringgenerateTitle()Generates the title to use.booleangetCheckOnSave()Returns whether to perform a check before saving the flow.FilegetCurrentFile()Returns the current file in use.ActorgetCurrentFlow()Returns the current flow.ActorgetCurrentFlow(StringBuilder errors)Returns the current flow.ActorgetCurrentRoot()Returns the current root actor without its children.TreegetDebugTree()Returns the debug tree.FlowEditorPanelgetEditor()Returns the editor this panel belongs to.booleangetIgnoreNameChanges()Returns whether name changes of actors are ignored and no dialog is prompting the user whether to propagate the changes throughout the flow.ContainergetKnownParent()Returns the component that acts as this component's parent.ActorgetLastFlow()Returns the last executed flow (if any).FlowReadergetLastReader()Returns the last flow reader in use.FlowWritergetLastWriter()Returns the last flow writer in use.LoggergetLogger()Returns the logger in use.FlowMultiPagePanegetOwner()Returns the editor this panel belongs to.static PropertiesgetProperties()Returns the properties that define the editor.RecentFilesHandlerWithCommandline<JMenu>getRecentFilesHandler()Returns the recent files handler to use.booleangetRunGC()Returns whether the GC gets called after the flow execution (or is being cleaned up).ActorgetRunningFlow()Returns the currently running flow.Class[]getSendToClasses()Returns the classes that the supporter generates.ObjectgetSendToItem(Class[] cls)Returns the object to send.BaseSplitPanegetSplitPane()Returns the split pane.StringgetStatus()Returns the current status.StoragePanelgetStoragePanel()Returns the panel with the storage items.<T> TgetTabHandler(Class<T> cls)Returns the tab handlers.List<AbstractTabHandler>getTabHandlers()Returns the tab handlers.StringgetTitle()Returns the base title of the flow.TitleGeneratorgetTitleGenerator()Returns the title generator in use.TreegetTree()Returns the tree.VariableManagementPanelgetVariablesPanel()Returns the panel with the variables.doublegetZoom()Returns the current zoom.voidgrabFocus()Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.booleanhasSendToItem(Class[] cls)Checks whether something to send is available.voidimportFlow(OptionConsumer consumer, File file)Imports a flow.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.booleanisDebugTreeVisible()Returns whether the debug tree is visible.booleanisHeadless()Returns whether the flow gets executed in headless mode.booleanisInputEnabled()Returns whether the flow accepts input.booleanisLoggingEnabled()Returns whether logging is enabled.booleanisModified()Returns whether the flow is flagged as modified.booleanisPaused()Returns whether a flow is currently running.booleanisRunning()Returns whether a flow is currently running.booleanisStopping()Returns whether a flow is currently being stopped.booleanisSwingWorkerRunning()Returns whether a swing worker is currently running.voidkill()Kills the flow.voidload(FlowReader reader, File file)Loads a flow.voidload(FlowReader reader, File file, boolean execute)Loads a flow and optionally executes it.voidload(FlowReader reader, File file, boolean execute, SwingWorker action)Loads a flow and optionally executes it.booleanpauseAndResume()Pauses/resumes the flow.voidprocessActors(ActorProcessor processor)Processes the actors with the specified actor processor.voidprocessActorsPrompt(ActorProcessor processor)If a single actor is selected, user gets prompted whether to only process below this actor instead of full flow.voidprocessSelectedActor(ActorProcessor processor)Processes the selected actor with a user-specified actor processor.voidredo()performs a redo if possible.voidredraw()Redraws the tree.voidrequestFocus()The tree requests the focus.voidreset(Actor actor)Resets the GUI to default values.voidrestart(boolean showNotification, boolean debug)Stops and restarts the flow again.voidrevert()Reverts a flow.voidrun()Executes the flow.voidrun(boolean showNotification, boolean debug)Executes the flow.voidsave(FlowWriter writer, File file)Saves the flow.voidsetCheckOnSave(boolean value)Sets whether to perform a check before saving the flow.voidsetCurrentFile(File value)Sets the current file.voidsetCurrentFlow(Actor flow)Sets the flow to work on.voidsetCurrentFlow(Node flow)Sets the flow to work on.voidsetDebugTreeVisible(boolean value)Sets whether the debug tree is visible.voidsetHeadless(boolean value)Sets whether to execute the flow in headless mode.voidsetIgnoreNameChanges(boolean value)Sets whether to ignore name changes of actors and don't prompt a dialog with the user having the option to update the name throughout the glow.voidsetLastFlow(Actor actor)Sets the flow that was last executed.voidsetModified(boolean value)Sets whether the flow is modified or not.voidsetPageIcon(String icon)Sets the page icon.voidsetRecentFilesHandler(RecentFilesHandlerWithCommandline<JMenu> value)Sets the recent files handler to use.voidsetRunGC(boolean value)Sets whether to run the GC after the flow finished executing (or is being cleaned up).voidsetTitle(String value)Sets the title for this flow.voidsetZoom(double value)Sets the zoom to use.voidshowNotification(String msg, FlowPanelNotificationArea.NotificationType type)Displays the notification text.voidshowNotification(String msg, String icon)Displays the notification text.voidshowNotification(JComponent comp, String icon)Displays the notification component.voidshowStatus(boolean left, String msg)Displays a message.voidshowStatus(String msg)Displays a message.voidshowStorage()Displays the storage in the currently running flow.voidshowVariables()Displays the variables in the currently running flow.booleanstartBackgroundTask(Runnable runnable, String statusMsg, boolean clearMsg)For starting background tasks.voidstop()Stops the flow.voidstop(boolean cleanUp)Stops the flow.voidundo()performs an undo if possible.voidundoOccurred(UndoEvent e)An undo event occurred.voidupdate()updates the enabled state etc. of all the GUI elements.voidupdateCurrentFile(File file)Just updates the current file.voidupdateStatusIcon(String icon)Updates the status icon, if supported.voidupdateTitle()Updates the title of the dialog/frame if the title generator is enabled.voidupdateWidgets()Updates the enabled state of the widgets.-
Methods inherited from class adams.gui.core.UndoPanel
getUndo, isUndoSupported, setUndo
-
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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.gui.core.UndoHandler
getUndo, isUndoSupported, setUndo
-
-
-
-
Field Detail
-
PREFIX_NEW
public static final String PREFIX_NEW
the prefix for the title of new tabs.- See Also:
- Constant Field Values
-
PREFIX_FLOW
public static final String PREFIX_FLOW
the prefix for the title of custom set flows.- See Also:
- Constant Field Values
-
m_Properties
protected static Properties m_Properties
the properties.
-
m_Owner
protected FlowMultiPagePane m_Owner
the owner.
-
m_LastFlow
protected Actor m_LastFlow
the last flow that was run.
-
m_CurrentFile
protected File m_CurrentFile
the filename of the current flow.
-
m_CurrentWorker
protected FlowWorker m_CurrentWorker
the current worker.
-
m_CurrentThread
protected Thread m_CurrentThread
the current worker thread.
-
m_RunningSwingWorker
protected boolean m_RunningSwingWorker
whether a swingworker is currently running.
-
m_SplitPaneTrees
protected BaseSplitPane m_SplitPaneTrees
the split pane for the trees (edit/debug).
-
m_SplitPaneEditor
protected BaseSplitPane m_SplitPaneEditor
the split pane to use for tree and notification area.
-
m_Tree
protected Tree m_Tree
the tree displaying the flow structure.
-
m_PanelTree
protected JPanel m_PanelTree
the panel with the tree.
-
m_PanelTreeLabel
protected JPanel m_PanelTreeLabel
the panel with label.
-
m_PanelDebugTree
protected JPanel m_PanelDebugTree
the panel with the debug tree.
-
m_PanelDebugTreeLabel
protected JPanel m_PanelDebugTreeLabel
the panel with the debug tree label.
-
m_DebugTree
protected Tree m_DebugTree
the tree displaying the debug flow structure.
-
m_RecentFilesHandler
protected RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
the recent files handler.
-
m_LastVariableSearch
protected String m_LastVariableSearch
the last variable search performed.
-
m_PanelVariables
protected VariableManagementPanel m_PanelVariables
the panel with the variables.
-
m_PanelStorage
protected StoragePanel m_PanelStorage
the panel with the variables.
-
m_TitleGenerator
protected TitleGenerator m_TitleGenerator
for generating the title of the dialog/frame.
-
m_Title
protected String m_Title
the current title.
-
m_Status
protected String m_Status
the current status.
-
m_Headless
protected boolean m_Headless
whether to execute the flow in headless mode.
-
m_RunGC
protected boolean m_RunGC
whether to perform a GC after the flow execution.
-
m_CheckOnSave
protected boolean m_CheckOnSave
whether to check before saving.
-
m_CheckLargeFlowsOnSave
protected Boolean m_CheckLargeFlowsOnSave
whether to check large flows before saving.
-
m_TabHandlers
protected List<AbstractTabHandler> m_TabHandlers
the tab handlers.
-
m_PanelBottom
protected BasePanel m_PanelBottom
the bottom panel.
-
m_PanelNotification
protected FlowPanelNotificationArea m_PanelNotification
the panel for showing notifications.
-
m_LastReader
protected FlowReader m_LastReader
the last flow reader used.
-
m_LastWriter
protected FlowWriter m_LastWriter
the last flow writer used.
-
m_FlowFileMonitor
protected MultiMonitor m_FlowFileMonitor
for monitoring file changes.
-
m_Logger
protected Logger m_Logger
the logger instance.
-
-
Constructor Detail
-
FlowPanel
public FlowPanel()
Initializes the panel with no owner.
-
FlowPanel
public FlowPanel(FlowMultiPagePane owner)
Initializes the panel with an owner.- Parameters:
owner- the owning tabbed pane
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classUndoPanel
-
finishInit
protected void finishInit()
Finishes up the initialization.- Overrides:
finishInitin classBasePanel
-
getOwner
public FlowMultiPagePane getOwner()
Returns the editor this panel belongs to.- Returns:
- the editor, null if none set
-
getLogger
public Logger getLogger()
Returns the logger in use.- Specified by:
getLoggerin interfaceLoggingSupporter- Returns:
- the logger
-
isLoggingEnabled
public boolean isLoggingEnabled()
Returns whether logging is enabled.- Specified by:
isLoggingEnabledin interfaceLoggingSupporter- Returns:
- true if at least
Level.INFO
-
getKnownParent
public Container getKnownParent()
Returns the component that acts as this component's parent.- Specified by:
getKnownParentin interfaceKnownParentSupporter- Returns:
- the parent, null if not available
-
setPageIcon
public void setPageIcon(String icon)
Sets the page icon.- Specified by:
setPageIconin interfaceMultiPageIconSupporter- Parameters:
icon- the name of the icon, null to unset it
-
getEditor
public FlowEditorPanel getEditor()
Returns the editor this panel belongs to.- Returns:
- the editor, null if none set
-
setHeadless
public void setHeadless(boolean value)
Sets whether to execute the flow in headless mode.- Parameters:
value- if true the flow gets executed in headless mode
-
isHeadless
public boolean isHeadless()
Returns whether the flow gets executed in headless mode.- Specified by:
isHeadlessin interfaceFlowWorkerHandler- Returns:
- true if the flow gets executed in headless mode
-
setRunGC
public void setRunGC(boolean value)
Sets whether to run the GC after the flow finished executing (or is being cleaned up).- Parameters:
value- if true GC gets called
-
getRunGC
public boolean getRunGC()
Returns whether the GC gets called after the flow execution (or is being cleaned up).- Specified by:
getRunGCin interfaceFlowWorkerHandler- Returns:
- true if to run GC
-
setCheckOnSave
public void setCheckOnSave(boolean value)
Sets whether to perform a check before saving the flow.- Parameters:
value- true if to check before saving
-
getCheckOnSave
public boolean getCheckOnSave()
Returns whether to perform a check before saving the flow.- Returns:
- true if to check before saving
-
updateWidgets
public 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:
updatein interfaceFlowWorkerHandler
-
setTitle
public void setTitle(String value)
Sets the title for this flow.- Parameters:
value- the title
-
getTitle
public String getTitle()
Returns the base title of the flow.- Returns:
- the title
-
generateTitle
public String generateTitle()
Generates the title to use.- Returns:
- the title
-
updateTitle
public void updateTitle()
Updates the title of the dialog/frame if the title generator is enabled.- See Also:
getTitleGenerator()
-
reset
public void reset(Actor actor)
Resets the GUI to default values.- Parameters:
actor- the actor to instantiate
-
setCurrentFile
public void setCurrentFile(File value)
Sets the current file.- Parameters:
value- the file
-
updateCurrentFile
public void updateCurrentFile(File file)
Just updates the current file.- Parameters:
file- the file
-
getCurrentFile
public File getCurrentFile()
Returns the current file in use.- Returns:
- the current file, can be null
-
getTitleGenerator
public TitleGenerator getTitleGenerator()
Returns the title generator in use.- Returns:
- the generator
-
load
public void load(FlowReader reader, File file)
Loads a flow.- Parameters:
reader- the reader to usefile- the flow to load
-
load
public void load(FlowReader reader, File file, boolean execute)
Loads a flow and optionally executes it.- Parameters:
reader- the reader to usefile- the flow to loadexecute- whether to execute the flow once loaded
-
load
public void load(FlowReader reader, File file, boolean execute, SwingWorker action)
Loads a flow and optionally executes it.- Parameters:
reader- the reader to usefile- the flow to loadexecute- whether to execute the flow once loadedaction- the SwingWorker to execute once the flow has been loaded, can be null
-
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.
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
- See Also:
getCurrentRoot()
-
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 potential errors, use null to ignore- Returns:
- the current flow
- See Also:
getCurrentRoot()
-
getCurrentRoot
public Actor getCurrentRoot()
Returns the current root actor without its children.- Returns:
- the current root actor
- See Also:
getCurrentFlow()
-
getRunningFlow
public Actor getRunningFlow()
Returns the currently running flow.- Returns:
- the running flow, null if none running right now
- See Also:
isRunning()
-
setLastFlow
public void setLastFlow(Actor actor)
Sets the flow that was last executed.- Specified by:
setLastFlowin interfaceFlowWorkerHandler- Parameters:
actor- the flow
-
getLastFlow
public Actor getLastFlow()
Returns the last executed flow (if any).- Specified by:
getLastFlowin interfaceFlowWorkerHandler- Returns:
- the flow, null if not available
-
getLastReader
public FlowReader getLastReader()
Returns the last flow reader in use.- Returns:
- the reader, null if not available
-
getLastWriter
public FlowWriter getLastWriter()
Returns the last flow writer in use.- Returns:
- the writer, 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.- Specified by:
isModifiedin interfaceFlowWorkerHandler- Returns:
- true if the flow is modified
-
canRevert
public boolean canRevert()
Returns whether a revert action is possible.- Returns:
- true if possible
-
revert
public void revert()
Reverts a flow.
-
save
public void save(FlowWriter writer, File file)
Saves the flow.- Parameters:
writer- the writer to usefile- the file to save the flow to
-
importFlow
public void importFlow(OptionConsumer consumer, File file)
Imports a flow.- Parameters:
consumer- the consumer to usefile- the file to import
-
exportFlow
public void exportFlow(OptionProducer producer, File file)
Exports the flow.- Parameters:
producer- the producer to usefile- the file to export to
-
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
-
restart
public void restart(boolean showNotification, boolean debug)Stops and restarts the flow again.- Parameters:
showNotification- whether to show notifications about errors/stopped/finisheddebug- whether to run in debug mode
-
finishedExecution
public void finishedExecution()
Finishes up the execution, setting the worker to null.- Specified by:
finishedExecutionin interfaceFlowWorkerHandler
-
isRunning
public boolean isRunning()
Returns whether a flow is currently running.- Specified by:
isRunningin interfaceFlowWorkerHandler- Returns:
- true if a flow is being executed
-
isStopping
public boolean isStopping()
Returns whether a flow is currently being stopped.- Specified by:
isStoppingin interfaceFlowWorkerHandler- Returns:
- true if a flow is currently being stopped
-
isPaused
public boolean isPaused()
Returns whether a flow is currently running.- Specified by:
isPausedin interfaceFlowWorkerHandler- Returns:
- true if a flow is being executed
-
isSwingWorkerRunning
public boolean isSwingWorkerRunning()
Returns whether a swing worker is currently running.- Returns:
- true if a swing worker is being executed
-
pauseAndResume
public 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
-
kill
public void kill()
Kills the flow.
-
cleanUp
public void cleanUp()
Cleans up the last flow that was run.- Specified by:
cleanUpin interfaceCleanUpHandler
-
close
public void close()
Cleans up and closes the tab.
-
addUndoPoint
public void addUndoPoint(String statusMsg, String undoComment)
Adds an undo point, if possible.- Parameters:
statusMsg- the status message to display while adding the undo pointundoComment- the comment for the undo point
-
addUndoPoint
public void addUndoPoint(String comment)
Adds an undo point with the given comment.- Specified by:
addUndoPointin interfaceUndoHandlerWithQuickAccess- Parameters:
comment- the comment for the undo point
-
undo
public void undo()
performs an undo if possible.- Specified by:
undoin interfaceUndoHandlerWithQuickAccess
-
redo
public void redo()
performs a redo if possible.- Specified by:
redoin interfaceUndoHandlerWithQuickAccess
-
setIgnoreNameChanges
public void setIgnoreNameChanges(boolean value)
Sets whether to ignore name changes of actors and don't prompt a dialog with the user having the option to update the name throughout the glow.- Parameters:
value- if true then name changes are ignored
-
getIgnoreNameChanges
public boolean getIgnoreNameChanges()
Returns whether name changes of actors are ignored and no dialog is prompting the user whether to propagate the changes throughout the flow.- Returns:
- true if the name changes are ignored
-
processActorsPrompt
public void processActorsPrompt(ActorProcessor processor)
If a single actor is selected, user gets prompted whether to only process below this actor instead of full flow.- Parameters:
processor- the processor to use, null if to prompt user
-
processActors
public void processActors(ActorProcessor processor)
Processes the actors with the specified actor processor.- Parameters:
processor- the processor to use, null if to prompt user
-
processSelectedActor
public void processSelectedActor(ActorProcessor processor)
Processes the selected actor with a user-specified actor processor. NB: The options of the selected actor will get processed.- Parameters:
processor- the processor to use, null if to prompt user
-
enableBreakpoints
public void enableBreakpoints(boolean enable)
Enables/disables all breakpoints in the flow (before execution).- Parameters:
enable- if true then breakpoints get enabled
-
getVariablesPanel
public VariableManagementPanel getVariablesPanel()
Returns the panel with the variables.- Specified by:
getVariablesPanelin interfaceFlowWorkerHandler- Returns:
- the panel, null if not available
-
getStoragePanel
public StoragePanel getStoragePanel()
Returns the panel with the storage items.- Specified by:
getStoragePanelin interfaceFlowWorkerHandler- Returns:
- always null
-
showVariables
public void showVariables()
Displays the variables in the currently running flow.
-
showStorage
public void showStorage()
Displays the storage in the currently running flow.
-
closeStorage
public void closeStorage()
Closes the storage dialog if currently open.
-
setZoom
public void setZoom(double value)
Sets the zoom to use.- Parameters:
value- the zoom, 1.0 is default
-
getZoom
public double getZoom()
Returns the current zoom.- Returns:
- the zoom, 1.0 is default
-
getStatus
public String getStatus()
Returns the current status.- Returns:
- the status, if any
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatusin interfaceStatusMessageHandler- Parameters:
msg- the message to display
-
showStatus
public void showStatus(boolean left, String msg)Displays a message.- Specified by:
showStatusin 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.- Specified by:
undoOccurredin interfaceUndoListener- Parameters:
e- the event
-
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:
grabFocusin classJComponent
-
requestFocus
public void requestFocus()
The tree requests the focus.- Overrides:
requestFocusin classJComponent
-
getSplitPane
public BaseSplitPane getSplitPane()
Returns the split pane.- Specified by:
getSplitPanein interfaceFlowWorkerHandler- Returns:
- the split pane
-
getTree
public Tree getTree()
Returns the tree.- Specified by:
getTreein interfaceFlowTreeHandler- Returns:
- the tree
-
getDebugTree
public Tree getDebugTree()
Returns the debug tree.- Returns:
- the debug tree
-
isDebugTreeVisible
public boolean isDebugTreeVisible()
Returns whether the debug tree is visible.- Returns:
- true if visible
-
setDebugTreeVisible
public void setDebugTreeVisible(boolean value)
Sets whether the debug tree is visible.- Parameters:
value- true if visible
-
setRecentFilesHandler
public void setRecentFilesHandler(RecentFilesHandlerWithCommandline<JMenu> value)
Sets the recent files handler to use.- Parameters:
value- the handler to use
-
getRecentFilesHandler
public RecentFilesHandlerWithCommandline<JMenu> getRecentFilesHandler()
Returns the recent files handler to use.- Returns:
- the handler in use, null if none set
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClassesin interfaceSendToActionSupporter- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItemin 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:
getSendToItemin interfaceSendToActionSupporter- Parameters:
cls- the classes to retrieve the item for- Returns:
- the item to send
-
redraw
public void redraw()
Redraws the tree.
-
getTabHandlers
public List<AbstractTabHandler> getTabHandlers()
Returns the tab handlers.- Returns:
- the handlers
-
getTabHandler
public <T> T getTabHandler(Class<T> cls)
Returns the tab handlers.- Returns:
- the handlers
-
showNotification
public void showNotification(String msg, FlowPanelNotificationArea.NotificationType type)
Displays the notification text.- Specified by:
showNotificationin interfaceFlowWorkerHandler- Parameters:
msg- the text to displaytype- the type of notification (info/warning/error)
-
showNotification
public void showNotification(String msg, String icon)
Displays the notification text.- Specified by:
showNotificationin interfaceFlowWorkerHandler- Parameters:
msg- the text to displayicon- the icon to display, null for none
-
showNotification
public void showNotification(JComponent comp, String icon)
Displays the notification component.- Specified by:
showNotificationin interfaceFlowWorkerHandler- Parameters:
comp- the component to displayicon- the icon to display, null for none
-
clearNotification
public void clearNotification()
Removes the notification.- Specified by:
clearNotificationin interfaceFlowWorkerHandler
-
updateStatusIcon
public void updateStatusIcon(String icon)
Updates the status icon, if supported.- Specified by:
updateStatusIconin interfaceFlowWorkerHandler- Parameters:
icon- the icon name, can be null
-
isInputEnabled
public boolean isInputEnabled()
Returns whether the flow accepts input.- Returns:
- true if user can change flow
-
startBackgroundTask
public boolean startBackgroundTask(Runnable runnable, String statusMsg, boolean clearMsg)
For starting background tasks. Block user from running other background tasks till finished.- Parameters:
runnable- the task to executestatusMsg- the status message to displayclearMsg- whether to clear the message at the end; use false if your task displays a message in the status bar- Returns:
- true if successfully started, false if another task is currently running
-
getProperties
public static Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
configureUI
public static void configureUI(Tree tree)
Configures the UI of the tree with parameters from the properties.- Parameters:
tree- the tree to configure- See Also:
getProperties()
-
-