com.editev.chess.printer
Class StyleSheetPrinter

java.lang.Object
  |
  +--com.editev.chess.Chess
        |
        +--com.editev.chess.printer.Printer
              |
              +--com.editev.chess.printer.StyleSheetPrinter

public class StyleSheetPrinter
extends Printer

Prints a style sheet, if necessary.

See Also:
the source here.

Inner classes inherited from class com.editev.chess.Chess
Chess.Black, Chess.White
 
Field Summary
static java.lang.String BLACK_PIECE
          Color of a black piece.
static java.lang.String BLACK_SQUARE
          Color of a black square.
private static java.lang.String CAPTURE_STYLE_TEMPLATE
          A template for CSS styles for captured pieces..
static java.lang.String HEADER
          Information that needs to appear in the header of the HTML document, including CSS style sheets and Javascript.
static java.lang.String HISTORY_STYLE
           
static java.lang.String HISTORY_STYLE_NAME
           
private static java.lang.String STYLE_TEMPLATE
          A template for CSS styles for squares and pieces.
static java.lang.String WHITE_PIECE
          Color of a white piece.
static java.lang.String WHITE_SQUARE
          Color of a white square.
 
Fields inherited from class com.editev.chess.Chess
BLACK, NO_MOVE, NO_PIECE, WHITE
 
Constructor Summary
StyleSheetPrinter()
           
 
Method Summary
static java.lang.String captureStyleName(boolean isWhitePiece)
          The name of a style for a captured piece.
static java.lang.String getCaptureCSSDefinition(boolean isWhitePiece)
          Get the CSS style definition for captured pieces.
static java.lang.String getCSSDefinition(boolean isWhitePiece, boolean isWhiteSquare)
          Get the CSS style definition for this piece and square color.
private static java.lang.String pieceColor(boolean isWhite)
          The color of a piece.
 void print(GameHTML game)
          Print to an instance of GameHTML.
private static java.lang.String squareColor(boolean isWhite)
          The color of a square.
static java.lang.String styleName(boolean isWhitePiece, boolean isWhiteSquare)
          The name of a style for a given square and piece color.
 
Methods inherited from class com.editev.chess.printer.Printer
eval
 
Methods inherited from class com.editev.chess.Chess
notColor, toColor, toColor, toColorName
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

BLACK_PIECE

public static final java.lang.String BLACK_PIECE
Color of a black piece.

BLACK_SQUARE

public static final java.lang.String BLACK_SQUARE
Color of a black square.

WHITE_PIECE

public static final java.lang.String WHITE_PIECE
Color of a white piece.

WHITE_SQUARE

public static final java.lang.String WHITE_SQUARE
Color of a white square.

STYLE_TEMPLATE

private static java.lang.String STYLE_TEMPLATE
A template for CSS styles for squares and pieces.

CAPTURE_STYLE_TEMPLATE

private static java.lang.String CAPTURE_STYLE_TEMPLATE
A template for CSS styles for captured pieces..

HISTORY_STYLE_NAME

public static final java.lang.String HISTORY_STYLE_NAME

HISTORY_STYLE

public static final java.lang.String HISTORY_STYLE

HEADER

public static final java.lang.String HEADER
Information that needs to appear in the header of the HTML document, including CSS style sheets and Javascript.
Constructor Detail

StyleSheetPrinter

public StyleSheetPrinter()
Method Detail

pieceColor

private static java.lang.String pieceColor(boolean isWhite)
The color of a piece.
Parameters:
isWhite - is the piece white or black?
Returns:
the color of a piece.

squareColor

private static java.lang.String squareColor(boolean isWhite)
The color of a square.
Parameters:
isWhite - is the square white or black?
Returns:
the color of a square.

styleName

public static java.lang.String styleName(boolean isWhitePiece,
                                         boolean isWhiteSquare)
The name of a style for a given square and piece color.
Returns:
name of the style representing that piece and square color.

captureStyleName

public static java.lang.String captureStyleName(boolean isWhitePiece)
The name of a style for a captured piece.
Returns:
name of the style representing that piece and square color.

getCSSDefinition

public static java.lang.String getCSSDefinition(boolean isWhitePiece,
                                                boolean isWhiteSquare)
Get the CSS style definition for this piece and square color.
Returns:
the style definition for the CSS style sheet.

getCaptureCSSDefinition

public static java.lang.String getCaptureCSSDefinition(boolean isWhitePiece)
Get the CSS style definition for captured pieces.
Returns:
the style definition for captured pieces.

print

public void print(GameHTML game)
Description copied from class: Printer
Print to an instance of GameHTML.
Overrides:
print in class Printer
Tags copied from class: Printer
Parameters:
gameHTML - The GameHTML, which can also be