Enum Class Justify

java.lang.Object
java.lang.Enum<Justify>
com.github.tommyettinger.textra.Justify
All Implemented Interfaces:
Serializable, Comparable<Justify>, Constable

public enum Justify extends Enum<Justify>
Determines line justification behavior in a Layout. Besides 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.
  • Enum Constant Details

    • NONE

      public static final Justify NONE
      No justification will be applied; the x-advances of glyphs will not be changed.
    • SPACES_ON_ALL_LINES

      public static final Justify 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

      public static final Justify 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

      public static final Justify 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

      public static final Justify 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

      public static Justify[] 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

      public static Justify valueOf(String name)
      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 name
      NullPointerException - if the argument is null