cz.cuni.amis.dash
Class DashWindow

Package class diagram package DashWindow
java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.openide.windows.TopComponent
                  extended by cz.cuni.amis.dash.DashWindow
All Implemented Interfaces:
IDebugEngineListener, ImageObserver, MenuContainer, Externalizable, Serializable, Accessible, org.openide.util.HelpCtx.Provider, org.openide.util.Lookup.Provider

public class DashWindow
extends org.openide.windows.TopComponent
implements IDebugEngineListener

Window that is informing us about debugged plan. It is working in phases: wait for connection - connected - plan recieved - show debugged scene - disconnect.

Author:
Honza
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openide.windows.TopComponent
org.openide.windows.TopComponent.Cloneable, org.openide.windows.TopComponent.Description, org.openide.windows.TopComponent.NodeName, org.openide.windows.TopComponent.OpenActionRegistration, org.openide.windows.TopComponent.Registration, org.openide.windows.TopComponent.Registry
 
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 inherited from class org.openide.windows.TopComponent
CLOSE_EACH, CLOSE_LAST, PERSISTENCE_ALWAYS, PERSISTENCE_NEVER, PERSISTENCE_ONLY_OPENED, PROP_CLOSING_DISABLED, PROP_DND_COPY_DISABLED, PROP_DRAGGING_DISABLED, PROP_KEEP_PREFERRED_SIZE_WHEN_SLIDED_IN, PROP_MAXIMIZATION_DISABLED, PROP_SLIDING_DISABLED, PROP_UNDOCKING_DISABLED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
DashWindow(YaposhEngine engine, String name)
          Create new window displaying the debugged engine.
 
Method Summary
 void breakpointAdded(LapBreakpoint breakpoint)
          Do nothing, handled by individual presenters
 void breakpointRemoved(LapBreakpoint breakpoint)
          Do nothing, handled by individual presenters
protected  void componentClosed()
          Make sure to clean up after window will be closed, disconnect the engine.
 void connected()
          Change content of the window to info panel saying that we are connected to the engine and waiting for the plan (planRecieved(java.lang.String, cz.cuni.amis.pogamut.sposh.elements.PoshPlan)).
 void disconnected(String message, boolean error)
          When disconnected, display info panel at the top of the window with the message.
 void evaluationFinished()
          Debugger is about to leave PoshEngine.evaluatePlan(cz.cuni.amis.pogamut.sposh.executor.IWorkExecutor).
 void evaluationReached()
          When engine reaches evaluation, check if time since last repaint is longer than REDRAW_INTERVAL_MS and if it is, repaint the window.
 int getPersistenceType()
          Debugger is never persistent
 void pathReached(cz.cuni.amis.pogamut.sposh.elements.LapPath path)
          Notify about path that is about to be fired.
 void planRecieved(String name, cz.cuni.amis.pogamut.sposh.elements.PoshPlan plan)
          We got the plan, create the scene using DashPresenterFactory and set the window to display it.
 
Methods inherited from class org.openide.windows.TopComponent
addNotify, associateLookup, availableModes, cancelRequestAttention, canClose, canClose, close, close, closeNotify, componentActivated, componentDeactivated, componentHidden, componentOpened, componentShowing, getAccessibleContext, getActions, getActivatedNodes, getCloseOperation, getDisplayName, getHelpCtx, getHtmlDisplayName, getIcon, getLookup, getRegistry, getSystemActions, getTabPosition, getUndoRedo, isOpened, isOpened, open, open, openAction, openAtTabPosition, openNotify, preferredID, processKeyBinding, readExternal, requestActive, requestAttention, requestFocus, requestFocusInWindow, requestVisible, setActivatedNodes, setCloseOperation, setDisplayName, setHtmlDisplayName, setIcon, setName, setToolTipText, toFront, writeExternal, writeReplace
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printComponent, printChildren, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, 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, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, checkImage, checkImage, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DashWindow

public DashWindow(YaposhEngine engine,
                  String name)
Create new window displaying the debugged engine. The content of the window is a text "Waiting to be connected", because in order to display the ending, you need to be connected to engine first (done in connected()).

Parameters:
engine - Debugged engine.
name - Display name of top component
Method Detail

connected

public void connected()
Change content of the window to info panel saying that we are connected to the engine and waiting for the plan (planRecieved(java.lang.String, cz.cuni.amis.pogamut.sposh.elements.PoshPlan)).

Specified by:
connected in interface IDebugEngineListener

planRecieved

public void planRecieved(String name,
                         cz.cuni.amis.pogamut.sposh.elements.PoshPlan plan)
We got the plan, create the scene using DashPresenterFactory and set the window to display it. Also start crawlers that will notify widgets about mapping of FQN to name in PrimitiveInfo through ShedPresenter.

Specified by:
planRecieved in interface IDebugEngineListener
Parameters:
name - New display name of the window
plan - Plan to display

evaluationReached

public void evaluationReached()
When engine reaches evaluation, check if time since last repaint is longer than REDRAW_INTERVAL_MS and if it is, repaint the window.

Specified by:
evaluationReached in interface IDebugEngineListener

pathReached

public void pathReached(cz.cuni.amis.pogamut.sposh.elements.LapPath path)
Description copied from interface: IDebugEngineListener
Notify about path that is about to be fired.

Specified by:
pathReached in interface IDebugEngineListener

evaluationFinished

public void evaluationFinished()
Description copied from interface: IDebugEngineListener
Debugger is about to leave PoshEngine.evaluatePlan(cz.cuni.amis.pogamut.sposh.executor.IWorkExecutor).

Specified by:
evaluationFinished in interface IDebugEngineListener

breakpointAdded

public void breakpointAdded(LapBreakpoint breakpoint)
Do nothing, handled by individual presenters

Specified by:
breakpointAdded in interface IDebugEngineListener
Parameters:
breakpoint - New breakpoint

breakpointRemoved

public void breakpointRemoved(LapBreakpoint breakpoint)
Do nothing, handled by individual presenters

Specified by:
breakpointRemoved in interface IDebugEngineListener
Parameters:
breakpoint - removed breakpoint

disconnected

public void disconnected(String message,
                         boolean error)
When disconnected, display info panel at the top of the window with the message.

Specified by:
disconnected in interface IDebugEngineListener
Parameters:
message - Optional message to display the user.
error - Was debugger disconnected because of an error or was it OK.

componentClosed

protected void componentClosed()
Make sure to clean up after window will be closed, disconnect the engine.

Overrides:
componentClosed in class org.openide.windows.TopComponent

getPersistenceType

public int getPersistenceType()
Debugger is never persistent

Overrides:
getPersistenceType in class org.openide.windows.TopComponent
Returns:
TopComponent.PERSISTENCE_NEVER.


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.