Package swingtree
Enum Class UI.VerticalAlignment
- All Implemented Interfaces:
Serializable,Comparable<UI.VerticalAlignment>,Constable,UIEnum<UI.VerticalAlignment>
- Enclosing class:
UI
@Immutable
public static enum UI.VerticalAlignment
extends Enum<UI.VerticalAlignment>
implements UIEnum<UI.VerticalAlignment>
Names where something sits on the vertical axis of a component: at the
TOP,
in the CENTER, or at the BOTTOM. UNDEFINED names no
position, and passing it leaves the vertical alignment of the component untouched.
This is one half of a UI.Placement, which is a whole point of a component:
UI.Placement.vertical() reads this half back out of such a point, and
UI.Placement.of(VerticalAlignment, HorizontalAlignment) builds a point from
this half and a UI.HorizontalAlignment.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionforSwing()Returns the number Swing uses for this position, which is what methods likeJLabel.setVerticalAlignment(int)take.static UI.VerticalAlignmentReturns the enum constant of this class with the specified name.static UI.VerticalAlignment[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNDEFINED
No position, which leaves the vertical alignment of the component as it was. -
TOP
At the top of the component. -
CENTER
Halfway between the top and the bottom of the component. -
BOTTOM
At the bottom of the component.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
forSwing
Returns the number Swing uses for this position, which is what methods likeJLabel.setVerticalAlignment(int)take.- Returns:
SwingConstants.TOP,SwingConstants.CENTERorSwingConstants.BOTTOM, and an emptyOptionalforUNDEFINED, which names no position to hand to Swing.
-