| java.lang.Object ti.swing.console.InputAdapter
All known Subclasses: ti.swing.console.ColorInputHandler, ti.swing.console.LogInputHandler,
InputAdapter | abstract public class InputAdapter implements InputHandler(Code) | | An
InputHandler adapter, provides default methods that just fwd the
request to the parent. A subclass can just override the methods it cares
about.
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 for doing any cleanup. | public Object | getBufferLock() Get an object on which to synchronize access to a region iterator. | 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. |
InputAdapter | public InputAdapter(InputHandler parent)(Code) | | Class Constructor.
Parameters: parent - the parent of this input adapter |
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: InputAdapter.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 for doing any cleanup.
|
getBufferLock | public Object getBufferLock()(Code) | | Get an object on which to synchronize access to a region iterator.
an object suitable for synchronizing region iterator access See Also: InputAdapter.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 the buffer-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: InputAdapter.getBufferLock |
zap | public void zap(int num)(Code) | | Delete characters from end of character stream.
Parameters: num - the number of characters to delete |
|
|