org.problets.domain.viz.data.implement
Class StackViz

java.lang.Object
  extended by org.problets.domain.viz.data.BaseViz
      extended by org.problets.domain.viz.data.AggregateBaseViz
          extended by org.problets.domain.viz.data.implement.StackViz
All Implemented Interfaces:
VizConstants

public class StackViz
extends AggregateBaseViz

Displays the stack of functions in the program

Author:
Stefan Kasabov

Field Summary
 
Fields inherited from class org.problets.domain.viz.data.BaseViz
NOT_FOUND
 
Fields inherited from interface org.problets.domain.viz.data.VizConstants
ACTIVE_COLOR, COLOR_SCHEME, HIGHLIGHT_COLOR, INACTIVE_COLOR, STRIKEOUT_COLOR
 
Constructor Summary
StackViz(StackModel inModel, DataSpaceViz inParentViz)
           
 
Method Summary
 int draw(java.awt.Graphics g, java.awt.Font regFont, java.awt.FontMetrics regFontMetric, int inTopLeftX, int inTopLeftY, int inWidth)
          This method is called instead of the paintComponent() method.
 AbstractVarViz findInAncestors(AbstractVarModel inModel)
          We will ask data space to find the variable in the heap and global areas
 AbstractVarViz findInDescendants(AbstractVarModel inModel)
          Since the stack does not have its own activation record, we will pass the request down to the last function still on the stack.
static void main(java.lang.String[] args)
           
 void respond(int xMouse, int yMouse)
          Broadcast the mouse coordinates to all the FunctionViz children
 void update()
          Broadcast call for updating visualization objects
 
Methods inherited from class org.problets.domain.viz.data.AggregateBaseViz
deregisterChannel, getParentViz, registerChannel, setParentViz
 
Methods inherited from class org.problets.domain.viz.data.BaseViz
getLeftX, getWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackViz

public StackViz(StackModel inModel,
                DataSpaceViz inParentViz)
Method Detail

draw

public int draw(java.awt.Graphics g,
                java.awt.Font regFont,
                java.awt.FontMetrics regFontMetric,
                int inTopLeftX,
                int inTopLeftY,
                int inWidth)
Description copied from class: BaseViz
This method is called instead of the paintComponent() method. It draws the visualization in the provided Graphics context.

Parameters:
g - Graphics context on which to draw the visualization

respond

public void respond(int xMouse,
                    int yMouse)
Broadcast the mouse coordinates to all the FunctionViz children


findInAncestors

public AbstractVarViz findInAncestors(AbstractVarModel inModel)
We will ask data space to find the variable in the heap and global areas

Specified by:
findInAncestors in class AggregateBaseViz

findInDescendants

public AbstractVarViz findInDescendants(AbstractVarModel inModel)
Since the stack does not have its own activation record, we will pass the request down to the last function still on the stack. This scheme will work for C++, but not Pascal in which variables could be inherited.

Specified by:
findInDescendants in class AggregateBaseViz

update

public void update()
Broadcast call for updating visualization objects

Overrides:
update in class BaseViz

main

public static void main(java.lang.String[] args)