All Packages Class Hierarchy This Package Previous Next Index
Class utils.TxtGrph
java.lang.Object
|
+----utils.TxtGrph
- public class TxtGrph
- extends Object
-
TxtGrph()
-
-
affirmative(String)
- Prompts for a 'Y' or 'N' response from the user
-
beep()
- Beeps the speaker
-
down(int)
- Move cursor down n rows, but not below row 23
Row 24 is reserved for prompts
This procedure cannot scroll the screen
-
eraseAll()
- Erase entire screen.
-
eraseBlock(int, int, int, int)
- Erase block of characters on the screen
-
eraseChars(int)
- Erase numchar characters starting at the cursor
Does not test for writing past right mrgin.
-
eraseDown()
- Erase from cursor to bottom of the screen
-
eraseLeft()
- Erase from start of line to cursor
-
erasePrompt()
- Clears prompt line
-
eraseRight()
- Erase from cursor to end of the line
-
eraseUp()
- Erase from top of screen to cursor.
-
getArrows()
- Waits for an arrow key to be pressed.
-
home()
- move the cursor to the top lefthand corner of screen.
-
homeAndClear()
- Clear screen then place cursor in upper left corner.
-
horizLine(int)
- Draw horizontal line across from current cursor position
-
left(int)
- Move cursor n columns to left, but not beyond column 0
This command will not move the cursor to a different row
-
main(String[])
-
-
position(int, int)
- Position cursor at specified row and column
-
prompt(String)
- Write a message on the prompt line
-
restoreCursor()
- Restore most recently saved cursor position
-
right(int)
- Move cursor n columns to right;
This command will not move the cursor to a different row
-
saveCursor()
- Store cursor position, overwriting any
previously saved positions
-
setBold()
- Put into bold type (extra bright)
-
setNormal()
- Restore to normal video
The following function sets the local display
so that all characters displayed after this function was called,
would display using the default attributes, white-on-black,
non-blinking.
-
setReverse()
- Put into reverse video, dark characters on light background.
-
setUnderline()
-
-
sleep(double)
- Pauses the machine for n seconds.
-
up(int)
- Move cursor up n rows, but not above row 0
This procedure cannot scroll the screen
-
vertLine(int)
- Draw vertical line down, from current cursor position
cursor ends up below last segment of line
TxtGrph
public TxtGrph()
position
public static void position(int row,
int column)
- Position cursor at specified row and column
up
public static void up(int n)
- Move cursor up n rows, but not above row 0
This procedure cannot scroll the screen
down
public static void down(int n)
- Move cursor down n rows, but not below row 23
Row 24 is reserved for prompts
This procedure cannot scroll the screen
right
public static void right(int n)
- Move cursor n columns to right;
This command will not move the cursor to a different row
left
public static void left(int n)
- Move cursor n columns to left, but not beyond column 0
This command will not move the cursor to a different row
home
public static void home()
- move the cursor to the top lefthand corner of screen.
saveCursor
public static void saveCursor()
- Store cursor position, overwriting any
previously saved positions
restoreCursor
public static void restoreCursor()
- Restore most recently saved cursor position
setNormal
public static void setNormal()
- Restore to normal video
The following function sets the local display
so that all characters displayed after this function was called,
would display using the default attributes, white-on-black,
non-blinking. It has no effect if the default mode is already
selected. The characters already on the screen are not changed.
These attribute settings affect only the specified positions
on the screen. They may be set either before or after
characters are written there. Any combination of bold,
underline, and reverse is possible
setBold
public static void setBold()
- Put into bold type (extra bright)
setUnderline
public static void setUnderline()
setReverse
public static void setReverse()
- Put into reverse video, dark characters on light background.
eraseBlock
public static void eraseBlock(int top,
int left,
int bottom,
int right)
- Erase block of characters on the screen
eraseChars
public static void eraseChars(int numchar)
- Erase numchar characters starting at the cursor
Does not test for writing past right mrgin.
eraseRight
public static void eraseRight()
- Erase from cursor to end of the line
eraseLeft
public static void eraseLeft()
- Erase from start of line to cursor
eraseDown
public static void eraseDown()
- Erase from cursor to bottom of the screen
eraseUp
public static void eraseUp()
- Erase from top of screen to cursor.
eraseAll
public static void eraseAll()
- Erase entire screen.
homeAndClear
public static void homeAndClear()
- Clear screen then place cursor in upper left corner.
prompt
public static void prompt(String message)
- Write a message on the prompt line
erasePrompt
public static void erasePrompt()
- Clears prompt line
sleep
public static void sleep(double n)
- Pauses the machine for n seconds.
affirmative
public static boolean affirmative(String message)
- Prompts for a 'Y' or 'N' response from the user
beep
public static void beep()
- Beeps the speaker
getArrows
public static int getArrows()
- Waits for an arrow key to be pressed.
Codes are: arrows (codes 1-4), 'Q' (code 0), RETURN key (code -1)
NOTE: CODES ARE ALWAYS 0 IF ARROW KEY NOT PRESSED (C++ vn. bug)
See C++ code version in comment following
horizLine
public static void horizLine(int length)
- Draw horizontal line across from current cursor position
vertLine
public static void vertLine(int Height)
- Draw vertical line down, from current cursor position
cursor ends up below last segment of line
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index