|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.misc.Alignment
This class provides set of useful methods to calculate metrical characteristics
for a rectangular area that has vertical or horizontal alignments. The alignments
types are shown with the table below (it is supposed that the table is the rectangular
area), where the horizontal alignment is denoted with ax
, and vertical
- ay
:
ax = Alignment.LEFT ay = Alignment.TOP |
ax = Alignment.CENTER ay = Alignment.TOP |
ax = Alignment.RIGHT ay = Alignment.TOP |
ax = Alignment.LEFT ay = Alignment.CENTER |
ax = Alignment.CENTER ay = Alignment.CENTER |
ax = Alignment.RIGHT ay = Alignment.CENTER |
ax = Alignment.LEFT ay = Alignment.BOTTOM |
ax = Alignment.CENTER ay = Alignment.BOTTOM |
ax = Alignment.RIGHT ay = Alignment.BOTTOM |
Field Summary | |
static int |
BOTTOM
The bottom vertical alignment type. |
static int |
CENTER
The center horizontal or vertical alignment type. |
static int |
LEFT
The left horizontal alignment type. |
static int |
NONE
The none horizontal or vertical alignment type. |
static int |
RIGHT
The right horizontal alignment type. |
static int |
TOP
The top vertical alignment type. |
Constructor Summary | |
Alignment()
|
Method Summary | |
static java.awt.Point |
getLocation(java.awt.Dimension alignObj,
int alignX,
int alignY,
int aw,
int ah)
Calculates and returns location of the specified rectangular area that is adjusted inside the given rectangular area with the specified horizontal and vertical alignments . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static final int CENTER
public static final int NONE
Constructor Detail |
public Alignment()
Method Detail |
public static java.awt.Point getLocation(java.awt.Dimension alignObj, int alignX, int alignY, int aw, int ah)
alignObj
- the specified rectangular area to be adjusted.ax
- the specified horizontal alignment.ay
- the specified vertical alignment.aw
- the specified align area width.ah
- the specified align area height.IllegalArgumentException
if
the horizontal or vertical alignment is undefined.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |