Package com.github.tommyettinger.textra
Enum Class Justify
- All Implemented Interfaces:
Serializable
,Comparable<Justify>
,Constable
Determines line justification behavior in a Layout.
Besides
The simplest behavior is that of
The other constants cause Lines to justify only spaces.
NONE
, which makes no changes, each constant applies justification to some glyphs on a typical
Line
.
The simplest behavior is that of
FULL_ON_ALL_LINES
; it adds extra space to every glyph so the text fills
all the way to the right edge. FULL_ON_PARAGRAPH
acts the same except on the last Line (or only Line)
of a paragraph; it will not justify the last line at all.
The other constants cause Lines to justify only spaces.
SPACES_ON_ALL_LINES
and SPACES_ON_PARAGRAPH
only increase the width of the ASCII space character ' '
, or decimal 32, hex 0020, and so on. "ALL_LINES"
affects all Lines, while "PARAGRAPH" doesn't affect the last (or only) Line.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAdds extra x-advance to every glyph so the text fills all the way to the right edge.Adds extra space to every glyph so the text fills all the way to the right edge, except for the last Line (or only Line) of a paragraph.No justification will be applied; the x-advances of glyphs will not be changed.Adds extra x-advance to every space (the char' '
) so the text fills all the way to the right edge.Adds extra x-advance to every space (the char' '
) so the text fills all the way to the right edge, except for the last Line (or only Line) of a paragraph. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
final boolean
final boolean
-
Method Summary
-
Enum Constant Details
-
NONE
No justification will be applied; the x-advances of glyphs will not be changed. -
SPACES_ON_ALL_LINES
Adds extra x-advance to every space (the char' '
) so the text fills all the way to the right edge. -
FULL_ON_ALL_LINES
Adds extra x-advance to every glyph so the text fills all the way to the right edge. -
SPACES_ON_PARAGRAPH
Adds extra x-advance to every space (the char' '
) so the text fills all the way to the right edge, except for the last Line (or only Line) of a paragraph. -
FULL_ON_PARAGRAPH
Adds extra space to every glyph so the text fills all the way to the right edge, except for the last Line (or only Line) of a paragraph.
-
-
Field Details
-
ignoreLastLine
public final boolean ignoreLastLine -
affectSpaces
public final boolean affectSpaces -
affectAllGlyphs
public final boolean affectAllGlyphs
-
-
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
-