jcurzez.peer
Class NullScreenPeer

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

public class NullScreenPeer
extends java.lang.Object
implements ScreenPeer

This class is needed because when the Jcurses's shutdown hook is called, there may be other threads that are still using Screen. So these calls are routed to here, where they are discarded.

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

Field Summary
private  int columns
          Columns of the previous peer.
private  int lines
          Lines of the previous peer.
 
Constructor Summary
NullScreenPeer(int columns, int lines)
          Creates a new .
 
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)
          Does nothing.
 void printCell(int x, int y, Cell cell)
          Does nothing.
 void setCursorVisibility(int v)
          Changes the way cursor is displayed.
 void update()
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columns

private final int columns
Columns of the previous peer. To be consistent.


lines

private final int lines
Lines of the previous peer. To be consistent.

Constructor Detail

NullScreenPeer

public NullScreenPeer(int columns,
                      int lines)
Creates a new .

Method Detail

gotoXY

public void gotoXY(int x,
                   int y)
Does nothing.

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

public void printCell(int x,
                      int y,
                      Cell cell)
Does nothing.

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

update

public void update()
Does nothing.

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

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

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

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

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.

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

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

Specified by:
beep in interface ScreenPeer

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