java.lang.Object
io.github.cottonmc.cotton.gui.widget.data.Insets

public final class Insets extends Object
The layout insets of a panel. The insets describe how many pixels should be around the panel's contents. For example, root panels have 7 pixels around their contents, and that is set via ROOT_PANEL.
Since:
4.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The bottom (+Y) inset size.
    int
    The left (-X) inset size.
    static Insets
    Empty layout insets that do not provide any borders around content.
    int
    The right (+X) inset size.
    static Insets
    The default insets of a root panel, providing 7 pixels around the content on all sides.
    int
    The top (-Y) inset size.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Insets​(int size)
    Constructs layout insets.
    Insets​(int vertical, int horizontal)
    Constructs layout insets.
    Insets​(int top, int left, int bottom, int right)
    Constructs layout insets.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals​(Object o)
     
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NONE

      public static final Insets NONE
      Empty layout insets that do not provide any borders around content.
    • ROOT_PANEL

      public static final Insets ROOT_PANEL
      The default insets of a root panel, providing 7 pixels around the content on all sides.
    • top

      public final int top
      The top (-Y) inset size.
    • left

      public final int left
      The left (-X) inset size.
    • bottom

      public final int bottom
      The bottom (+Y) inset size.
  • Constructor Details

    • Insets

      public Insets(int top, int left, int bottom, int right)
      Constructs layout insets.
      Parameters:
      top - the top (-Y) inset size
      left - the left (-X) inset size
      bottom - the bottom (+Y) inset size
      right - the right (+X) inset size
    • Insets

      public Insets(int vertical, int horizontal)
      Constructs layout insets.
      Parameters:
      vertical - the vertical (Y) size of the insets
      horizontal - the horizontal (X) size of the insets
    • Insets

      public Insets(int size)
      Constructs layout insets.
      Parameters:
      size - the size of the insets on all sides
  • Method Details