com.bluemarsh.jswat.ui
Class GraphicalOutputAdapter

java.lang.Object
  |
  +--com.bluemarsh.jswat.ui.GraphicalOutputAdapter
All Implemented Interfaces:
SessionListener

public class GraphicalOutputAdapter
extends java.lang.Object
implements SessionListener

Class OutputAdapter is responsible for displaying the output of a debuggee process to a text area. It reads both the standard output and standard error streams from the debuggee VM. For it to operate correctly it must be added as a session listener.

Author:
Nathan Fiedler

Field Summary
protected  com.bluemarsh.jswat.ui.FancyTextArea outputArea
          Text area displaying the messages.
protected  javax.swing.JScrollPane outputAreaScroller
          Scroller for the output area.
protected  int outputCompleteCount
          When this reaches 2, the output streams are finished.
 
Constructor Summary
GraphicalOutputAdapter()
          Constructs a GraphicalOutputAdapter with the default text area.
 
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 about to close down.
 void deactivate(Session session)
          Called when the Session is about to end an active debugging session.
protected  void displayOutput(java.io.InputStream is)
          Create a thread that will retrieve and display any output from the given input stream.
 javax.swing.JComponent getUI()
          Returns a reference to the UI component.
 void init(Session session)
          Called after the Session has added this listener to the Session listener list.
protected  void notifyOutputComplete()
          Notify any waiters that one of the reader threads has finished reading its output.
 void setMaxLineCount(int count)
          Sets the maximum number of lines to be shown in this panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputArea

protected com.bluemarsh.jswat.ui.FancyTextArea outputArea
Text area displaying the messages.

outputAreaScroller

protected javax.swing.JScrollPane outputAreaScroller
Scroller for the output area.

outputCompleteCount

protected int outputCompleteCount
When this reaches 2, the output streams are finished.
Constructor Detail

GraphicalOutputAdapter

public GraphicalOutputAdapter()
Constructs a GraphicalOutputAdapter with the default text area.
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.
Specified by:
activate in interface SessionListener
Parameters:
session - Session being activated.

close

public void close(Session session)
Called when the Session is about to close down.
Specified by:
close in interface SessionListener
Parameters:
session - Session being closed.

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.
Specified by:
deactivate in interface SessionListener
Parameters:
session - Session being deactivated.

displayOutput

protected void displayOutput(java.io.InputStream is)
Create a thread that will retrieve and display any output from the given input stream.
Parameters:
is - InputStream to read from.

getUI

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

init

public void init(Session session)
Called after the Session has added this listener to the Session listener list.
Specified by:
init in interface SessionListener
Parameters:
session - Session adding this listener.

notifyOutputComplete

protected void notifyOutputComplete()
Notify any waiters that one of the reader threads has finished reading its output. This must be a separate method in order to be synchronized on 'this' object.

setMaxLineCount

public void setMaxLineCount(int count)
Sets the maximum number of lines to be shown in this panel.
Parameters:
count - maximum number of lines to show.