Package swingtree
Enum Class UI.ComponentOrientation
- All Implemented Interfaces:
Serializable,Comparable<UI.ComponentOrientation>,Constable,UIEnum<UI.ComponentOrientation>
- Enclosing class:
UI
@Immutable
public static enum UI.ComponentOrientation
extends Enum<UI.ComponentOrientation>
implements UIEnum<UI.ComponentOrientation>
Names the reading direction of a component:
See
LEFT_TO_RIGHT as in English,
RIGHT_TO_LEFT as in Arabic or Hebrew, or UNKNOWN where none was
chosen. It decides where a line of text begins, and therefore where the leading
and the trailing end of a component are, which is why
UI.HorizontalAlignment.LEADING and UI.HorizontalAlignment.TRAILING can
only be resolved against one.
See
UIForAnySwing.withStyle(Styler) and ComponentStyleDelegate.orientation(swingtree.UI.ComponentOrientation).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLines of text run from left to right, as in English.Lines of text run from right to left, as in Arabic or Hebrew.No reading direction was chosen, which SwingTree and AWT both read as left to right. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether text and components laid out under this orientation run from left to right.static UI.ComponentOrientationReturns the enum constant of this class with the specified name.static UI.ComponentOrientation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
No reading direction was chosen, which SwingTree and AWT both read as left to right. -
LEFT_TO_RIGHT
Lines of text run from left to right, as in English. -
RIGHT_TO_LEFT
Lines of text run from right to left, as in Arabic or Hebrew.
-
-
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
-
isLeftToRightOrUnknown
public boolean isLeftToRightOrUnknown()Tells whether text and components laid out under this orientation run from left to right.UNKNOWNanswerstruehere, which is the same choice AWT makes:ComponentOrientation.isLeftToRight()also answerstrueforComponentOrientation.UNKNOWN. That is why a component whose orientation was never set behaves like an English one.- Returns:
- True for
LEFT_TO_RIGHTandUNKNOWN, false forRIGHT_TO_LEFT.
-