jcurzez.peer.win
Class PeerScreen

java.lang.Object
  |
  +--jcurzez.peer.win.PeerScreen
All Implemented Interfaces:
ScreenPeer

public final class PeerScreen
extends java.lang.Object
implements ScreenPeer

The win implementation of jcurzez. Almost all methods are native.

Version:
0.0.3
Author:
Thomas Girard

Field Summary
private static byte BLACK
           
private static byte BLUE
           
private static byte CYAN
           
private static byte GREEN
           
private static byte MAGENTA
           
private static byte RED
           
private static byte WHITE
           
private static byte YELLOW
           
 
Constructor Summary
PeerScreen()
           
 
Method Summary
private static void _beep()
           
private static int _begin()
           
private static void _end()
           
private static int _getColumns()
           
private static int _getFirstX()
           
private static int _getFirstY()
           
private static int _getLines()
           
private static void _gotoXY(int x, int y)
           
private static void _printCell(int x, int y, int character, short color, byte attr)
           
private static void _setCursorVisibility(int v)
           
private static void _update()
           
 void beep()
          Emits an audio beep.
 void end()
          Performs all shutdown tasks before the screen is destroyed.
 int getColumns()
          Retrieves the number of columns the screen has.
 int getFirstX()
          Retrieves the x coordinate by the time the screen object is created.
 int getFirstY()
          Retrieves the y coordinate by the time the screen object is created.
 int getLines()
          Retrieves the number of lines the screen has.
 void gotoXY(int x, int y)
          Moves the cursor on the physical screen at specified position.
 void printCell(int x, int y, Cell cell)
          Prints the cell cell on the physical screen at specified position.
 void setCursorVisibility(int v)
          Changes the way cursor is displayed.
 void update()
          Updates the physical screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

private static final byte BLACK

BLUE

private static final byte BLUE

GREEN

private static final byte GREEN

CYAN

private static final byte CYAN

RED

private static final byte RED

YELLOW

private static final byte YELLOW

MAGENTA

private static final byte MAGENTA

WHITE

private static final byte WHITE
Constructor Detail

PeerScreen

public PeerScreen()
Method Detail

_begin

private static int _begin()

_gotoXY

private static void _gotoXY(int x,
                            int y)

gotoXY

public void gotoXY(int x,
                   int y)
Description copied from interface: ScreenPeer
Moves the cursor on the physical screen at specified position. This method must not be called directly. x and y should be consistent. This method is used by refresh to move the cursor where it is supposed to be.

Specified by:
gotoXY in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Parameters:
x - x coordinate where to send the cursor. This is an absolute coordinate.
y - y coordinate where to send the cursor. This is an absolute coordinate.
See Also:
AbstractWindow.refresh()

_printCell

private static void _printCell(int x,
                               int y,
                               int character,
                               short color,
                               byte attr)

printCell

public void printCell(int x,
                      int y,
                      Cell cell)
Description copied from interface: ScreenPeer
Prints the cell cell on the physical screen at specified position.

Specified by:
printCell in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Parameters:
x - x coordinate where to send the cursor. This is an absolute coordinate.
y - y coordinate where to send the cursor. This is an absolute coordinate.
cell - the cell to print at this position.
See Also:
Cell

_getColumns

private static int _getColumns()

getColumns

public int getColumns()
Description copied from interface: ScreenPeer
Retrieves the number of columns the screen has. This is often 80, but it may be different if you use a xterm, a different screen mode, or frame buffering.

Specified by:
getColumns in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Returns:
the number of columns the screen has.

_getLines

private static int _getLines()

getLines

public int getLines()
Description copied from interface: ScreenPeer
Retrieves the number of lines the screen has. This is often 25, but it may be different if you use a xterm, a different screen mode, or frame buffering.

Specified by:
getLines in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Returns:
the number of lines the screen has.

_getFirstX

private static int _getFirstX()

getFirstX

public int getFirstX()
Description copied from interface: ScreenPeer
Retrieves the x coordinate by the time the screen object is created.

Specified by:
getFirstX in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Returns:
the x coordinate at the beginning.

_getFirstY

private static int _getFirstY()

getFirstY

public int getFirstY()
Description copied from interface: ScreenPeer
Retrieves the y coordinate by the time the screen object is created.

Specified by:
getFirstY in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Returns:
the y coordinate at the beginning.

_update

private static void _update()

update

public void update()
Description copied from interface: ScreenPeer
Updates the physical screen. This method provides a way for a peer to optimize its display. It is called when all needed cells have been printed, and before the cursor is moved back - using ScreenPeer.gotoXY(int, int) - to where it should be.

Specified by:
update in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
See Also:
AbstractWindow.refresh()

_setCursorVisibility

private static void _setCursorVisibility(int v)

setCursorVisibility

public void setCursorVisibility(int v)
Description copied from interface: ScreenPeer
Changes the way cursor is displayed.

Specified by:
setCursorVisibility in interface ScreenPeer
Following copied from interface: jcurzez.peer.ScreenPeer
Parameters:
v - visibility of the cursor. One of NORMAL, INVISIBLE, VERY_VISIBLE.
See Also:
Cursor

_beep

private static void _beep()

beep

public void beep()
Description copied from interface: ScreenPeer
Emits an audio beep.

Specified by:
beep in interface ScreenPeer

_end

private static void _end()

end

public void end()
Description copied from interface: ScreenPeer
Performs all shutdown tasks before the screen is destroyed.

Specified by:
end in interface ScreenPeer


Send me an email