|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.slashie.libjcsi.jcurses.JCursesConsoleInterface
public class JCursesConsoleInterface
This provides an interface using JCurses
| Field Summary |
|---|
| Fields inherited from interface net.slashie.libjcsi.ConsoleSystemInterface |
|---|
BLACK, BLUE, BROWN, CYAN, DARK_BLUE, DARK_RED, GRAY, GREEN, LEMON, LIGHT_GRAY, MAGENTA, PURPLE, RED, TEAL, WHITE, YELLOW |
| Constructor Summary | |
|---|---|
JCursesConsoleInterface()
|
|
| 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 l)
Reads a string from the keyboard with a maximum length |
boolean |
isInsideBounds(int x,
int y)
|
boolean |
isInsideBounds(Position p)
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 character,
CSIColor csiColor)
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 string,
CSIColor csiColor)
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JCursesConsoleInterface()
| Method Detail |
|---|
public void print(int x,
int y,
char what,
int color)
ConsoleSystemInterface
print in interface ConsoleSystemInterfacex - horizontal positiony - vertical positionwhat - The character to be printedcolor - The color, one of the ConsoleSystemInterface constants
public void print(int x,
int y,
java.lang.String what,
int color)
ConsoleSystemInterface
print in interface ConsoleSystemInterfacex - horizontal starting positiony - vertical positionwhat - The string to be printedcolor - The color, one of the ConsoleSystemInterface constants
public void print(int x,
int y,
java.lang.String what)
ConsoleSystemInterface
print in interface ConsoleSystemInterfacex - horizontal starting positiony - vertical starting positionwhat - The String to be printed
public char peekChar(int x,
int y)
ConsoleSystemInterface
peekChar in interface ConsoleSystemInterfacex - horizontal positiony - vertical position
public int peekColor(int x,
int y)
ConsoleSystemInterface
peekColor in interface ConsoleSystemInterfacex - horizontal positiony - vertical position
public CharKey inkey()
ConsoleSystemInterface
inkey in interface ConsoleSystemInterface
public void locateCaret(int x,
int y)
ConsoleSystemInterface
locateCaret in interface ConsoleSystemInterfacex - horizontal positiony - vertical positionpublic java.lang.String input()
ConsoleSystemInterface
input in interface ConsoleSystemInterfacepublic java.lang.String input(int l)
ConsoleSystemInterface
input in interface ConsoleSystemInterfacepublic boolean isInsideBounds(Position p)
ConsoleSystemInterface
isInsideBounds in interface ConsoleSystemInterfacep - position to be tested
public boolean isInsideBounds(int x,
int y)
public void cls()
ConsoleSystemInterface
cls in interface ConsoleSystemInterfacepublic void refresh()
ConsoleSystemInterface
refresh in interface ConsoleSystemInterfacepublic void refresh(java.lang.Thread t)
ConsoleSystemInterface
refresh in interface ConsoleSystemInterfacepublic void flash(int color)
ConsoleSystemInterface
flash in interface ConsoleSystemInterfacepublic void setAutoRefresh(boolean value)
ConsoleSystemInterface
setAutoRefresh in interface ConsoleSystemInterfacevalue - true to activate buffer
public void safeprint(int x,
int y,
char what,
int color)
ConsoleSystemInterface
safeprint in interface ConsoleSystemInterfacex - horizontal positiony - vertical positionwhat - The character to be printedcolor - The color, one of the ConsoleSystemInterface constantspublic void waitKey(int keyCode)
ConsoleSystemInterface
waitKey in interface ConsoleSystemInterfacekeyCode - code of specific key to wait forpublic void restore()
ConsoleSystemInterface
restore in interface ConsoleSystemInterfacepublic void saveBuffer()
ConsoleSystemInterface
saveBuffer in interface ConsoleSystemInterface
public void print(int x,
int y,
char character,
CSIColor csiColor)
ConsoleSystemInterface
print in interface ConsoleSystemInterfacex - horizontal positiony - vertical positioncharacter - The character to be printedcsiColor - The color, a rgba instance of CSIColor
public void print(int x,
int y,
java.lang.String string,
CSIColor csiColor)
ConsoleSystemInterface
print in interface ConsoleSystemInterfacex - horizontal positiony - vertical positionstring - The String to be printedcsiColor - The color, a rgba instance of CSIColorpublic void flushColorTable()
ConsoleSystemInterface
flushColorTable in interface ConsoleSystemInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||