Package swingtree

Enum Class UI.HorizontalAlignment

java.lang.Object
java.lang.Enum<UI.HorizontalAlignment>
swingtree.UI.HorizontalAlignment
All Implemented Interfaces:
Serializable, Comparable<UI.HorizontalAlignment>, Constable, UIEnum<UI.HorizontalAlignment>
Enclosing class:
UI

@Immutable public static enum UI.HorizontalAlignment extends Enum<UI.HorizontalAlignment> implements UIEnum<UI.HorizontalAlignment>
Names where something sits on the horizontal axis of a component: at the LEFT, in the CENTER, at the RIGHT, or at the LEADING or TRAILING end of a line of text. UNDEFINED names no position, and passing it leaves the horizontal alignment of the component untouched.

LEADING and TRAILING are the two constants which are not sides. They mean "where a line of text begins" and "where it ends", which is the left and the right in English, and the right and the left in Arabic or Hebrew. Swing answers that question from the ComponentOrientation of the component the alignment is applied to, so a component aligned this way follows the reading direction it ends up in.

This is one half of a UI.Placement, which is a whole point of a component. A point has already been placed, so UI.Placement.horizontal() never answers with LEADING or TRAILING; building a point out of either of them through UI.Placement.of(VerticalAlignment, HorizontalAlignment, ComponentOrientation) is where the reading direction is read exactly once.

See Also: