|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.mud.terminal.VDUBuffer
Implementation of a Video Display Unit (VDU) buffer. This class contains all methods to manipulate the buffer that stores characters and their attributes as well as the regions displayed.
Field Summary | |
static int |
BOLD
Make character bold. |
int |
bufSize
|
char[][] |
charArray
|
int[][] |
charAttributes
|
static int |
COLOR
color mask |
static int |
COLOR_BG
background color mask |
static int |
COLOR_BG_SHIFT
how much to left shift the background color |
static int |
COLOR_FG
foreground color mask |
static int |
COLOR_FG_SHIFT
how much to left shift the foreground color |
protected int |
cursorX
|
protected int |
cursorY
|
static int |
debug
Enable debug messages. |
protected VDUDisplay |
display
a generic display that should redraw on demand |
int |
height
|
static java.lang.String |
ID
The current version id tag |
static int |
INVERT
Invert character. |
static int |
INVISIBLE
Invisible character. |
static int |
LOW
Lower intensity character. |
int |
maxBufSize
|
static int |
NORMAL
Make character normal. |
int |
screenBase
|
static boolean |
SCROLL_DOWN
Scroll down when inserting a line. |
static boolean |
SCROLL_UP
Scroll up when inserting a line. |
int |
scrollMarker
|
protected boolean |
showcursor
|
static int |
UNDERLINE
Underline character. |
boolean[] |
update
|
int |
width
|
int |
windowBase
|
Constructor Summary | |
VDUBuffer()
Create a standard video display buffer with 80 columns and 24 lines. |
|
VDUBuffer(int width,
int height)
Create a new video display buffer with the passed width and height in characters. |
Method Summary | |
void |
deleteArea(int c,
int l,
int w,
int h)
Delete a rectangular portion of the screen. |
void |
deleteArea(int c,
int l,
int w,
int h,
int curAttr)
Delete a rectangular portion of the screen. |
void |
deleteChar(int c,
int l)
Delete a character at a given position on the screen. |
void |
deleteLine(int l)
Delete a line at a specific position. |
int |
getAttributes(int c,
int l)
Get the attributes for the specified position. |
int |
getBottomMargin()
Get the bottom scroll margin. |
int |
getBufferSize()
Retrieve current scrollback buffer size. |
char |
getChar(int c,
int l)
Get the character at the specified position. |
int |
getColumns()
Get amount of columns on the screen. |
int |
getCursorColumn()
Get the current column of the cursor position. |
int |
getCursorRow()
Get the current line of the cursor position. |
int |
getMaxBufferSize()
Retrieve maximum buffer Size. |
int |
getRows()
Get amount of rows on the screen. |
int |
getTopMargin()
Get the top scroll margin. |
int |
getWindowBase()
Get the current window base. |
void |
insertChar(int c,
int l,
char ch,
int attributes)
Insert a character at a specific position on the screen. |
void |
insertLine(int l)
Insert a blank line at a specific position. |
void |
insertLine(int l,
boolean scrollDown)
Insert a blank line at a specific position. |
void |
insertLine(int l,
int n)
Insert blank lines at a specific position. |
void |
insertLine(int l,
int n,
boolean scrollDown)
Insert blank lines at a specific position. |
void |
markLine(int l,
int n)
Mark lines to be updated with redraw(). |
void |
putChar(int c,
int l,
char ch)
Put a character on the screen with normal font and outline. |
void |
putChar(int c,
int l,
char ch,
int attributes)
Put a character on the screen with specific font and outline. |
void |
putString(int c,
int l,
java.lang.String s)
Put a String at a specific position. |
void |
putString(int c,
int l,
java.lang.String s,
int attributes)
Put a String at a specific position giving all characters the same attributes. |
protected void |
redraw()
Trigger a redraw on the display. |
void |
setBottomMargin(int l)
Set the bottom scroll margin for the screen. |
void |
setBufferSize(int amount)
Set scrollback buffer size. |
void |
setCursorPosition(int c,
int l)
Puts the cursor at the specified position. |
void |
setDisplay(VDUDisplay display)
|
void |
setScreenSize(int w,
int h)
Change the size of the screen. |
void |
setTopMargin(int l)
Set the top scroll margin for the screen. |
void |
setWindowBase(int line)
Set the current window base. |
void |
showCursor(boolean doshow)
Sets whether the cursor is visible or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ID
public static final int debug
public int height
public int width
public boolean[] update
public char[][] charArray
public int[][] charAttributes
public int bufSize
public int maxBufSize
public int screenBase
public int windowBase
public int scrollMarker
protected boolean showcursor
protected int cursorX
protected int cursorY
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 INVISIBLE
public static final int COLOR_FG_SHIFT
public static final int COLOR_BG_SHIFT
public static final int COLOR
public static final int COLOR_FG
public static final int COLOR_BG
protected VDUDisplay display
Constructor Detail |
public VDUBuffer(int width, int height)
width
- the length of the character linesheight
- the amount of lines on the screenpublic VDUBuffer()
Method Detail |
public void putChar(int c, int l, char ch)
c
- x-coordinate (column)l
- y-coordinate (line)ch
- the character to show on the screeninsertChar(int, int, char, int)
,
deleteChar(int, int)
,
redraw()
public void putChar(int c, int l, char ch, int attributes)
c
- x-coordinate (column)l
- y-coordinate (line)ch
- the character to show on the screenattributes
- the character attributesBOLD
,
UNDERLINE
,
INVERT
,
INVISIBLE
,
NORMAL
,
LOW
,
insertChar(int, int, char, int)
,
deleteChar(int, int)
,
redraw()
public char getChar(int c, int l)
c
- x-coordinate (column)l
- y-coordinate (line)putChar(int, int, char)
public int getAttributes(int c, int l)
c
- x-coordinate (column)l
- y-coordinate (line)putChar(int, int, char)
public void insertChar(int c, int l, char ch, int attributes)
c
- x-coordinate (column)l
- y-coordinate (line)ch
- the character to insertattributes
- the character attributesBOLD
,
UNDERLINE
,
INVERT
,
INVISIBLE
,
NORMAL
,
LOW
,
putChar(int, int, char)
,
deleteChar(int, int)
,
redraw()
public void deleteChar(int c, int l)
c
- x-coordinate (column)l
- y-coordinate (line)putChar(int, int, char)
,
insertChar(int, int, char, int)
,
redraw()
public void putString(int c, int l, java.lang.String s)
c
- x-coordinate (column)l
- y-coordinate (line)s
- the string to be shown on the screenBOLD
,
UNDERLINE
,
INVERT
,
INVISIBLE
,
NORMAL
,
LOW
,
putChar(int, int, char)
,
insertLine(int)
,
deleteLine(int)
,
redraw()
public void putString(int c, int l, java.lang.String s, int attributes)
c
- x-coordinate (column)l
- y-coordinate (line)s
- the string to be shown on the screenattributes
- character attributesBOLD
,
UNDERLINE
,
INVERT
,
INVISIBLE
,
NORMAL
,
LOW
,
putChar(int, int, char)
,
insertLine(int)
,
deleteLine(int)
,
redraw()
public void insertLine(int l)
l
- the y-coordinate to insert the linedeleteLine(int)
,
redraw()
public void insertLine(int l, int n)
l
- the y-coordinate to insert the linen
- amount of lines to be inserteddeleteLine(int)
,
redraw()
public void insertLine(int l, boolean scrollDown)
l
- the y-coordinate to insert the linescrollDown
- scroll downdeleteLine(int)
,
SCROLL_UP
,
SCROLL_DOWN
,
redraw()
public void insertLine(int l, int n, boolean scrollDown)
l
- the y-coordinate to insert the linen
- number of lines to be insertedscrollDown
- scroll downdeleteLine(int)
,
SCROLL_UP
,
SCROLL_DOWN
,
redraw()
public void deleteLine(int l)
l
- the y-coordinate to insert the linedeleteLine(int)
public void deleteArea(int c, int l, int w, int h, int curAttr)
c
- x-coordinate (column)l
- y-coordinate (row)w
- with of the area in charactersh
- height of the area in characterscurAttr
- attribute to filldeleteChar(int, int)
,
deleteLine(int)
,
redraw()
public void deleteArea(int c, int l, int w, int h)
c
- x-coordinate (column)l
- y-coordinate (row)w
- with of the area in charactersh
- height of the area in charactersdeleteChar(int, int)
,
deleteLine(int)
,
redraw()
public void showCursor(boolean doshow)
doshow
- public void setCursorPosition(int c, int l)
c
- columnl
- linepublic int getCursorColumn()
public int getCursorRow()
public void setWindowBase(int line)
line
- the line where the screen window startssetBufferSize(int)
,
getBufferSize()
public int getWindowBase()
setWindowBase(int)
public void setTopMargin(int l)
l
- line that is the marginpublic int getTopMargin()
public void setBottomMargin(int l)
l
- line that is the marginpublic int getBottomMargin()
public void setBufferSize(int amount)
amount
- new size of the bufferpublic int getBufferSize()
setBufferSize(int)
public int getMaxBufferSize()
getBufferSize()
public void setScreenSize(int w, int h)
w
- of the screenh
- of the screenpublic int getRows()
public int getColumns()
public void markLine(int l, int n)
l
- starting linen
- amount of lines to be updatedredraw()
public void setDisplay(VDUDisplay display)
protected void redraw()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |