|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcurzez.AbstractWindow | +--jcurzez.Screen
This class inherits features from
AbstractWindow
, and internally uses
a peer component
so that it is
a concrete class.
The peer component is chosen using system properties,
a explained here
.
Note: To decide if the screen should have linewrapping and autoscrolling
features, one may use jcurzez.term.linewrap
and
jcurzez.term.scroll
system properties, which both
default to true
when not set.
Nested Class Summary | |
private static class |
Screen.CursesHook
|
Field Summary | |
private static boolean |
endCalled
Indicates whether end() was already called. |
private static ScreenPeer |
peer
The peer implementation. |
private static java.lang.Object |
peerLock
The lock on the peer. |
static java.io.PrintStream |
previousErr
Previous object for stderr . |
static java.io.PrintStream |
previousOut
Previous object for stdout . |
private static Screen |
SCREEN
The one and only screen. |
private static boolean |
screenLinewrap
true if the screen has the linewrap feature. |
private static boolean |
screenScroll
true if the screen has the scroll feature. |
Fields inherited from class jcurzez.AbstractWindow |
buffer, cat, cursor, id, linewrap, parent, scroll |
Constructor Summary | |
private |
Screen()
Constructs a new Screen . |
Method Summary | |
void |
beep()
Delegates call to peer . |
static void |
end()
This method is invoked by shutdown hook, or explicitly to stop using Jcurzez. |
private static java.lang.String |
getPeerPackageName()
To achieve screen creation, the Screen
static initializer uses the jcurzez.term.type property. |
static Screen |
getScreen()
Retrieves the one and only screen. |
protected void |
gotoXY(int x,
int y)
Delegates call to peer . |
protected void |
printCell(int x,
int y,
Cell cell)
Delegates call to peer . |
(package private) void |
setCursorVisibility(int visibility)
Delegates call to peer . |
protected void |
update()
Delegates call to peer . |
Methods inherited from class jcurzez.AbstractWindow |
clear, clearToBottom, clearToEndOfLine, copyCellsAt, deleteChar, deleteLine, equals, getCellsAt, getCursor, getId, getParent, getRectangle, getTabulationSize, hashCode, hasLinesWrapped, insertChar, insertLine, insertString, printChar, printString, refresh, removeExtraChars, toString, touch, wouldScroll |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static volatile ScreenPeer peer
private static volatile boolean endCalled
end()
was already called.
private static final boolean screenLinewrap
true
if the screen has the linewrap feature.
It is determined using the jcurzez.term.linewrap
system propety, and defaults to true
if this
property is not set.
private static final boolean screenScroll
true
if the screen has the scroll feature.
It is determined using the jcurzez.term.scroll
system propety, and defaults to true
if this
property is not set.
public static final java.io.PrintStream previousOut
stdout
.
public static final java.io.PrintStream previousErr
stderr
.
private static Screen SCREEN
private static final java.lang.Object peerLock
Constructor Detail |
private Screen()
Screen
.
Hook are set so that all calls to System.out
and
System.err
are routed to this
.
Method Detail |
private static final java.lang.String getPeerPackageName()
Screen
static initializer uses the jcurzez.term.type
property.
os.name
property, with the
following rules: "LINUX"
,
we use curses implementation"WIN"
, we use win
implementation
public static Screen getScreen()
public void beep()
peer
.
beep
in class AbstractWindow
jcurzez.AbstractWindow
ScreenPeer.beep()
protected void gotoXY(int x, int y)
peer
.
gotoXY
in class AbstractWindow
jcurzez.AbstractWindow
x
- the x coordinate where to move the cursor.y
- the y coordinate where to move the cursor.ScreenPeer.gotoXY(int, int)
void setCursorVisibility(int visibility)
peer
.
protected void printCell(int x, int y, Cell cell)
peer
.
printCell
in class AbstractWindow
jcurzez.AbstractWindow
x
- the x coordinate where to print the cell.y
- the y coordinate where to print the cell.cell
- the cell to print.ScreenPeer.printCell(int, int, jcurzez.Cell)
protected void update()
peer
.
update
in class AbstractWindow
jcurzez.AbstractWindow
ScreenPeer.update()
public static void end()
peer
is changed to a NullScreenPeer
. Eventually System.out
is restored.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |