|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The way data gets input to the Console
is via an input handler. The
input handlers can be chained together to handle more sophisticated input
(for example embedded HTML or ANSI escape codes).
Method Summary | |
void |
addRegion(Region r)
Add a region mapped over a section of character stream. |
void |
append(char[] cbuf,
int off,
int len)
Append characters to the end of the character stream. |
void |
close()
Close method to do any cleanup. |
java.lang.Object |
getBufferLock()
Get an object on which to synchronize access to a buffer. |
char[] |
getData(int offset,
int len)
Get the data within the specified region. |
int |
getOffset()
Get the current offset of the last character in the character stream. |
java.util.Iterator |
getRegions(int offset,
int len)
Get an iterator of the regions containing the specified range. |
void |
lock()
Lock the console from repaints. |
void |
removeRegion(Region r)
Remove a region. |
void |
unlock()
Unlock the console, rerendering if needed. |
void |
zap(int num)
Delete characters from end of character stream. |
Method Detail |
public void append(char[] cbuf, int off, int len)
cbuf
- the character bufferoff
- the offset into cbuf to first character to appendlen
- the number of characters to appendpublic void zap(int num)
num
- the number of characters to deletepublic int getOffset()
public char[] getData(int offset, int len)
offset
- the begining of the rangelen
- the length of the range in characters
public void addRegion(Region r)
r
- region to addremoveRegion(ti.swing.console.Region)
public void removeRegion(Region r)
r
- region to removeaddRegion(ti.swing.console.Region)
public java.util.Iterator getRegions(int offset, int len)
synchronized( ih.getBufferLock() ) { for( Iterator itr=ih.getRegions( off, len ); itr.hasNext(); ) { ... } }
offset
- the begining of the rangelen
- the length of the range in characters
Region
getBufferLock()
public java.lang.Object getBufferLock()
getRegions(int, int)
public void lock()
append(char[], int, int)
, zap(int)
, addRegion(ti.swing.console.Region)
,
removeRegion(ti.swing.console.Region)
) and only trigger a single repaint at the end.
unlock()
public void unlock()
lock()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |