Class EmptySpace

All Implemented Interfaces:
Component, TextGUIElement
Direct Known Subclasses:
GUIBackdrop

public class EmptySpace extends AbstractComponent<EmptySpace>
Simple component which draws a solid color over its area. The size this component will request is specified through it's constructor.
  • Field Details

  • Constructor Details

    • EmptySpace

      public EmptySpace()
      Creates an EmptySpace with size 1x1 and a default color chosen from the theme
    • EmptySpace

      public EmptySpace(TextColor color)
      Creates an EmptySpace with a specified color and preferred size of 1x1
      Parameters:
      color - Color to use (null will make it use the theme)
    • EmptySpace

      public EmptySpace(TerminalSize size)
      Creates an EmptySpace with a specified preferred size (color will be chosen from the theme)
      Parameters:
      size - Preferred size
    • EmptySpace

      public EmptySpace(TextColor color, TerminalSize size)
      Creates an EmptySpace with a specified color (null will make it use a color from the theme) and preferred size
      Parameters:
      color - Color to use (null will make it use the theme)
      size - Preferred size
  • Method Details

    • setColor

      public void setColor(TextColor color)
      Changes the color this component will use when drawn
      Parameters:
      color - New color to draw the component with, if null then the component will use the theme's default color
    • getColor

      public TextColor getColor()
      Returns the color this component is drawn with, or null if this component uses whatever the default color the theme is set to use
      Returns:
      Color used when drawing or null if it's using the theme
    • createDefaultRenderer

      protected ComponentRenderer<EmptySpace> 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<EmptySpace>
      Returns:
      Renderer to use when sizing and drawing this component