| ti.swing.console.InputHandler
All known Subclasses: ti.swing.console.ConsoleBuffer, ti.swing.console.InputAdapter,
InputHandler | public interface InputHandler (Code) | | 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).
author: Rob Clark version: 0.0 |
Method Summary | |
public void | addRegion(Region r) Add a region mapped over a section of character stream. | public void | append(char[] cbuf, int off, int len) Append characters to the end of the character stream. | public void | close() Close method to do any cleanup. | public Object | getBufferLock() Get an object on which to synchronize access to a buffer. | public char[] | getData(int offset, int len) Get the data within the specified region. | public int | getOffset() Get the current offset of the last character in the character stream. | public java.util.Iterator | getRegions(int offset, int len) Get an iterator of the regions containing the specified range. | public void | lock() Lock the console from repaints. | public void | removeRegion(Region r) Remove a region. | public void | unlock() Unlock the console, rerendering if needed. | public void | zap(int num) Delete characters from end of character stream. |
addRegion | public void addRegion(Region r)(Code) | | Add a region mapped over a section of character stream. If the section
of the character stream over which the region is mapped has scrolled off
the top of the fixed size row buffer, the region will be automatically
removed.
Parameters: r - region to add See Also: InputHandler.removeRegion |
append | public void append(char[] cbuf, int off, int len)(Code) | | Append characters to the end of the character stream.
Parameters: cbuf - the character buffer Parameters: off - the offset into cbuf to first character to append Parameters: len - the number of characters to append |
close | public void close()(Code) | | Close method to do any cleanup.
|
getBufferLock | public Object getBufferLock()(Code) | | Get an object on which to synchronize access to a buffer.
an object suitable for synchronizing access See Also: InputHandler.getRegions |
getData | public char[] getData(int offset, int len)(Code) | | Get the data within the specified region. If the requested region has
scrolled past the top of the buffer, the returned data may be truncated.
Parameters: offset - the begining of the range Parameters: len - the length of the range in characters the data |
getOffset | public int getOffset()(Code) | | Get the current offset of the last character in the character stream.
an offset |
getRegions | public java.util.Iterator getRegions(int offset, int len)(Code) | | Get an iterator of the regions containing the specified range. Access
to the iterator must be synchronized on thebuffer-lock, to prevent
concurrent modification problems. For example:
synchronized( ih.getBufferLock() )
{
for( Iterator itr=ih.getRegions( off, len ); itr.hasNext(); )
{
...
}
}
Parameters: offset - the begining of the range Parameters: len - the length of the range in characters an iterator of Region See Also: InputHandler.getBufferLock |
zap | public void zap(int num)(Code) | | Delete characters from end of character stream.
Parameters: num - the number of characters to delete |
|
|