de.kosi.gui
Class CConstants

java.lang.Object
  |
  +--de.kosi.gui.CConstants

public class CConstants
extends java.lang.Object

This class contains the client-wide used constants an some static conversion and other utilitiy functions.

ChangeLog:

 $Log: CConstants.java,v $
 Revision 1.5  2001/07/02 17:37:18  jiriki
 - New Implementation of SSL Authorization
 - Implemented Client-Side Persistence

 Revision 1.4  2001/06/27 19:09:18  jiriki
 Resolved minor bugs. Updated docs.

 

Version:
$Revision: 1.5 $ ($Date: 2001/07/02 17:37:18 $)
Author:
Jan-Christian Marinesse

Field Summary
static int BID_COUNT
          The number of bids.
static int BID_DOUBLE
          Indicates a double bid.
static int BID_PASS
          Indicates a pass bid.
static int BID_REDOUBLE
          Indicates a redouble bid.
static int BID_VOID
          Indicates no bid.
static int CARD_BACK
          Indicates that a card image shows the back of a card.
static int CARD_COUNT
          The number of cards.
static java.lang.String CLIENT_BUNDLE
          Name of the resource bundle for the client.
static int DIRECTION_EAST
          The direction east.
static int DIRECTION_NORTH
          The direction north.
static int DIRECTION_SOUTH
          The direction south.
static int DIRECTION_WEST
          The direction west.
static int INVALID
          A negative value.
static int ORIENTATION_BOTTOM
          The orientation bottom.
static int ORIENTATION_LEFT
          The orientation left.
static int ORIENTATION_RIGHT
          The orientation right.
static int ORIENTATION_TOP
          The orientation top.
static int SUIT_CLUBS
          The suit clubs.
static int SUIT_DIAMONDS
          The suit diamonds.
static int SUIT_HEARTS
          The suit hearts.
static int SUIT_NO_TRUMPS
          Indicates a no trump contract.
static int SUIT_SPADES
          The suit spades.
static int VALUE_10
          The card value 10.
static int VALUE_2
          The card value 2.
static int VALUE_3
          The card value 3.
static int VALUE_4
          The card value 4.
static int VALUE_5
          The card value 5.
static int VALUE_6
          The card value 6.
static int VALUE_7
          The card value 7.
static int VALUE_8
          The card value 8.
static int VALUE_9
          The card value 9.
static int VALUE_ACE
          The card honour ace.
static int VALUE_JACK
          The card honour jack.
static int VALUE_KING
          The card honour king.
static int VALUE_QUEEN
          The card honour queen.
 
Constructor Summary
CConstants()
           
 
Method Summary
static int convertBidSuit(int bidSuit)
          Performs a conversion from a given de.kosi.model.game.SuitBid suit constant to the corresponding CConstants suit.
static int convertCardSuit(int cardSuit)
          Performs a conversion from a given de.kosi.model.game.Card suit constant to the corresponding CConstants suit.
static int convertCardValue(int cardValue)
          Performs a conversion from a given de.kosi.model.game.Card card value constant to the corresponding CConstants value.
static java.lang.String directionString(int direction)
          Gets a string representing the given direction.
static boolean isUsingWebStart()
           
static int leftOf(int i)
          Gets the clockwise left of an orientation or direction.
static java.lang.String orientationString(int orientation)
          Gets a string representing the given orientation.
static int rightOf(int i)
          The counterpart of @see #leftOf.
static java.lang.String suitString(int suit)
          Gets a string representing the given suit.
static int toBidSuit(int suit)
          Performs a conversion from a given CConstants suit constant to the corresponding de.kosi.model.game.SuitBid suit.
static int toCardSuit(int suit)
          Performs a conversion from a given CConstants suit constant to the corresponding de.kosi.model.game.Card suit.
static int toCardValue(int value)
          Performs a conversion from a given CConstants card value constant to the corresponding de.kosi.model.game.Card value.
static java.lang.String valueString(int value)
          Gets a string representing the given card value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_BUNDLE

public static final java.lang.String CLIENT_BUNDLE
Name of the resource bundle for the client.

INVALID

public static final int INVALID
A negative value.

DIRECTION_NORTH

public static final int DIRECTION_NORTH
The direction north.

DIRECTION_EAST

public static final int DIRECTION_EAST
The direction east.

DIRECTION_SOUTH

public static final int DIRECTION_SOUTH
The direction south.

DIRECTION_WEST

public static final int DIRECTION_WEST
The direction west.

ORIENTATION_TOP

public static final int ORIENTATION_TOP
The orientation top.

ORIENTATION_RIGHT

public static final int ORIENTATION_RIGHT
The orientation right.

ORIENTATION_BOTTOM

public static final int ORIENTATION_BOTTOM
The orientation bottom.

ORIENTATION_LEFT

public static final int ORIENTATION_LEFT
The orientation left.

SUIT_CLUBS

public static final int SUIT_CLUBS
The suit clubs.

SUIT_DIAMONDS

public static final int SUIT_DIAMONDS
The suit diamonds.

SUIT_HEARTS

public static final int SUIT_HEARTS
The suit hearts.

SUIT_SPADES

public static final int SUIT_SPADES
The suit spades.

SUIT_NO_TRUMPS

public static final int SUIT_NO_TRUMPS
Indicates a no trump contract.

VALUE_2

public static final int VALUE_2
The card value 2.

VALUE_3

public static final int VALUE_3
The card value 3.

VALUE_4

public static final int VALUE_4
The card value 4.

VALUE_5

public static final int VALUE_5
The card value 5.

VALUE_6

public static final int VALUE_6
The card value 6.

VALUE_7

public static final int VALUE_7
The card value 7.

VALUE_8

public static final int VALUE_8
The card value 8.

VALUE_9

public static final int VALUE_9
The card value 9.

VALUE_10

public static final int VALUE_10
The card value 10.

VALUE_JACK

public static final int VALUE_JACK
The card honour jack.

VALUE_QUEEN

public static final int VALUE_QUEEN
The card honour queen.

VALUE_KING

public static final int VALUE_KING
The card honour king.

VALUE_ACE

public static final int VALUE_ACE
The card honour ace.

CARD_BACK

public static final int CARD_BACK
Indicates that a card image shows the back of a card.

CARD_COUNT

public static final int CARD_COUNT
The number of cards.

BID_DOUBLE

public static final int BID_DOUBLE
Indicates a double bid.

BID_REDOUBLE

public static final int BID_REDOUBLE
Indicates a redouble bid.

BID_PASS

public static final int BID_PASS
Indicates a pass bid.

BID_VOID

public static final int BID_VOID
Indicates no bid.

BID_COUNT

public static final int BID_COUNT
The number of bids.
Constructor Detail

CConstants

public CConstants()
Method Detail

directionString

public static java.lang.String directionString(int direction)
Gets a string representing the given direction.
Parameters:
direction - one of DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_EAST, and DIRECTION_WEST.
Returns:
a string representing the given direction.

orientationString

public static java.lang.String orientationString(int orientation)
Gets a string representing the given orientation.
Parameters:
orientation - the orientation
Returns:
one of ORIENTATION_TOP, ORIENTATION_BOTTOM, ORIENTATION_LEFT, and ORIENTATION_RIGHT.

suitString

public static java.lang.String suitString(int suit)
Gets a string representing the given suit.
Parameters:
suit - the suit
Returns:
a string representing the given suit.

valueString

public static java.lang.String valueString(int value)
Gets a string representing the given card value.
Parameters:
value - the value
Returns:
a string representing the given card value.

leftOf

public static int leftOf(int i)
Gets the clockwise left of an orientation or direction.

Two examples: leftOf(CConstants.ORIENTATION_BOTTOM) == CConstants.ORIENTATION_LEFT, leftOf(CConstants.DIRECTION_SOUTH) == CConstants.CConstants.DIRECTION_WEST are always true.

Parameters:
i - the direction.
Returns:
the direction left of the given direction.

rightOf

public static int rightOf(int i)
The counterpart of @see #leftOf.
Parameters:
i - the direction or orientation.
Returns:
The direction or orientation right of the argument.

convertCardSuit

public static int convertCardSuit(int cardSuit)
Performs a conversion from a given de.kosi.model.game.Card suit constant to the corresponding CConstants suit.
Parameters:
cardSuit - the de.kosi.model.game.Card value.
Returns:
one of CConstants.SUIT_CLUBS, CConstants.SUIT_DIAMONDS, ...

toCardSuit

public static int toCardSuit(int suit)
Performs a conversion from a given CConstants suit constant to the corresponding de.kosi.model.game.Card suit.
Parameters:
suit - the de.kosi.model.game.Card value.
Returns:
one of Card.SUIT_CLUBS, Card.SUIT_DIAMONDS, ...

convertBidSuit

public static int convertBidSuit(int bidSuit)
Performs a conversion from a given de.kosi.model.game.SuitBid suit constant to the corresponding CConstants suit.
Parameters:
bidSuit - the de.kosi.model.game.SuitBid object.
Returns:
one of CConstants.SUIT_X constants.

toBidSuit

public static int toBidSuit(int suit)
Performs a conversion from a given CConstants suit constant to the corresponding de.kosi.model.game.SuitBid suit.
Parameters:
suit - one of the CConstant.SUIT_X values.
Returns:
one of SuitBid.SUIT_CLUBS, SuitBid.SUIT_DIAMONDS, ...

convertCardValue

public static int convertCardValue(int cardValue)
Performs a conversion from a given de.kosi.model.game.Card card value constant to the corresponding CConstants value.
Parameters:
cardValue - a de.kosi.model.game.Card.VALUE_X value.
Returns:
one of CConstants.VALUE_X constants.

toCardValue

public static int toCardValue(int value)
Performs a conversion from a given CConstants card value constant to the corresponding de.kosi.model.game.Card value.
Parameters:
value - the CConstants.VALUE_X constant.
Returns:
one of Card.VALUE_2, Card.VALUE_3, ...

isUsingWebStart

public static boolean isUsingWebStart()