Enum Class AlignmentFlag

All Implemented Interfaces:
Serializable, Comparable<AlignmentFlag>, Constable

public enum AlignmentFlag extends Enum<AlignmentFlag>
Enumeration that specifies a horizontal or a vertical alignment.

The vertical alignment flags are Baseline, Sub, Super, Top, TextTop, Middle, Bottom and TextBottom.

The horizontal alignment flags are Left, Right, Center and Justify.

When used with setVerticalAlignment(), this applies only to inline widgets and determines how to position itself on the current line, with respect to sibling inline widgets.

When used with WContainerWidget#setContentAlignment(), this determines the vertical alignment of contents within the table cell.

When used with WPainter#drawText(), this determines the horizontal and vertical alignment of the text with respect to the bounding rectangle.

When used with WContainerWidget#setContentAlignment(), this specifies how contents should be aligned horizontally within the container.

Not all values are applicable in all situations. The most commonly used values are Left, Center, Right, Bottom, Middle and Top.

  • Enum Constant Details

    • Left

      public static final AlignmentFlag Left
      Align to the left.
    • Center

      public static final AlignmentFlag Center
      Align horizontally in the center.
    • Justify

      public static final AlignmentFlag Justify
      Justify left and right.
    • Baseline

      public static final AlignmentFlag Baseline
      Align at baseline (default alignment).
    • Sub

      public static final AlignmentFlag Sub
      Align below the baseline (as if subscript).
    • Super

      public static final AlignmentFlag Super
      Align above the baseline (as if superscript).
    • Top

      public static final AlignmentFlag Top
      Align top of widget with top of tallest sibling widget.
    • TextTop

      public static final AlignmentFlag TextTop
      Align top of widget with the top of the parent widget's font.
    • Middle

      public static final AlignmentFlag Middle
      Align vertically the middle to the middle of the parent widget.
    • Bottom

      public static final AlignmentFlag Bottom
      Align bottom of widget to the bottom of the lowest sigling widget.
    • TextBottom

      public static final AlignmentFlag TextBottom
      Align bottom of widget to the bottom of parent widget's font.
  • Field Details

    • AlignHorizontalMask

      public static final EnumSet<AlignmentFlag> AlignHorizontalMask
      Combination of all horizontal alignment flags.
    • AlignVerticalMask

      public static final EnumSet<AlignmentFlag> AlignVerticalMask
      Combination of all vertical alignment flags.
  • Method Details

    • values

      public static AlignmentFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AlignmentFlag 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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Returns the numerical representation of this enum.