- java.lang.Object
-
- java.lang.Enum<Alignment>
-
- io.github.mmm.base.placement.Alignment
-
- All Implemented Interfaces:
Serializable
,Comparable<Alignment>
public enum Alignment extends Enum<Alignment>
This enum contains the available values for the alignment of an object.- See Also:
HorizontalAlignment
,VerticalAlignment
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOTTOM
the component will be located at the bottom and horizontally centered.BOTTOM_LEFT
the component will be located at the right and vertically centered.BOTTOM_RIGHT
the component will be located at the right and vertically centered.CENTER
the component will be horizontally and vertically centered.LEFT
the component will be located at the left and vertically centered.RIGHT
the component will be located at the right and vertically centered.TOP
the component will be located at the top and horizontally centered.TOP_LEFT
the component will be located at the right and vertically centered.TOP_RIGHT
the component will be located at the right and vertically centered.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Alignment
fromDirection(Direction direction)
This is the inverse operation fortoDirection()
.static Alignment
fromValue(String value)
abstract Alignment
getMirrored()
This method gets the inverse alignment.String
getValue()
Alignment
toAlignment(Orientation orientation)
This method extracts thehorizontal
orvertical
part of this alignment.Direction
toDirection()
HorizontalAlignment
toHorizontalAlignment()
This method gets the horizontal part of the alignment.String
toString()
VerticalAlignment
toVerticalAlignment()
This method gets the vertical part of 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.
-
-
-
Enum Constant Detail
-
CENTER
public static final Alignment CENTER
the component will be horizontally and vertically centered.
...
.X.
...
-
TOP
public static final Alignment TOP
the component will be located at the top and horizontally centered.
.X.
...
...
-
BOTTOM
public static final Alignment BOTTOM
the component will be located at the bottom and horizontally centered.
...
...
.X.
-
LEFT
public static final Alignment LEFT
the component will be located at the left and vertically centered.
...
X..
...
-
RIGHT
public static final Alignment RIGHT
the component will be located at the right and vertically centered.
...
..X
...
-
TOP_LEFT
public static final Alignment TOP_LEFT
the component will be located at the right and vertically centered.
X..
...
...
-
TOP_RIGHT
public static final Alignment TOP_RIGHT
the component will be located at the right and vertically centered.
..X
...
...
-
BOTTOM_LEFT
public static final Alignment BOTTOM_LEFT
the component will be located at the right and vertically centered.
...
...
X..
-
BOTTOM_RIGHT
public static final Alignment BOTTOM_RIGHT
the component will be located at the right and vertically centered.
...
...
..X
-
-
Method Detail
-
values
public static Alignment[] values()
Returns an array containing the constants of this enum type, in the order they are 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 are declared
-
valueOf
public static Alignment valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public String getValue()
- Returns:
- the ascii symbol.
-
toHorizontalAlignment
public HorizontalAlignment toHorizontalAlignment()
This method gets the horizontal part of the alignment.- Returns:
- the
HorizontalAlignment
.
-
toVerticalAlignment
public VerticalAlignment toVerticalAlignment()
This method gets the vertical part of the alignment.- Returns:
- the
VerticalAlignment
.
-
toAlignment
public Alignment toAlignment(Orientation orientation)
This method extracts thehorizontal
orvertical
part of this alignment.- Parameters:
orientation
- is theOrientation
of the requested part.- Returns:
- the
Alignment
fromtoHorizontalAlignment()
if orientation isOrientation.HORIZONTAL
, ortoVerticalAlignment()
otherwise.
-
getMirrored
public abstract Alignment getMirrored()
This method gets the inverse alignment.- Returns:
- the inverse alignment. E.g.
BOTTOM_RIGHT
forTOP_LEFT
. Returns itself ifCENTER
.
-
toDirection
public Direction toDirection()
-
-