public enum Alignment extends Enum<Alignment>
| Enum Constant and Description |
|---|
CENTER |
EAST |
NORTH |
NORTH_EAST |
NORTH_WEST |
SOUTH |
SOUTH_EAST |
SOUTH_WEST |
WEST |
| Modifier and Type | Method and Description |
|---|---|
Point |
alignInside(Dimension toAlign,
Rectangle outerBounds)
Align Rectangle inside other rectangle with respect to the alignment.
|
Point |
alignOutside(Dimension toAlign,
Rectangle innerBounds)
Align Rectangle outside other rectangle with respect to the alignment.
|
Alignment |
anticlockwise() |
boolean |
canBeAligned(Point point,
Dimension size,
Rectangle outerBounds)
Check whether the given Rectangle can be aligned at point inside boundaries.
|
Alignment |
clockwise() |
static Alignment |
getAlignment(Point point,
Dimension size,
Rectangle outerBounds,
Alignment hint)
Get fitting alignment.
|
double |
getAngle() |
int |
getIndex()
Get the index of the alignment.
|
boolean |
isEast() |
boolean |
isEast(boolean includePure) |
boolean |
isNorth() |
boolean |
isSouth() |
boolean |
isWest() |
boolean |
isWest(boolean includePure) |
Insets |
maskInsets(Insets insets) |
Insets |
maskInsets(Insets insets,
int maskValue) |
Insets |
maskInsets(int top,
int left,
int bottom,
int right,
int mask) |
Insets |
maskInsetsInverted(Insets insets) |
Insets |
maskInsetsInverted(Insets insets,
int mask) |
Insets |
maskInsetsInverted(int top,
int left,
int bottom,
int right,
int mask) |
Alignment |
opposite()
Get the opposite alignment.
|
Point |
relativePos(Dimension toAlign,
Point alignAt)
Get the relative Position of Rectangle to Point with respect to the alignment.
|
static Alignment |
valueOf(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 are declared.
|
public static final Alignment NORTH
public static final Alignment SOUTH
public static final Alignment EAST
public static final Alignment WEST
public static final Alignment NORTH_EAST
public static final Alignment NORTH_WEST
public static final Alignment SOUTH_EAST
public static final Alignment SOUTH_WEST
public static final Alignment CENTER
public static Alignment[] values()
for (Alignment c : Alignment.values()) System.out.println(c);
public static Alignment valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Alignment getAlignment(Point point, Dimension size, Rectangle outerBounds, Alignment hint)
point - point to align at.size - Size of rectangle to align.outerBounds - outer boundaries to align in.hint - preferred alignment.CENTER.public boolean canBeAligned(Point point, Dimension size, Rectangle outerBounds)
point - point to align at.size - size of rectangle to align.outerBounds - boundaries.public Point relativePos(Dimension toAlign, Point alignAt)
toAlign - size of Rectangle to align.alignAt - point to align at.public Point alignOutside(Dimension toAlign, Rectangle innerBounds)
toAlign - size of rectangle to aligninnerBounds - bounds of inside rectanglepublic int getIndex()
public Alignment opposite()
public Alignment anticlockwise()
public Alignment clockwise()
public Insets maskInsets(int top, int left, int bottom, int right, int mask)
public Insets maskInsetsInverted(int top, int left, int bottom, int right, int mask)
public Point alignInside(Dimension toAlign, Rectangle outerBounds)
toAlign - size of rectangle to alignouterBounds - bounds of outer rectanglepublic boolean isNorth()
public boolean isSouth()
public boolean isEast()
public boolean isWest()
public boolean isEast(boolean includePure)
public boolean isWest(boolean includePure)
public double getAngle()