public class ConsoleDriver extends AbstractChuiDriver
Modifier and Type | Field and Description |
---|---|
private ConsoleHelper |
helper
Reference to console low-level driver.
|
private static int |
KEY_MOUSE
Special key code which denotes mouse event.
|
private KeyProcessor |
processor
Key processor.
|
direct, factory
Constructor and Description |
---|
ConsoleDriver()
Constructor.
|
ConsoleDriver(ConsolePrimitives direct,
java.lang.String term)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
beep()
Generate a beep signal.
|
void |
clear()
Clear screen.
|
ChildProcessFactory |
getChildProcessFactory()
Get driver-specific child process factory.
|
void |
init()
Initialize driver.
|
int |
readKey()
Read the key from terminal and translate it into P2J internal
representation.
|
void |
resetMode()
Reset screen mode.
|
void |
resume()
Resume terminal after
suspend() call. |
boolean |
setCursorStatus(boolean on)
Set cursor status (ON/OFF).
|
void |
setTerminalType(java.lang.String name)
Set terminal type according to passed string.
|
void |
suspend()
Suspend terminal and release it for use by other applications.
|
java.lang.String |
terminalType()
Get terminal type string.
|
captureMouseEvents, convertToOptions, createOutputManager, handleMouseEvent
getFactory, getPrimitives, getWindowSystem, inBackgroundMode, inBatchMode, isChui, setBackgroundMode, setBatchMode, shutdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clientReady, lockMousePointer, openURL, propagate
private static final int KEY_MOUSE
private KeyProcessor processor
private ConsoleHelper helper
public ConsoleDriver()
public ConsoleDriver(ConsolePrimitives direct, java.lang.String term)
direct
- The output primitives.term
- Terminal type string.public void beep()
Implementation deoends on native layer and (in turn) from particular terminal. If terminal does not support this feature or sound in terminal is turned off, there will be no audible feedback to user.
public void clear()
public ChildProcessFactory getChildProcessFactory()
public int readKey()
KeyProcessor
class.
Mouse events (which also returned from native layer) are filtered out
because mouse is not supported.public void resetMode()
public void resume()
suspend()
call.public boolean setCursorStatus(boolean on) throws java.lang.IllegalStateException
setCursorStatus
in interface ScreenDriver<ChuiOutputManager>
setCursorStatus
in class AbstractChuiDriver
on
- true
- show cursor, false
- hide cursor.false
.java.lang.IllegalStateException
public void setTerminalType(java.lang.String name)
setTerminalType
in interface ScreenDriver<ChuiOutputManager>
setTerminalType
in class AbstractDriver<BasePrimitives,ChuiOutputManager>
name
- The terminal type.public void suspend()
public java.lang.String terminalType()
terminalType
in interface ScreenDriver<ChuiOutputManager>
terminalType
in class AbstractDriver<BasePrimitives,ChuiOutputManager>
public void init()
init
in interface ScreenDriver<ChuiOutputManager>
init
in class AbstractDriver<BasePrimitives,ChuiOutputManager>