|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sshtools.terminal.VDUBuffer
public abstract class VDUBuffer
The VDUBuffer provides a rectangular buffer that represents a terminal screen and provides methods for manipulating this buffer. Both character data and character attributes are stored together the cursor position.
The buffer may be physically larger than the actual display, in which case the buffer will also manage the visible viewport and any scrolling that may be required
Implementation of any emulation protocol should be carried about by a sub
class, such as TerminalEmulation.
| Nested Class Summary | |
|---|---|
class |
VDUBuffer.BufferLock
|
static interface |
VDUBuffer.ResizeListener
|
| Field Summary | |
|---|---|
static int |
BOLD
|
protected VDUBuffer.BufferLock |
bufferLock
|
int |
bufSize
|
char[][] |
charArray
|
int[][] |
charAttributes
|
static int |
COLOR
|
static int |
COLOR_BG
|
static int |
COLOR_FG
|
protected int |
cursorX
|
protected int |
cursorY
|
protected VDUDisplay |
display
|
int |
fill
|
int |
height
|
static int |
INVERT
|
boolean[] |
lineMarker
|
protected java.util.Vector |
listenerList
|
static int |
LOW
|
int |
maxBufSize
|
static int |
NORMAL
|
int |
screenBase
|
static boolean |
SCROLL_DOWN
|
static boolean |
SCROLL_UP
|
int |
scrollMarker
|
protected boolean |
showcursor
|
static int |
UNDERLINE
|
boolean[] |
update
|
int |
width
|
int |
windowBase
|
| Constructor Summary | |
|---|---|
VDUBuffer()
|
|
VDUBuffer(int width,
int height)
|
|
| Method Summary | |
|---|---|
void |
addResizeListener(VDUBuffer.ResizeListener l)
|
void |
deleteArea(int c,
int l,
int w,
int h)
|
void |
deleteArea(int c,
int l,
int w,
int h,
int curAttr)
|
void |
deleteChar(int c,
int l)
Delete a character at a given |
void |
deleteLine(int l)
|
void |
fireResize(int w,
int h,
boolean remote)
|
int |
getAttributes(int c,
int l)
Get the attributes mask at the specified line and column. |
int |
getBottomMargin()
Get the bottom margin. |
VDUBuffer.BufferLock |
getBufferLock()
Get the buffer lock |
int |
getBufferSize()
Get the buffer size in lines |
char |
getChar(int c,
int l)
Get the character at the given column and line on the display. |
int |
getColumns()
Return the display width of this buffer |
int |
getCursorX()
Get the X co-ordinate of the cursor |
int |
getCursorY()
Get the Y co-ordinate of the cursor |
java.lang.String |
getLine(int l)
Get the text of a complete row at the specified line on the display as a string. |
int |
getMaxBufferSize()
Get the maximum buffer size in lines. |
int |
getRows()
Return the display height of this buffer |
int |
getTopMargin()
Get the top margin. |
int |
getWindowBase()
Get the window base. |
int |
insertChar(int c,
int l,
char ch,
int attributes)
Insert a character and its attributes at a given column and line. |
void |
insertLine(int l)
|
void |
insertLine(int l,
boolean scrollDown)
|
void |
insertLine(int l,
int n)
|
void |
insertLine(int l,
int n,
boolean scrollDown)
|
abstract boolean |
isShowCursor()
|
void |
markLine(int l,
int n)
Mark a range of lines for update. |
void |
putChar(int c,
int l,
char ch)
|
int |
putChar(int c,
int l,
char ch,
int attributes)
|
void |
putString(int c,
int l,
java.lang.String s)
|
void |
putString(int c,
int l,
java.lang.String s,
int attributes)
|
protected void |
redraw()
|
void |
removeResizeListener(VDUBuffer.ResizeListener l)
|
void |
setBottomMargin(int l)
Set the bottom margin. |
void |
setBufferSize(int amount)
Set the buffer size in lines. |
void |
setCursorPosition(int c,
int l)
|
void |
setDisplay(VDUDisplay display)
|
void |
setScreenSize(int w,
int h,
boolean remote)
|
void |
setTopMargin(int l)
Set the top margin. |
void |
setWindowBase(int line)
Set the window base and redraw the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean SCROLL_UP
public static final boolean SCROLL_DOWN
public static final int NORMAL
public static final int BOLD
public static final int UNDERLINE
public static final int INVERT
public static final int LOW
public static final int COLOR
public static final int COLOR_FG
public static final int COLOR_BG
public int height
public int width
public boolean[] update
public char[][] charArray
public int[][] charAttributes
public boolean[] lineMarker
public int bufSize
public int maxBufSize
public int fill
public int screenBase
public int windowBase
public int scrollMarker
protected boolean showcursor
protected int cursorX
protected int cursorY
protected VDUDisplay display
protected java.util.Vector listenerList
protected VDUBuffer.BufferLock bufferLock
| Constructor Detail |
|---|
public VDUBuffer(int width,
int height)
width - height - terminal - public VDUBuffer()
terminal - | Method Detail |
|---|
public VDUBuffer.BufferLock getBufferLock()
public int getCursorY()
public int getCursorX()
public void addResizeListener(VDUBuffer.ResizeListener l)
l -
public void fireResize(int w,
int h,
boolean remote)
l - public void removeResizeListener(VDUBuffer.ResizeListener l)
l -
public void putChar(int c,
int l,
char ch)
c - l - ch -
public int putChar(int c,
int l,
char ch,
int attributes)
c - l - ch - characters - taken upattributes -
public char getChar(int c,
int l)
c - columnl - line
public java.lang.String getLine(int l)
l - line number
public int getAttributes(int c,
int l)
c - columnl - line
public int insertChar(int c,
int l,
char ch,
int attributes)
c - columnl - linech - character to insertattributes - attributes for charactercharacters - taken up
public void deleteChar(int c,
int l)
c - l -
public void putString(int c,
int l,
java.lang.String s)
c - l - s -
public void putString(int c,
int l,
java.lang.String s,
int attributes)
c - l - s - attributes - public void insertLine(int l)
l -
public void insertLine(int l,
int n)
l - n -
public void insertLine(int l,
boolean scrollDown)
l - scrollDown -
public void insertLine(int l,
int n,
boolean scrollDown)
l - n - scrollDown - public void deleteLine(int l)
l -
public void deleteArea(int c,
int l,
int w,
int h,
int curAttr)
c - l - w - h - curAttr -
public void deleteArea(int c,
int l,
int w,
int h)
c - l - w - h -
public void setCursorPosition(int c,
int l)
c - l - public void setWindowBase(int line)
line - window basepublic int getWindowBase()
public void setTopMargin(int l)
l - top marginpublic int getTopMargin()
public void setBottomMargin(int l)
l - bottom marginpublic int getBottomMargin()
public void setBufferSize(int amount)
amount - buffer size in lines.public int getBufferSize()
public int getMaxBufferSize()
public void setScreenSize(int w,
int h,
boolean remote)
w - h - remote - public int getRows()
public int getColumns()
public void markLine(int l,
int n)
l - first line to updaten - last line to updatepublic void setDisplay(VDUDisplay display)
display - protected void redraw()
public abstract boolean isShowCursor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||