|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectti.swing.console.InputAdapter
An InputHandler
adapter, provides default methods that just fwd the
request to the parent. A subclass can just override the methods it cares
about.
Constructor Summary | |
InputAdapter(InputHandler parent)
Class Constructor. |
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 for doing any cleanup. |
java.lang.Object |
getBufferLock()
Get an object on which to synchronize access to a region iterator. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InputAdapter(InputHandler parent)
parent
- the parent of this input adapterMethod Detail |
public void append(char[] cbuf, int off, int len)
append
in interface InputHandler
cbuf
- the character bufferoff
- the offset into cbuf to first character to appendlen
- the number of characters to appendpublic void zap(int num)
zap
in interface InputHandler
num
- the number of characters to deletepublic int getOffset()
getOffset
in interface InputHandler
public char[] getData(int offset, int len)
getData
in interface InputHandler
offset
- the begining of the rangelen
- the length of the range in characters
public void addRegion(Region r)
addRegion
in interface InputHandler
r
- region to addremoveRegion(ti.swing.console.Region)
public void removeRegion(Region r)
removeRegion
in interface InputHandler
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(); ) { ... } }
getRegions
in interface InputHandler
offset
- the begining of the rangelen
- the length of the range in characters
Region
getBufferLock()
public java.lang.Object getBufferLock()
getBufferLock
in interface InputHandler
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.
lock
in interface InputHandler
unlock()
public void unlock()
unlock
in interface InputHandler
lock()
public void close()
close
in interface InputHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |