jcurzez.peer
Interface ScreenPeer

All Known Implementing Classes:
NullScreenPeer, PeerScreen, PeerScreen, PeerScreen

public interface ScreenPeer

This interface consists in few methods that a peer class must implement to provide jcurzez a Screen.

The Screen class relies on this interface, as Area eventually does.

Version:
0.0.3
Author:
Thomas Girard
See Also:
Screen.peer

Method Summary
 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.
 

Method Detail

gotoXY

public void gotoXY(int x,
                   int y)
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.

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

public void printCell(int x,
                      int y,
                      Cell cell)
Prints the cell cell on the physical screen at specified position.

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

update

public void update()
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 gotoXY(int, int) - to where it should be.

See Also:
AbstractWindow.refresh()

getColumns

public int getColumns()
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.

Returns:
the number of columns the screen has.

getLines

public int getLines()
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.

Returns:
the number of lines the screen has.

getFirstX

public int getFirstX()
Retrieves the x coordinate by the time the screen object is created.

Returns:
the x coordinate at the beginning.

getFirstY

public int getFirstY()
Retrieves the y coordinate by the time the screen object is created.

Returns:
the y coordinate at the beginning.

setCursorVisibility

public void setCursorVisibility(int v)
Changes the way cursor is displayed.

Parameters:
v - visibility of the cursor. One of NORMAL, INVISIBLE, VERY_VISIBLE.
See Also:
Cursor

beep

public void beep()
Emits an audio beep.


end

public void end()
Performs all shutdown tasks before the screen is destroyed.



Send me an email