Package adams.flow.execution.debug
Class ControlPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.flow.execution.debug.ControlPanel
-
- All Implemented Interfaces:
CleanUpHandler,FlowTreeHandler,ImageObserver,MenuContainer,Serializable,Accessible
public class ControlPanel extends BasePanel implements CleanUpHandler, FlowTreeHandler
A little dialog for controlling the breakpoint. Cannot be static class!- 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 BaseButtonm_ButtonActorHighlightthe button for highlighting the ctor.protected BaseButtonm_ButtonActorPaththe button for copying the actor path.protected BaseToggleButtonm_ButtonBreakpointsthe button to show the breakpoints management panel.protected BaseToggleButtonm_ButtonExpressionsthe button for displaying dialog with watch expressions.protected BaseToggleButtonm_ButtonInspectTokenthe button to show inspection panel for the current token.protected BaseButtonm_ButtonPauseResumethe button for resuming execution.protected BaseToggleButtonm_ButtonSourcethe button to show the source code of the current flow.protected BaseButtonm_ButtonStepthe button for performing the next step when in manual mode.protected BaseButtonm_ButtonStopthe button for stopping execution.protected BaseToggleButtonm_ButtonStoragethe button to show the storage.protected BaseButtonm_ButtonTogglethe button for disabling/enabling the breakpoint.protected BaseToggleButtonm_ButtonVariablesthe button to show the variable management dialog.protected Actorm_CurrentActorthe current actor.protected AbstractBreakpointm_CurrentBreakpointthe current breakpoint.protected BooleanConditionm_CurrentConditionthe current boolean condition.protected ExecutionStagem_CurrentStagethe current hook method.protected Tokenm_CurrentTokenthe current token.protected GenericObjectEditorPanelm_GOEPanelConditionthe breakpoint condition.protected booleanm_Manualwhether the user has modified the view and it should be left alone.protected Debugm_Ownerthe owning listener.protected BreakpointPanelm_PanelBreakpointsthe panel for managing the breakpoints.protected ExpressionWatchPanelm_PanelExpressionsthe panel with the watch expressions.protected InspectionPanelm_PanelInspectionTokenthe panel for inspecting the current token.protected TextEditorPanelm_PanelSourcethe panel for displaying the source.protected BasePanelm_PanelSourceAllthe panel for displaying the source (incl buttons).protected StoragePanelm_PanelStoragethe panel for displaying the temporary storage.protected VariableManagementPanelm_PanelVariablesthe panel with the variables.protected BaseTabbedPanem_TabbedPaneDisplaysthe tabbed pane for displaying the various display panels.protected BaseTextFieldm_TextActorPaththe text field for the actor path.protected BaseTextFieldm_TextStagethe text field for the stage.-
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 ControlPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddWatch(String expr, ExpressionWatchPanel.ExpressionType type)Adds a new expression (if not already present).voidbreakpointReached(boolean blocked)Called by actor when breakpoint reached.voidcleanUp()Cleans up data structures, frees up memory.protected voidcontinueFlowExecution()Continues the flow execution.protected voiddisableEnableBreakpoint()Disable/enable the breakpoint.protected voidfinishInit()Finishes the initialization.ActorgetCurrentActor()Returns the current actor.AbstractBreakpointgetCurrentBreakpoint()Returns the current boolean breakpoint.BooleanConditiongetCurrentCondition()Returns the current boolean condition.ExecutionStagegetCurrentStage()Returns the current stage.TokengetCurrentToken()Returns the current token, if any.protected FlowgetFlow()Returns the underlying flow.DebuggetOwner()Returns the owning listener.TreegetTree()Returns the tree, if available.booleanhasWatch(String expr, ExpressionWatchPanel.ExpressionType type)Checks whether the expression is already present.protected voidhighlightActor()Highlights the actor.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.protected voidinspectToken(boolean visible)Inspects the current token.booleanisControlPanelEnabled()Returns whether the control panel is enabled.booleanisStepModeEnabled()Returns whether step mode is enabled.protected voidnextStep()Executes the next step in manual mode.protected voidpauseResumeExecution()Pauses/resumes execution.voidqueueUpdate()Queues a call toupdate()in the swing thread.voidsetCurrentActor(Actor value)Sets the current actor.voidsetCurrentBreakpoint(AbstractBreakpoint value)Sets the current boolean breakpoint.voidsetCurrentCondition(BooleanCondition value)Sets the current boolean condition.voidsetCurrentStage(ExecutionStage value)Sets the current stage.voidsetCurrentToken(Token value)Sets the current token, if any.voidsetOwner(Debug value)Sets the owning listener.protected voidsetPanelVisible(JPanel panel, String title, boolean visible)Sets the visibility of a panel in the tabbed pane.voidsetStepModeEnabled(boolean enabled)Enables/disables step mode.protected voidshowBreakpoints(boolean visible)Shows the current breakpoints.protected voidshowSource(boolean visible)Displays the source code (nested format) of the current flow.protected voidshowStorage(boolean visible)Shows the current temporary storage.protected voidshowVariables(boolean visible)Displays the current variables in the system.protected voidshowWatchExpressions(boolean visible)Displays dialog with watch expressions.protected voidstopFlowExecution()Stops the flow execution.voidupdate()Updates the enabled status of the buttons, text fields and other widget updates.voidupdate(boolean blocked)Updates the enabled status of the buttons, text fields and other widget updates.-
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, grabFocus, 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
-
m_TabbedPaneDisplays
protected BaseTabbedPane m_TabbedPaneDisplays
the tabbed pane for displaying the various display panels.
-
m_ButtonStop
protected BaseButton m_ButtonStop
the button for stopping execution.
-
m_ButtonToggle
protected BaseButton m_ButtonToggle
the button for disabling/enabling the breakpoint.
-
m_ButtonPauseResume
protected BaseButton m_ButtonPauseResume
the button for resuming execution.
-
m_ButtonStep
protected BaseButton m_ButtonStep
the button for performing the next step when in manual mode.
-
m_ButtonExpressions
protected BaseToggleButton m_ButtonExpressions
the button for displaying dialog with watch expressions.
-
m_GOEPanelCondition
protected GenericObjectEditorPanel m_GOEPanelCondition
the breakpoint condition.
-
m_ButtonSource
protected BaseToggleButton m_ButtonSource
the button to show the source code of the current flow.
-
m_ButtonVariables
protected BaseToggleButton m_ButtonVariables
the button to show the variable management dialog.
-
m_ButtonStorage
protected BaseToggleButton m_ButtonStorage
the button to show the storage.
-
m_ButtonInspectToken
protected BaseToggleButton m_ButtonInspectToken
the button to show inspection panel for the current token.
-
m_ButtonBreakpoints
protected BaseToggleButton m_ButtonBreakpoints
the button to show the breakpoints management panel.
-
m_PanelExpressions
protected ExpressionWatchPanel m_PanelExpressions
the panel with the watch expressions.
-
m_PanelVariables
protected VariableManagementPanel m_PanelVariables
the panel with the variables.
-
m_PanelInspectionToken
protected InspectionPanel m_PanelInspectionToken
the panel for inspecting the current token.
-
m_PanelSource
protected TextEditorPanel m_PanelSource
the panel for displaying the source.
-
m_PanelSourceAll
protected BasePanel m_PanelSourceAll
the panel for displaying the source (incl buttons).
-
m_PanelStorage
protected StoragePanel m_PanelStorage
the panel for displaying the temporary storage.
-
m_PanelBreakpoints
protected BreakpointPanel m_PanelBreakpoints
the panel for managing the breakpoints.
-
m_TextActorPath
protected BaseTextField m_TextActorPath
the text field for the actor path.
-
m_ButtonActorPath
protected BaseButton m_ButtonActorPath
the button for copying the actor path.
-
m_ButtonActorHighlight
protected BaseButton m_ButtonActorHighlight
the button for highlighting the ctor.
-
m_TextStage
protected BaseTextField m_TextStage
the text field for the stage.
-
m_Owner
protected transient Debug m_Owner
the owning listener.
-
m_CurrentToken
protected Token m_CurrentToken
the current token.
-
m_CurrentActor
protected Actor m_CurrentActor
the current actor.
-
m_CurrentStage
protected ExecutionStage m_CurrentStage
the current hook method.
-
m_CurrentCondition
protected BooleanCondition m_CurrentCondition
the current boolean condition.
-
m_CurrentBreakpoint
protected AbstractBreakpoint m_CurrentBreakpoint
the current breakpoint.
-
m_Manual
protected boolean m_Manual
whether the user has modified the view and it should be left alone.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classBasePanel
-
finishInit
protected void finishInit()
Finishes the initialization.- Overrides:
finishInitin classBasePanel
-
getFlow
protected Flow getFlow()
Returns the underlying flow.- Returns:
- the flow
-
update
public void update()
Updates the enabled status of the buttons, text fields and other widget updates.
-
update
public void update(boolean blocked)
Updates the enabled status of the buttons, text fields and other widget updates.- Parameters:
blocked- whether flow execution has been blocked
-
queueUpdate
public void queueUpdate()
Queues a call toupdate()in the swing thread.
-
setOwner
public void setOwner(Debug value)
Sets the owning listener.- Parameters:
value- the owner
-
getOwner
public Debug getOwner()
Returns the owning listener.- Returns:
- the owner
-
setCurrentToken
public void setCurrentToken(Token value)
Sets the current token, if any.- Parameters:
value- the token
-
getCurrentToken
public Token getCurrentToken()
Returns the current token, if any.- Returns:
- the token, null if none available
-
setCurrentActor
public void setCurrentActor(Actor value)
Sets the current actor.- Parameters:
value- the actor
-
getCurrentActor
public Actor getCurrentActor()
Returns the current actor.- Returns:
- the actor
-
setCurrentStage
public void setCurrentStage(ExecutionStage value)
Sets the current stage.- Parameters:
value- the stage
-
getCurrentStage
public ExecutionStage getCurrentStage()
Returns the current stage.- Returns:
- the stage
-
setCurrentCondition
public void setCurrentCondition(BooleanCondition value)
Sets the current boolean condition.- Parameters:
value- the condition, null if not available
-
getCurrentCondition
public BooleanCondition getCurrentCondition()
Returns the current boolean condition.- Returns:
- the condition, null if none available
-
setCurrentBreakpoint
public void setCurrentBreakpoint(AbstractBreakpoint value)
Sets the current boolean breakpoint.- Parameters:
value- the breakpoint, null if not available
-
getCurrentBreakpoint
public AbstractBreakpoint getCurrentBreakpoint()
Returns the current boolean breakpoint.- Returns:
- the breakpoint, null if none available
-
getTree
public Tree getTree()
Returns the tree, if available.- Specified by:
getTreein interfaceFlowTreeHandler- Returns:
- the tree, null if not available
-
isControlPanelEnabled
public boolean isControlPanelEnabled()
Returns whether the control panel is enabled.- Returns:
- true if enabled
-
continueFlowExecution
protected void continueFlowExecution()
Continues the flow execution.
-
stopFlowExecution
protected void stopFlowExecution()
Stops the flow execution.
-
setStepModeEnabled
public void setStepModeEnabled(boolean enabled)
Enables/disables step mode.- Parameters:
enabled- if true step mode is enabled
-
isStepModeEnabled
public boolean isStepModeEnabled()
Returns whether step mode is enabled.- Returns:
- true if step mode is enabled
-
disableEnableBreakpoint
protected void disableEnableBreakpoint()
Disable/enable the breakpoint.
-
pauseResumeExecution
protected void pauseResumeExecution()
Pauses/resumes execution.
-
nextStep
protected void nextStep()
Executes the next step in manual mode.
-
setPanelVisible
protected void setPanelVisible(JPanel panel, String title, boolean visible)
Sets the visibility of a panel in the tabbed pane.- Parameters:
panel- the panel to add/removetitle- the title of the panelvisible- if true the panel gets displayed, otherwise hidden
-
showWatchExpressions
protected void showWatchExpressions(boolean visible)
Displays dialog with watch expressions.- Parameters:
visible- if true then displayed, otherwise hidden
-
showSource
protected void showSource(boolean visible)
Displays the source code (nested format) of the current flow.- Parameters:
visible- if true then displayed, otherwise hidden
-
showVariables
protected void showVariables(boolean visible)
Displays the current variables in the system.- Parameters:
visible- if true then displayed, otherwise hidden
-
inspectToken
protected void inspectToken(boolean visible)
Inspects the current token.- Parameters:
visible- if true then displayed, otherwise hidden
-
showBreakpoints
protected void showBreakpoints(boolean visible)
Shows the current breakpoints.- Parameters:
visible- if true then displayed, otherwise hidden
-
showStorage
protected void showStorage(boolean visible)
Shows the current temporary storage.- Parameters:
visible- if true then displayed, otherwise hidden
-
highlightActor
protected void highlightActor()
Highlights the actor.
-
breakpointReached
public void breakpointReached(boolean blocked)
Called by actor when breakpoint reached.- Parameters:
blocked- whether execution has been blocked
-
addWatch
public boolean addWatch(String expr, ExpressionWatchPanel.ExpressionType type)
Adds a new expression (if not already present).- Parameters:
expr- the expressiontype- the type of the expression- Returns:
- true if added
- See Also:
ExpressionWatchPanel.addExpression(String, ExpressionType)
-
hasWatch
public boolean hasWatch(String expr, ExpressionWatchPanel.ExpressionType type)
Checks whether the expression is already present.- Parameters:
expr- the expressiontype- the type of the expression- Returns:
- true if already present
- See Also:
ExpressionWatchPanel.hasExpression(String, ExpressionType)
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler
-
-