Class Separator

All Implemented Interfaces:
Component, TextGUIElement

public class Separator extends AbstractComponent<Separator>
Static non-interactive component that is typically rendered as a single line. Normally this component is used to separate component from each other in situations where a bordered panel isn't ideal. By default the separator will ask for a size of 1x1 so you'll need to make it bigger, either through the layout manager or by overriding the preferred size.
  • Field Details

    • direction

      private final Direction direction
  • Constructor Details

    • Separator

      public Separator(Direction direction)
      Creates a new Separator for a specific direction, which will decide whether to draw a horizontal line or a vertical line
      Parameters:
      direction - Direction of the line to draw within the separator
  • Method Details

    • getDirection

      public Direction getDirection()
      Returns the direction of the line drawn for this separator
      Returns:
      Direction of the line drawn for this separator
    • createDefaultRenderer

      protected Separator.DefaultSeparatorRenderer createDefaultRenderer()
      Description copied from class: AbstractComponent
      When you create a custom component, you need to implement this method and return a Renderer which is responsible for taking care of sizing the component, rendering it and choosing where to place the cursor (if Interactable). This value is intended to be overridden by custom themes.
      Specified by:
      createDefaultRenderer in class AbstractComponent<Separator>
      Returns:
      Renderer to use when sizing and drawing this component