Package swingtree

Enum Class UI.Placement

All Implemented Interfaces:
Serializable, Comparable<UI.Placement>, Constable, UIEnum<UI.Placement>
Enclosing class:
UI

@Immutable public static enum UI.Placement extends Enum<UI.Placement> implements UIEnum<UI.Placement>
Names a point of a rectangular component: one of its four corners, the middle of one of its four sides, or its center. Use it to place an image or a text as part of the ImageConf and TextConf styles, and to align the contents of a label through UIForLabel.withAlignment(Placement).

UNDEFINED names no point at all, which leaves the choice to whoever does the placing: an image style falls back to the preferred placement of an SvgIcon, and to CENTER where there is none.

A placement is a point which has already been chosen, so this enum names no reading direction: it has no leading and no trailing constant. of(VerticalAlignment, HorizontalAlignment, ComponentOrientation) accepts UI.HorizontalAlignment.LEADING and UI.HorizontalAlignment.TRAILING and resolves them against an orientation, but horizontal() never answers with either of them. To align a component along the reading direction rather than at a fixed side, pass those two constants to UIForLabel.withHorizontalAlignment(UI.HorizontalAlignment) instead.

See Also:
  • Enum Constant Details

    • UNDEFINED

      public static final UI.Placement UNDEFINED
      No point at all, which leaves the choice of one to whoever does the placing.
    • TOP

      public static final UI.Placement TOP
      The middle of the top edge, so at the top and horizontally centred.
    • LEFT

      public static final UI.Placement LEFT
      The middle of the left edge, so at the left and vertically centred.
    • BOTTOM

      public static final UI.Placement BOTTOM
      The middle of the bottom edge, so at the bottom and horizontally centred.
    • TOP_LEFT

      public static final UI.Placement TOP_LEFT
      The top left corner.
    • TOP_RIGHT

      public static final UI.Placement TOP_RIGHT
      The top right corner.
    • BOTTOM_LEFT

      public static final UI.Placement BOTTOM_LEFT
      The bottom left corner.
    • BOTTOM_RIGHT

      public static final UI.Placement BOTTOM_RIGHT
      The bottom right corner.
    • CENTER

      public static final UI.Placement CENTER
      The middle of the component, on both axes.
  • Method Details