de.matthiasmann.twl
Enum Alignment

java.lang.Object
  extended by java.lang.Enum<Alignment>
      extended by de.matthiasmann.twl.Alignment
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Alignment>

public enum Alignment
extends java.lang.Enum<Alignment>


Enum Constant Summary
BOTTOM
           
BOTTOMLEFT
           
BOTTOMRIGHT
           
CENTER
           
FILL
           
LEFT
           
RIGHT
           
TOP
           
TOPLEFT
           
TOPRIGHT
           
 
Method Summary
 int computePositionX(int containerWidth, int objectWidth)
           
 int computePositionY(int containerHeight, int objectHeight)
           
 HAlignment getFontHAlignment()
           
 int getHPosition()
          Returns the horizontal position for this alignment.
 int getVPosition()
          Returns the vertical position for this alignment.
static Alignment valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Alignment[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LEFT

public static final Alignment LEFT

CENTER

public static final Alignment CENTER

RIGHT

public static final Alignment RIGHT

TOP

public static final Alignment TOP

BOTTOM

public static final Alignment BOTTOM

TOPLEFT

public static final Alignment TOPLEFT

TOPRIGHT

public static final Alignment TOPRIGHT

BOTTOMLEFT

public static final Alignment BOTTOMLEFT

BOTTOMRIGHT

public static final Alignment BOTTOMRIGHT

FILL

public static final Alignment FILL
Method Detail

values

public static final Alignment[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Alignment c : Alignment.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Alignment valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getFontHAlignment

public HAlignment getFontHAlignment()

getHPosition

public int getHPosition()
Returns the horizontal position for this alignment.

Returns:
0 for left, 1 for center and 2 for right

getVPosition

public int getVPosition()
Returns the vertical position for this alignment.

Returns:
0 for top, 1 for center and 2 for bottom

computePositionX

public int computePositionX(int containerWidth,
                            int objectWidth)

computePositionY

public int computePositionY(int containerHeight,
                            int objectHeight)