|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConsoleSystemInterface
Allows for easy output to a console screen emulation and keyboard input.
Field Summary | |
---|---|
static int |
BLACK
|
static int |
BLUE
|
static int |
BROWN
|
static int |
CYAN
|
static int |
DARK_BLUE
|
static int |
DARK_RED
|
static int |
GRAY
|
static int |
GREEN
|
static int |
LEMON
|
static int |
LIGHT_GRAY
|
static int |
MAGENTA
|
static int |
PURPLE
|
static int |
RED
|
static int |
TEAL
|
static int |
WHITE
|
static int |
YELLOW
|
Method Summary | |
---|---|
void |
cls()
Clears the screen |
void |
flash(int color)
Makes the screen flash with a given color |
void |
flushColorTable()
This flushes the internal Hashtable for the colors. |
CharKey |
inkey()
Waits until a key is pressed and returns it |
java.lang.String |
input()
Reads a string from the keyboard |
java.lang.String |
input(int length)
Reads a string from the keyboard with a maximum length |
boolean |
isInsideBounds(Position e)
Checks if the position is valid |
void |
locateCaret(int x,
int y)
Locates the input caret on a given position |
char |
peekChar(int x,
int y)
Checks what character is at a given position |
int |
peekColor(int x,
int y)
Checks what color is at a given position |
void |
print(int x,
int y,
char what,
CSIColor color)
Prints a character on the console, using a custom color |
void |
print(int x,
int y,
char what,
int color)
Prints a character on the console |
void |
print(int x,
int y,
java.lang.String what)
Prints a String on the console with the default color. |
void |
print(int x,
int y,
java.lang.String what,
CSIColor color)
Prints a String on the console, using a custom color. |
void |
print(int x,
int y,
java.lang.String what,
int color)
Prints a String on the console in the color specified. |
void |
refresh()
Refreshes the screen, printing all characters that were buffered Some implementations may instead write directly to the console |
void |
refresh(java.lang.Thread t)
Refreshes the screen, printing all characters that were buffered, and interrupts the Thread Some implementations may instead write directly to the console |
void |
restore()
Restores the contents of the backup buffer to screen |
void |
safeprint(int x,
int y,
char what,
int color)
Same as print but must check for validity of the coordinates |
void |
saveBuffer()
Saves the screen contents to a backup buffer |
void |
setAutoRefresh(boolean value)
Sets whether or not a buffer will be used |
void |
waitKey(int keyCode)
Waits for the user to press a key |
Field Detail |
---|
static final int BLACK
static final int DARK_BLUE
static final int GREEN
static final int TEAL
static final int DARK_RED
static final int PURPLE
static final int BROWN
static final int LIGHT_GRAY
static final int GRAY
static final int BLUE
static final int LEMON
static final int CYAN
static final int RED
static final int MAGENTA
static final int YELLOW
static final int WHITE
Method Detail |
---|
void print(int x, int y, char what, int color)
x
- horizontal positiony
- vertical positionwhat
- The character to be printedcolor
- The color, one of the ConsoleSystemInterface constantsvoid safeprint(int x, int y, char what, int color)
x
- horizontal positiony
- vertical positionwhat
- The character to be printedcolor
- The color, one of the ConsoleSystemInterface constantsvoid print(int x, int y, java.lang.String what, int color)
x
- horizontal starting positiony
- vertical positionwhat
- The string to be printedcolor
- The color, one of the ConsoleSystemInterface constantsvoid print(int x, int y, java.lang.String what)
x
- horizontal starting positiony
- vertical starting positionwhat
- The String to be printedchar peekChar(int x, int y)
x
- horizontal positiony
- vertical position
int peekColor(int x, int y)
x
- horizontal positiony
- vertical position
CharKey inkey()
void locateCaret(int x, int y)
x
- horizontal positiony
- vertical positionjava.lang.String input()
java.lang.String input(int length)
boolean isInsideBounds(Position e)
e
- position to be tested
void cls()
void refresh()
void refresh(java.lang.Thread t)
void flash(int color)
color
- void flushColorTable()
void setAutoRefresh(boolean value)
value
- true to activate buffervoid waitKey(int keyCode)
keyCode
- code of specific key to wait forvoid saveBuffer()
void restore()
void print(int x, int y, char what, CSIColor color)
x
- horizontal positiony
- vertical positionwhat
- The character to be printedcolor
- The color, a rgba instance of CSIColorvoid print(int x, int y, java.lang.String what, CSIColor color)
x
- horizontal positiony
- vertical positionwhat
- The String to be printedcolor
- The color, a rgba instance of CSIColor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |