|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream com.deltax.util.JPanelOutputStream
A class to use a JPanel as an output stream.
The class extends OutputStream and outputs to a JPanel,
which can be obtained by invoking getPanel()
.
The flush()
method can be called to actually
update the associated panel.
Field Summary | |
protected java.lang.String |
lineSep
The platform line separator |
protected javax.swing.JList |
list
The JList used to display the output. |
protected int |
maxLines
The number of maximum allowed lines, or -1. |
protected javax.swing.JPanel |
panel
The associated JPanel object. |
protected java.lang.StringBuffer |
sb
The current line buffer. |
Constructor Summary | |
JPanelOutputStream()
Create JPanelOutputStream. |
|
JPanelOutputStream(int maxLines)
Create JPanelOutputStream whose JPanel will display the given maximum number of lines. |
|
JPanelOutputStream(java.lang.String[] data)
Create a panel which displays the given lines. |
Method Summary | |
void |
clear()
Clear the panel |
void |
flush()
Completes the current line by writing a line separator. |
java.lang.String |
getContents()
Return the panel contents as a String. |
java.awt.Font |
getFont()
Get the font with which the panel displays the text. |
javax.swing.JPanel |
getPanel()
Return the panel associated to the panel. |
void |
setFont(java.awt.Font font)
Set the font with which the panel displays the text. |
void |
write(int b)
Implements the OutputStream's write method. |
Methods inherited from class java.io.OutputStream |
close, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int maxLines
protected javax.swing.JPanel panel
protected javax.swing.JList list
protected java.lang.StringBuffer sb
protected java.lang.String lineSep
Constructor Detail |
public JPanelOutputStream()
public JPanelOutputStream(int maxLines)
maxLines
- tha maximum number of lines of the associated JPanel.public JPanelOutputStream(java.lang.String[] data)
data
- an array of linesMethod Detail |
public void setFont(java.awt.Font font)
font
- the font to usepublic java.awt.Font getFont()
public void clear()
public java.lang.String getContents()
public javax.swing.JPanel getPanel()
public void write(int b) throws java.io.IOException
b
- the character to write
java.io.IOException
public void flush()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |