ghm.follow
Class JTextAreaDestination

java.lang.Object
  extended byghm.follow.JTextAreaDestination
All Implemented Interfaces:
OutputDestination

public class JTextAreaDestination
extends java.lang.Object
implements OutputDestination

Implementation of OutputDestination which appends Strings to a JTextArea.

Author:
Greg Merrill
See Also:
OutputDestination, JTextArea

Field Summary
protected  boolean autoPositionCaret_
           
protected  javax.swing.JTextArea jTextArea_
           
 
Constructor Summary
JTextAreaDestination(javax.swing.JTextArea jTextArea, boolean autoPositionCaret)
          Construct a new JTextAreaDestination.
 
Method Summary
 boolean autoPositionCaret()
           
 void clear()
          Clear all previous text.
 javax.swing.JTextArea getJTextArea()
           
 void print(java.lang.String s)
          Print the supplied String.
 void setAutoPositionCaret(boolean autoPositionCaret)
           
 void setJTextArea(javax.swing.JTextArea jTextArea)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jTextArea_

protected javax.swing.JTextArea jTextArea_

autoPositionCaret_

protected boolean autoPositionCaret_
Constructor Detail

JTextAreaDestination

public JTextAreaDestination(javax.swing.JTextArea jTextArea,
                            boolean autoPositionCaret)
Construct a new JTextAreaDestination.

Parameters:
jTextArea - text will be appended to this text area
autoPositionCaret - if true, caret will be automatically moved to the bottom of the text area when text is appended
Method Detail

getJTextArea

public javax.swing.JTextArea getJTextArea()

setJTextArea

public void setJTextArea(javax.swing.JTextArea jTextArea)

autoPositionCaret

public boolean autoPositionCaret()
Returns:
whether caret will be automatically moved to the bottom of the text area when text is appended

setAutoPositionCaret

public void setAutoPositionCaret(boolean autoPositionCaret)
Parameters:
autoPositionCaret - if true, caret will be automatically moved to the bottom of the text area when text is appended

print

public void print(java.lang.String s)
Description copied from interface: OutputDestination
Print the supplied String.

Specified by:
print in interface OutputDestination
Parameters:
s - String to be printed

clear

public void clear()
Description copied from interface: OutputDestination
Clear all previous text.

Specified by:
clear in interface OutputDestination