org.kalmeo.kuix.util
Class Alignment

java.lang.Object
  extended by org.kalmeo.kuix.util.Alignment

public class Alignment
extends java.lang.Object

Author:
bbeaulant

Field Summary
static Alignment BOTTOM
           
static Alignment BOTTOM_LEFT
           
static Alignment BOTTOM_RIGHT
           
static Alignment CENTER
           
static Alignment FILL
           
static Alignment FILL_BOTTOM
           
static Alignment FILL_CENTER
           
static Alignment FILL_LEFT
           
static Alignment FILL_RIGHT
           
static Alignment FILL_TOP
           
static Alignment LEFT
           
static Alignment RIGHT
           
static Alignment TOP
           
static Alignment TOP_LEFT
           
static Alignment TOP_RIGHT
           
 byte value
           
 
Method Summary
 int alignX(int width, int contentWidth)
          Calculte the aligned x coordiante from contentWidth in width
 int alignY(int height, int contentHeight)
          Calculte the aligned y coordiante from contentWidth in height
static Alignment combine(Alignment verticalAlignment, Alignment horizontalAlignment)
          Combine verticalAlignment and horizontalAlignment into a new Alignment instance.
 boolean isBottom()
           
 boolean isFill()
           
 boolean isHorizontalCenter()
           
 boolean isLeft()
           
 boolean isRight()
           
 boolean isTop()
           
 boolean isVerticalCenter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_LEFT

public static final Alignment TOP_LEFT

TOP

public static final Alignment TOP

TOP_RIGHT

public static final Alignment TOP_RIGHT

LEFT

public static final Alignment LEFT

CENTER

public static final Alignment CENTER

RIGHT

public static final Alignment RIGHT

BOTTOM_LEFT

public static final Alignment BOTTOM_LEFT

BOTTOM

public static final Alignment BOTTOM

BOTTOM_RIGHT

public static final Alignment BOTTOM_RIGHT

FILL

public static final Alignment FILL

FILL_TOP

public static final Alignment FILL_TOP

FILL_LEFT

public static final Alignment FILL_LEFT

FILL_CENTER

public static final Alignment FILL_CENTER

FILL_RIGHT

public static final Alignment FILL_RIGHT

FILL_BOTTOM

public static final Alignment FILL_BOTTOM

value

public byte value
Method Detail

isTop

public boolean isTop()
Returns:
true if the alignment contains a top constraint

isBottom

public boolean isBottom()
Returns:
true if the alignment contains a bottom constraint

isLeft

public boolean isLeft()
Returns:
true if the alignment contains a left constraint

isRight

public boolean isRight()
Returns:
true if the alignment contains a right constraint

isHorizontalCenter

public boolean isHorizontalCenter()
Returns:
true if the alignment contains an horizontal center constraint

isVerticalCenter

public boolean isVerticalCenter()
Returns:
true if the alignment contains an horizontal center constraint

isFill

public boolean isFill()
Returns:
true if the alignment contains a fill constraint

alignX

public int alignX(int width,
                  int contentWidth)
Calculte the aligned x coordiante from contentWidth in width

Parameters:
width -
contentWidth -
Returns:
The aligned x coordiante from contentWidth in width

alignY

public int alignY(int height,
                  int contentHeight)
Calculte the aligned y coordiante from contentWidth in height

Parameters:
height -
contentHeight -
Returns:
The aligned y coordiante from contentHeight in height

combine

public static Alignment combine(Alignment verticalAlignment,
                                Alignment horizontalAlignment)
Combine verticalAlignment and horizontalAlignment into a new Alignment instance.

Parameters:
alignment1 -
alignment2 -
Returns:
a new combined alignment instance.


Copyright © 2007-2008 Kalmeo. All Rights Reserved.