- 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 BOTTOMthe component will be located at the bottom and horizontally centered.BOTTOM_LEFTthe component will be located at the right and vertically centered.BOTTOM_RIGHTthe component will be located at the right and vertically centered.CENTERthe component will be horizontally and vertically centered.LEFTthe component will be located at the left and vertically centered.RIGHTthe component will be located at the right and vertically centered.TOPthe component will be located at the top and horizontally centered.TOP_LEFTthe component will be located at the right and vertically centered.TOP_RIGHTthe 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 AlignmentfromDirection(Direction direction)This is the inverse operation fortoDirection().static AlignmentfromValue(String value)HorizontalAlignmentgetHorizontalAlignment()This method gets the horizontal part of the alignment.abstract AlignmentgetMirrored()This method gets the inverse alignment.AlignmentgetPart(Orientation orientation)This method extracts thehorizontalorverticalpart of this alignment.StringgetValue()VerticalAlignmentgetVerticalAlignment()This method gets the vertical part of the alignment.DirectiontoDirection()StringtoString()static AlignmentvalueOf(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.
-
getHorizontalAlignment
public HorizontalAlignment getHorizontalAlignment()
This method gets the horizontal part of the alignment.- Returns:
- the
HorizontalAlignment.
-
getVerticalAlignment
public VerticalAlignment getVerticalAlignment()
This method gets the vertical part of the alignment.- Returns:
- the
VerticalAlignment.
-
getPart
public Alignment getPart(Orientation orientation)
This method extracts thehorizontalorverticalpart of this alignment.- Parameters:
orientation- is theOrientationof the requested part.- Returns:
getHorizontalAlignment()if orientation isOrientation.HORIZONTAL,getVerticalAlignment()otherwise.
-
getMirrored
public abstract Alignment getMirrored()
This method gets the inverse alignment.- Returns:
- the inverse alignment. E.g.
BOTTOM_RIGHTforTOP_LEFT. Returns itself ifCENTER.
-
toDirection
public Direction toDirection()
-
-