thinSoft.ui
Class ChessPiece

java.lang.Object
  |
  +--thinSoft.ui.ChessPiece
All Implemented Interfaces:
java.lang.Cloneable

public class ChessPiece
extends java.lang.Object
implements java.lang.Cloneable

Represents a Component in the ChessLayout.

Each component has the following characteristics:

row/column coordinates on chessboard

number of rows/columns a piece occupies

horizontal & vertical position within row/column area

minimum height/width constraint

maximum height/width constraint

insets within the square.

See Also:
ChessLayout

Field Summary
static byte BOTTOM
          Place the component on the bottom
static byte CENTER
          Center the component horizontally or vertically
 int col
          Column position of this component
 int cols
          Number of additional columns this component occupies
 int horizontalPosition
          Horizontal position of the component
 java.awt.Insets insets
          Insets within the space (may be null)
static byte LEFT
          Place the component on the left side
 int minimumHeight
          Minimum component height
 int minimumWidth
          Minimum component width
 int preferredHeight
          Maximum component height
 int preferredWidth
          Maximum component width
static byte RIGHT
          Place the component on the right side
 int row
          Row position of this component
 int rows
          Number of additional rows this component occupies
static byte STRETCH
          Stretch the component horizontally or vertically
static byte TOP
          Place the component on the top
 int verticalPosition
          Vertical position of the component
 
Constructor Summary
ChessPiece()
          Default ChessPiece constructor.
ChessPiece(byte horizontalPosition, byte verticalPosition)
          Constructs a ChessPiece with the specified horizontal and vertical positioning.
ChessPiece(byte horizontalPosition, byte verticalPosition, int minimumWidth, int minimumHeight)
          Constructs a ChessPiece from row/column coordinates, positioning, and minimum pixel size.
ChessPiece(byte horizontalPosition, byte verticalPosition, int minimumWidth, int minimumHeight, int preferredWidth, int preferredHeight)
          Constructs a ChessPiece from vertical/horizontal position, row/column size, and minimum/preferred size.
ChessPiece(byte horizontalPosition, byte verticalPosition, int minimumWidth, int minimumHeight, int preferredWidth, int preferredHeight, java.awt.Insets insets)
          Constructs a ChessPiece from vertical/horizontal position, row/column size, and minimum/preferred size and Insets.
 
Method Summary
 java.lang.Object clone()
          Clones the object.
 java.lang.String toString()
          Expresses a ChessPiece as a String.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CENTER

public static final byte CENTER
Center the component horizontally or vertically

STRETCH

public static final byte STRETCH
Stretch the component horizontally or vertically

LEFT

public static final byte LEFT
Place the component on the left side

RIGHT

public static final byte RIGHT
Place the component on the right side

TOP

public static final byte TOP
Place the component on the top

BOTTOM

public static final byte BOTTOM
Place the component on the bottom

row

public int row
Row position of this component

col

public int col
Column position of this component

rows

public int rows
Number of additional rows this component occupies

cols

public int cols
Number of additional columns this component occupies

horizontalPosition

public int horizontalPosition
Horizontal position of the component

verticalPosition

public int verticalPosition
Vertical position of the component

minimumWidth

public int minimumWidth
Minimum component width

minimumHeight

public int minimumHeight
Minimum component height

preferredWidth

public int preferredWidth
Maximum component width

preferredHeight

public int preferredHeight
Maximum component height

insets

public java.awt.Insets insets
Insets within the space (may be null)
Constructor Detail

ChessPiece

public ChessPiece()
Default ChessPiece constructor.

ChessPiece

public ChessPiece(byte horizontalPosition,
                  byte verticalPosition)
Constructs a ChessPiece with the specified horizontal and vertical positioning.
Parameters:
horizontalPosition - LEFT/CENTER/RIGHT/STRETCH position.
verticalPosition - TOP/CENTER/BOTTOM/STRETCH position.

ChessPiece

public ChessPiece(byte horizontalPosition,
                  byte verticalPosition,
                  int minimumWidth,
                  int minimumHeight)
Constructs a ChessPiece from row/column coordinates, positioning, and minimum pixel size.
Parameters:
horizontalPosition - LEFT/CENTER/RIGHT/STRETCH position.
verticalPosition - TOP/CENTER/BOTTOM/STRETCH position.
minimumWidth - minimum component width.
minimumHeight - minimum component height.

ChessPiece

public ChessPiece(byte horizontalPosition,
                  byte verticalPosition,
                  int minimumWidth,
                  int minimumHeight,
                  int preferredWidth,
                  int preferredHeight)
Constructs a ChessPiece from vertical/horizontal position, row/column size, and minimum/preferred size.
Parameters:
horizontalPosition - LEFT/CENTER/RIGHT/STRETCH position.
verticalPosition - TOP/CENTER/BOTTOM/STRETCH position.
minimumWidth - minimum component width.
minimumHeight - minimum component height.
preferredWidth - Preferred component width.
preferredHeight - Preferred component height.

ChessPiece

public ChessPiece(byte horizontalPosition,
                  byte verticalPosition,
                  int minimumWidth,
                  int minimumHeight,
                  int preferredWidth,
                  int preferredHeight,
                  java.awt.Insets insets)
Constructs a ChessPiece from vertical/horizontal position, row/column size, and minimum/preferred size and Insets.
Parameters:
horizontalPosition - LEFT/CENTER/RIGHT/STRETCH position.
verticalPosition - TOP/CENTER/BOTTOM/STRETCH position.
minimumWidth - minimum component width.
minimumHeight - minimum component height.
preferredWidth - Preferred component width.
preferredHeight - Preferred component height.
insets - component insets.
Method Detail

clone

public java.lang.Object clone()
Clones the object.
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Expresses a ChessPiece as a String.
Overrides:
toString in class java.lang.Object