|
Internet Chess ToolKit v0.2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ictk.boardgame.chess.ui.cli.TxChessBoardDisplay
This is a TxChess style command-line visual representation of a board. TxChess is an old C program used for email chess. The board usually looks like this:
8 r n b q # r k 7 p p p # p b p 6 # # p # n p 5 # # p # # 4 # P P # 3 # N # # P # 2 P P # P N P B P 1 R # B Q R K # A B C D E F G H
Field Summary |
Fields inherited from interface ictk.boardgame.chess.ui.ChessBoardDisplay |
BOTTOM_COORDINATES, LEFT_COORDINATES, NO_COORDINATES, RIGHT_COORDINATES, TOP_COORDINATES |
Constructor Summary | |
TxChessBoardDisplay(ChessBoard board)
|
|
TxChessBoardDisplay(ChessBoard board,
java.io.OutputStream out)
|
|
TxChessBoardDisplay(ChessBoard board,
java.io.PrintWriter out)
|
|
TxChessBoardDisplay(ChessBoard board,
java.io.Writer out)
|
Method Summary | |
void |
boardUpdate(Board b,
int event)
the board display is updated (printed to stream) for every event except durning traversal, in which only the final position causes a new board to be displayed. |
Board |
getBoard()
returns the Board that this Display is using as a model. |
boolean |
getSideToMoveOnBottom()
returns true if the board is set to re-orient itself so the side to move is at the bottom after every move on update. |
int |
getVisibleCoordinates()
returns the mask of which coordinates are set visible for this board. |
java.io.Writer |
getWriter()
returns the Writer currently being used. |
boolean |
isCompact()
test if this display is in Compact mode |
boolean |
isInverse()
checks to see if the display is assuming the foreground is darker than the background. |
boolean |
isLowerCaseCoordinates()
returns if the coordinates are currently set to appear in lowercase. |
boolean |
isWhiteOnBottom()
returns true if the board is oriented so white is currently on the bottom. |
void |
print()
prints the current board onto the Writer. |
void |
print(Board board)
prints the current specified board onto the Writer. |
void |
setBoard(Board board)
set the Board that this Display will use as a model. |
void |
setCompact(boolean t)
setting this attribute to true will eliminate needless space characters in the output. |
void |
setInverse(boolean t)
sets the display to assume the foreground is darker than the background. |
void |
setLowerCaseCoordinates(boolean t)
sets the coordinates to appear in lowercase. |
void |
setSideToMoveOnBottom(boolean t)
sets the board to re-orient itself so the side to move is at the bottom after every move on update. |
void |
setVisibleCoordinates(int mask)
sets which coordinates should appear when the board is displayed. |
void |
setWhiteOnBottom(boolean t)
orients the board so White is on the bottom. |
void |
setWriter(java.io.PrintWriter out)
sets the stream where the display will be sent. |
void |
update()
this refreshes the board display. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TxChessBoardDisplay(ChessBoard board, java.io.OutputStream out)
public TxChessBoardDisplay(ChessBoard board, java.io.Writer out)
public TxChessBoardDisplay(ChessBoard board, java.io.PrintWriter out)
public TxChessBoardDisplay(ChessBoard board)
Method Detail |
public void boardUpdate(Board b, int event)
boardUpdate
in interface BoardListener
b
- the board the event occured on.event
- indicates what type of update has occured. (MOVE_EVENT,
POSITION_EVENT etc).public void setCompact(boolean t)
public boolean isCompact()
public void setBoard(Board board)
BoardDisplay
setBoard
in interface BoardDisplay
public Board getBoard()
BoardDisplay
getBoard
in interface BoardDisplay
public void update()
BoardDisplay
update
in interface BoardDisplay
public void setWhiteOnBottom(boolean t)
ChessBoardDisplay
setWhiteOnBottom
in interface ChessBoardDisplay
public boolean isWhiteOnBottom()
ChessBoardDisplay
isWhiteOnBottom
in interface ChessBoardDisplay
public void setSideToMoveOnBottom(boolean t)
ChessBoardDisplay
setSideToMoveOnBottom
in interface ChessBoardDisplay
public boolean getSideToMoveOnBottom()
ChessBoardDisplay
getSideToMoveOnBottom
in interface ChessBoardDisplay
public void setVisibleCoordinates(int mask)
ChessBoardDisplay
setVisibleCoordinates
in interface ChessBoardDisplay
public int getVisibleCoordinates()
ChessBoardDisplay
getVisibleCoordinates
in interface ChessBoardDisplay
public void setLowerCaseCoordinates(boolean t)
ChessBoardDisplay
setLowerCaseCoordinates
in interface ChessBoardDisplay
public boolean isLowerCaseCoordinates()
ChessBoardDisplay
isLowerCaseCoordinates
in interface ChessBoardDisplay
public void setInverse(boolean t)
CLIBoardDisplay
setInverse
in interface CLIBoardDisplay
public boolean isInverse()
CLIBoardDisplay
isInverse
in interface CLIBoardDisplay
public void setWriter(java.io.PrintWriter out)
CLIBoardDisplay
display.setWriter(new PrintWriter(System.out, true));
setWriter
in interface CLIBoardDisplay
public java.io.Writer getWriter()
CLIBoardDisplay
getWriter
in interface CLIBoardDisplay
public void print()
CLIBoardDisplay
print
in interface CLIBoardDisplay
public void print(Board board)
CLIBoardDisplay
print
in interface CLIBoardDisplay
|
Submit a bug or feature Visit the Website Internet Chess ToolKit is licensed under the GPL v2 . |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |