Package swingtree

Enum Class UI.Side

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

@Immutable public static enum UI.Side extends Enum<UI.Side> implements UIEnum<UI.Side>
Names one of the four edges of a component: TOP, LEFT, BOTTOM or RIGHT. Every JComponent is a rectangle, so those four are all there are. Pass one to UIForTabbedPane.withTabPlacementAt(swingtree.UI.Side) or to the tabbed pane factory method UIFactoryMethods.tabbedPane(swingtree.UI.Side) to say where the tabs go, or to UILayoutConstants.DOCK(swingtree.UI.Side) to dock a child component against one edge of a MigLayout panel.

An edge is a line, and axis() names the axis it runs along: the top and the bottom edge are horizontal lines, the left and the right edge vertical ones. opposite() names the edge facing this one across the component, and toPlacement() turns the edge into the point at the middle of it, for the parts of the API which place things by UI.Placement.

  • Enum Constant Details

    • TOP

      public static final UI.Side TOP
      The top edge, which is a horizontal line.
    • LEFT

      public static final UI.Side LEFT
      The left edge, which is a vertical line.
    • BOTTOM

      public static final UI.Side BOTTOM
      The bottom edge, which is a horizontal line.
  • Method Details

    • values

      public static UI.Side[] 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 UI.Side 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
    • opposite

      public UI.Side opposite()
      Returns the side facing this one across the component, which is the side to move something to when the user asks for it to sit on the other side.
      Returns:
      BOTTOM for TOP, TOP for BOTTOM, RIGHT for LEFT and LEFT for RIGHT.
    • axis

      public UI.Axis axis()
      Returns the axis the line of this edge runs along, which is also the axis a tab strip, a tool bar or a divider docked to this edge is laid out on. Tabs docked to the top sit in a row, tabs docked to the left stack downwards.
      Returns:
      UI.Axis.HORIZONTAL for TOP and BOTTOM, UI.Axis.VERTICAL for LEFT and RIGHT.
    • toPlacement

      public UI.Placement toPlacement()
      Returns the point at the middle of this side, which is how a side is handed to the parts of the API that place things by UI.Placement, such as ImageConf.placement(Placement).
      Returns:
      UI.Placement.TOP, UI.Placement.LEFT, UI.Placement.BOTTOM or UI.Placement.RIGHT.