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 BaseButton
m_ButtonActorHighlight
the button for highlighting the ctor.protected BaseButton
m_ButtonActorPath
the button for copying the actor path.protected BaseToggleButton
m_ButtonBreakpoints
the button to show the breakpoints management panel.protected BaseToggleButton
m_ButtonExpressions
the button for displaying dialog with watch expressions.protected BaseToggleButton
m_ButtonInspectToken
the button to show inspection panel for the current token.protected BaseButton
m_ButtonPauseResume
the button for resuming execution.protected BaseToggleButton
m_ButtonSource
the button to show the source code of the current flow.protected BaseButton
m_ButtonStep
the button for performing the next step when in manual mode.protected BaseButton
m_ButtonStop
the button for stopping execution.protected BaseToggleButton
m_ButtonStorage
the button to show the storage.protected BaseButton
m_ButtonToggle
the button for disabling/enabling the breakpoint.protected BaseToggleButton
m_ButtonVariables
the button to show the variable management dialog.protected Actor
m_CurrentActor
the current actor.protected AbstractBreakpoint
m_CurrentBreakpoint
the current breakpoint.protected BooleanCondition
m_CurrentCondition
the current boolean condition.protected ExecutionStage
m_CurrentStage
the current hook method.protected Token
m_CurrentToken
the current token.protected GenericObjectEditorPanel
m_GOEPanelCondition
the breakpoint condition.protected boolean
m_Manual
whether the user has modified the view and it should be left alone.protected Debug
m_Owner
the owning listener.protected BreakpointPanel
m_PanelBreakpoints
the panel for managing the breakpoints.protected ExpressionWatchPanel
m_PanelExpressions
the panel with the watch expressions.protected InspectionPanel
m_PanelInspectionToken
the panel for inspecting the current token.protected TextEditorPanel
m_PanelSource
the panel for displaying the source.protected BasePanel
m_PanelSourceAll
the panel for displaying the source (incl buttons).protected StoragePanel
m_PanelStorage
the panel for displaying the temporary storage.protected VariableManagementPanel
m_PanelVariables
the panel with the variables.protected BaseTabbedPane
m_TabbedPaneDisplays
the tabbed pane for displaying the various display panels.protected BaseTextField
m_TextActorPath
the text field for the actor path.protected BaseTextField
m_TextStage
the 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 boolean
addWatch(String expr, ExpressionWatchPanel.ExpressionType type)
Adds a new expression (if not already present).void
breakpointReached(boolean blocked)
Called by actor when breakpoint reached.void
cleanUp()
Cleans up data structures, frees up memory.protected void
continueFlowExecution()
Continues the flow execution.protected void
disableEnableBreakpoint()
Disable/enable the breakpoint.protected void
finishInit()
Finishes the initialization.Actor
getCurrentActor()
Returns the current actor.AbstractBreakpoint
getCurrentBreakpoint()
Returns the current boolean breakpoint.BooleanCondition
getCurrentCondition()
Returns the current boolean condition.ExecutionStage
getCurrentStage()
Returns the current stage.Token
getCurrentToken()
Returns the current token, if any.protected Flow
getFlow()
Returns the underlying flow.Debug
getOwner()
Returns the owning listener.Tree
getTree()
Returns the tree, if available.boolean
hasWatch(String expr, ExpressionWatchPanel.ExpressionType type)
Checks whether the expression is already present.protected void
highlightActor()
Highlights the actor.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.protected void
inspectToken(boolean visible)
Inspects the current token.boolean
isControlPanelEnabled()
Returns whether the control panel is enabled.boolean
isStepModeEnabled()
Returns whether step mode is enabled.protected void
nextStep()
Executes the next step in manual mode.protected void
pauseResumeExecution()
Pauses/resumes execution.void
queueUpdate()
Queues a call toupdate()
in the swing thread.void
setCurrentActor(Actor value)
Sets the current actor.void
setCurrentBreakpoint(AbstractBreakpoint value)
Sets the current boolean breakpoint.void
setCurrentCondition(BooleanCondition value)
Sets the current boolean condition.void
setCurrentStage(ExecutionStage value)
Sets the current stage.void
setCurrentToken(Token value)
Sets the current token, if any.void
setOwner(Debug value)
Sets the owning listener.protected void
setPanelVisible(JPanel panel, String title, boolean visible)
Sets the visibility of a panel in the tabbed pane.void
setStepModeEnabled(boolean enabled)
Enables/disables step mode.protected void
showBreakpoints(boolean visible)
Shows the current breakpoints.protected void
showSource(boolean visible)
Displays the source code (nested format) of the current flow.protected void
showStorage(boolean visible)
Shows the current temporary storage.protected void
showVariables(boolean visible)
Displays the current variables in the system.protected void
showWatchExpressions(boolean visible)
Displays dialog with watch expressions.protected void
stopFlowExecution()
Stops the flow execution.void
update()
Updates the enabled status of the buttons, text fields and other widget updates.void
update(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:
initialize
in classBasePanel
-
finishInit
protected void finishInit()
Finishes the initialization.- Overrides:
finishInit
in 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:
getTree
in 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:
cleanUp
in interfaceCleanUpHandler
-
-