ch.aplu.jcardgame
Class ColumnLayout

java.lang.Object
  extended by ch.aplu.jcardgame.HandLayout
      extended by ch.aplu.jcardgame.ColumnLayout

public class ColumnLayout
extends HandLayout

Class to store the column layout options for a hand. Displays the cards in a column with given maximal height. If stepDelay > 0, the spread out is animated and blocks until the final position is reached. The cards are drawn one on top others with the current card list order. If the column height is equal or less than the card height, the hand shows like stacked, but uses more memory than a when StackLayout is used.

For negative columnHeight, the vertical card distance is fixed to the absolute value of this parameter. This is useful to align lines of cards.


Constructor Summary
ColumnLayout(Location handLocation, int columnHeight)
          Same as ColumnLayout(handLocation, columnHeight, rotationAngle) with rotationAngle = 0.
ColumnLayout(Location handLocation, int columnHeight, double rotationAngle)
          Creates a ColumnLayout instance with given hand location, maximum column height and rotation angle.
 
Method Summary
 ColumnLayout clone()
          Creates a new ColumnLayout instance with same options.
 Hand.CardAlignment getCardAlignment()
          Returns the current card alignment
 int getColumnHeight()
          Returns the current column height.
 double getRotationAngle()
          Returns the current rotation angle.
 int getStepDelay()
          Returns the current step delay.
 void setCardAlignment(Hand.CardAlignment cardAlignment)
          Sets the current card alignment to the given alignment.
 void setColumnHeight(int columnHeight)
          Sets the current column height to the given height.
 void setRotationAngle(double rotationAngle)
          Sets the current rotation angle to the given angle.
 void setStepDelay(int stepDelay)
          Sets the current step delay to the given delay (in ms).
 
Methods inherited from class ch.aplu.jcardgame.HandLayout
getHandLocation, getScaleFactor, setHandLocation, setScaleFactor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnLayout

public ColumnLayout(Location handLocation,
                    int columnHeight)
Same as ColumnLayout(handLocation, columnHeight, rotationAngle) with rotationAngle = 0. Defaults:
scaleFactor = 1
rotationAngle = 0
stepDelay = 0
cardAlignment = Hand.CardAlignment.MIDDLE

Parameters:
handLocation - the location of the first, last or middle card, depending on the card alignment.
columnHeight - the height of the column

ColumnLayout

public ColumnLayout(Location handLocation,
                    int columnHeight,
                    double rotationAngle)
Creates a ColumnLayout instance with given hand location, maximum column height and rotation angle. For negative columnHeight, the vertical card distance is fixed to the absolute value of this parameter. This is useful to align lines of cards.
Defaults:
scaleFactor = 1
stepDelay = 0
cardAlignment = Hand.CardAlignment.MIDDLE

Parameters:
handLocation - the location of the first, last or middle card, depending on the card alignment.
columnHeight - the height of the column
rotationAngle - the rotion angle (in degrees, clockwise, zero to east)
Method Detail

clone

public ColumnLayout clone()
Creates a new ColumnLayout instance with same options.

Overrides:
clone in class java.lang.Object
Returns:
the new instance with same options

getColumnHeight

public int getColumnHeight()
Returns the current column height.

Returns:
the column height

getRotationAngle

public double getRotationAngle()
Returns the current rotation angle.

Returns:
the rotation angle (in degrees, clockwise)

getStepDelay

public int getStepDelay()
Returns the current step delay. If zero, no animation.

Returns:
the step delay (in ms)

getCardAlignment

public Hand.CardAlignment getCardAlignment()
Returns the current card alignment

Returns:
the card alignment

setColumnHeight

public void setColumnHeight(int columnHeight)
Sets the current column height to the given height. For negative columnHeight, the vertical card distance is fixed to the absolute value of this parameter. This is useful to align lines of cards.

Parameters:
columnHeight - the new current column height

setRotationAngle

public void setRotationAngle(double rotationAngle)
Sets the current rotation angle to the given angle.

Parameters:
rotationAngle - the new current rotation angle (in degrees, clockwise)

setStepDelay

public void setStepDelay(int stepDelay)
Sets the current step delay to the given delay (in ms).

Parameters:
stepDelay - the new current step delay

setCardAlignment

public void setCardAlignment(Hand.CardAlignment cardAlignment)
Sets the current card alignment to the given alignment.

Parameters:
cardAlignment - the new current card alignment