org.kalmeo.kuix.util
Class Alignment
java.lang.Object
org.kalmeo.kuix.util.Alignment
public class Alignment
- extends java.lang.Object
- Author:
- bbeaulant
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.