public class TextAreaOutputStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
static int |
DEF_MAXNL_SEARCH
Max # of chars to search for newline after trim (400).
|
static int |
DEF_TEXTSIZE_LIMIT
Default text size limit, in characters (8000000).
|
static int |
DEF_TEXTTRIM_SIZE
Number of characters to trim when over limit (8000).
|
Constructor and Description |
---|
TextAreaOutputStream(javax.swing.JTextArea textAreaObj)
Creates an 'OutputStream' extension that sends its output to a
'TextArea' object.
|
TextAreaOutputStream(javax.swing.JTextArea textAreaObj,
boolean setupTextObjFlag)
Creates an 'OutputStream' extension that sends its output to a
'TextArea' object.
|
Modifier and Type | Method and Description |
---|---|
void |
doSetupTextAreaObj()
Sets up the text area object to be not-editable while still having
a visible caret and text cursor.
|
void |
doWrite(byte[] byteArr,
int offsetVal,
int numChars)
Sends a portion of an array of bytes to the text area.
|
void |
doWrite(int val)
Sends the specified character value to the text area.
|
int |
getMaxNewLineSearch()
Returns the text size limit.
|
int |
getTextSizeLimit()
Returns the maximum number of characters to search for a newline
after a trim.
|
int |
getTextTrimSize()
Returns the text trim size.
|
void |
setTextSizeLimitValues(int textSizeLimit,
int textTrimSize)
Sets the text size limit values.
|
void |
setTextSizeLimitValues(int textSizeLimit,
int textTrimSize,
int maxNewLineSearch)
Sets the text size limit values.
|
void |
setupTextAreaObj()
Sets up the text area object to be not-editable while still having
a visible caret and text cursor.
|
void |
write(byte[] byteArr,
int offsetVal,
int numChars)
Sends a portion of an array of bytes to the text area.
|
void |
write(int val)
Sends the specified character value to the text area.
|
public static final int DEF_TEXTSIZE_LIMIT
public static final int DEF_TEXTTRIM_SIZE
public static final int DEF_MAXNL_SEARCH
public TextAreaOutputStream(javax.swing.JTextArea textAreaObj)
textAreaObj
- 'TextArea' objectpublic TextAreaOutputStream(javax.swing.JTextArea textAreaObj, boolean setupTextObjFlag)
textAreaObj
- 'TextArea' objectsetupTextObjFlag
- if true then 'setupTextAreaObj()' is
called to setup the given text area object.public void setupTextAreaObj()
public void doSetupTextAreaObj()
public void write(int val) throws java.io.IOException
write
in class java.io.OutputStream
val
- the character value.java.io.IOException
- if an I/O error occurs (in particular,
an IOException may be thrown if the output stream has been closed).public void write(byte[] byteArr, int offsetVal, int numChars) throws java.io.IOException
write
in class java.io.OutputStream
byteArr
- array of characters.offsetVal
- offset from which to start writing characters.numChars
- number of characters to write.java.io.IOException
- if an I/O error occurs.public void doWrite(int val) throws java.io.IOException
val
- the character value.java.io.IOException
- if an I/O error occurs (in particular,
an IOException may be thrown if the output stream has been closed).public void doWrite(byte[] byteArr, int offsetVal, int numChars) throws java.io.IOException
byteArr
- array of characters.offsetVal
- offset from which to start writing characters.numChars
- number of characters to write.java.io.IOException
- if an I/O error occurs.public void setTextSizeLimitValues(int textSizeLimit, int textTrimSize, int maxNewLineSearch)
textSizeLimit
- text size limit, in characters.textTrimSize
- number of character to trim when over limit.maxNewLineSearch
- maximum number of characters to search for
a newline after a trim, or 0 or no search.public void setTextSizeLimitValues(int textSizeLimit, int textTrimSize)
textSizeLimit
- text size limit, in characters.textTrimSize
- number of character to trim when over limit.public int getTextTrimSize()
public int getMaxNewLineSearch()
public int getTextSizeLimit()