com.bluemarsh.jswat.panel
Class StackPanel

java.lang.Object
  |
  +--com.bluemarsh.jswat.panel.JSwatPanel
        |
        +--com.bluemarsh.jswat.panel.StackPanel
All Implemented Interfaces:
ContextListener, java.util.EventListener, java.awt.event.MouseListener, SessionListener

public class StackPanel
extends JSwatPanel
implements ContextListener, java.awt.event.MouseListener

Class StackPanel is responsible for displaying a list of stack frames in the debuggee VM's current thread.

Author:
Nathan Fiedler

Field Summary
protected  ContextManager contextManager
          Handy reference to the Session's ContextManager.
protected  Session owningSession
          Handy reference to the Session that owns us.
protected  com.bluemarsh.jswat.panel.StackPanel.StackRenderer stackRenderer
          Thing that renders the rows of our table.
protected  javax.swing.JTable table
          Our table component - displays the stack frames
protected  javax.swing.JScrollPane uicomp
          Our UI component - scrollable panel
 
Fields inherited from class com.bluemarsh.jswat.panel.JSwatPanel
swat
 
Constructor Summary
StackPanel()
          Constructs a new StackPanel with the default table.
 
Method Summary
 void activate(Session session)
          Called when the Session is about to begin an active debugging session.
 void close(Session session)
          Called when the Session is closing down this panel, generally just after the panel has been removed from the Session.
 void contextChanged(ContextChangeEvent cce)
          Invoked when the current context has changed.
 void deactivate(Session session)
          Called when the Session is about to end an active debugging session.
protected  void describeFrame(com.sun.jdi.StackFrame frame, com.bluemarsh.jswat.panel.ViewTableModel model, int row)
          Describes the given stack frame into the table.
protected  void describeStack(com.sun.jdi.ThreadReference thread, com.bluemarsh.jswat.panel.ViewTableModel model)
          Describes the given thread stack, placing the results in the given table model.
 javax.swing.JComponent getPeer()
          Returns a reference to the peer UI component.
 javax.swing.JComponent getUI()
          Returns a reference to the UI component.
 void init(Session session)
          Called when the Session is ready to initialize this panel, generally just after the panel has been added to the Session.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void refresh(Session session)
          Update the display on the screen.
 
Methods inherited from class com.bluemarsh.jswat.panel.JSwatPanel
getParentWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected javax.swing.JTable table
Our table component - displays the stack frames

uicomp

protected javax.swing.JScrollPane uicomp
Our UI component - scrollable panel

owningSession

protected Session owningSession
Handy reference to the Session that owns us.

stackRenderer

protected com.bluemarsh.jswat.panel.StackPanel.StackRenderer stackRenderer
Thing that renders the rows of our table.

contextManager

protected ContextManager contextManager
Handy reference to the Session's ContextManager.
Constructor Detail

StackPanel

public StackPanel()
Constructs a new StackPanel with the default table.
Method Detail

activate

public void activate(Session session)
Called when the Session is about to begin an active debugging session. That is, JSwat is about to debug a debuggee VM. Panels are not activated in any particular order.
Overrides:
activate in class JSwatPanel
Parameters:
session - Session being activated.

close

public void close(Session session)
Called when the Session is closing down this panel, generally just after the panel has been removed from the Session.
Overrides:
close in class JSwatPanel
Parameters:
session - Session closing the panel.

contextChanged

public void contextChanged(ContextChangeEvent cce)
Invoked when the current context has changed. The context change event identifies which aspect of the context has changed.
Specified by:
contextChanged in interface ContextListener
Parameters:
cce - context change event

deactivate

public void deactivate(Session session)
Called when the Session is about to end an active debugging session. That is, JSwat is about to terminate the connection with the debuggee VM. Panels are not deactivated in any particular order.
Overrides:
deactivate in class JSwatPanel
Parameters:
session - Session being deactivated.

describeFrame

protected void describeFrame(com.sun.jdi.StackFrame frame,
                             com.bluemarsh.jswat.panel.ViewTableModel model,
                             int row)
Describes the given stack frame into the table.
Parameters:
frame - StackFrame to describe.
model - Table model to describe frame into.
row - Row of table to describe to.

describeStack

protected void describeStack(com.sun.jdi.ThreadReference thread,
                             com.bluemarsh.jswat.panel.ViewTableModel model)
Describes the given thread stack, placing the results in the given table model.
Parameters:
thread - Thread to describe.
model - Table model for stack description.

getPeer

public javax.swing.JComponent getPeer()
Returns a reference to the peer UI component. In many cases this is a JList, JTree, or JTable, depending on the type of data being displayed in the panel.
Returns:
peer ui component object

getUI

public javax.swing.JComponent getUI()
Returns a reference to the UI component.
Overrides:
getUI in class JSwatPanel
Returns:
ui component object

init

public void init(Session session)
Called when the Session is ready to initialize this panel, generally just after the panel has been added to the Session.
Overrides:
init in class JSwatPanel
Parameters:
session - Session initializing this panel.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. We use this to take action on the table.
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - Mouse event.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - Mouse event.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - Mouse event.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - Mouse event.

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - Mouse event.

refresh

public void refresh(Session session)
Update the display on the screen. Use the given VM to fetch the desired data.
Overrides:
refresh in class JSwatPanel
Parameters:
session - Debugging Session object.