java.lang.Object
io.github.somesourcecode.someguiapi.util.Insets

public class Insets extends Object
Represents the distance from the edges of a container to its content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Insets
    Empty insets.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Insets(int topRightBottomLeft)
    Constructs a new Insets instance with same value for all four offsets.
    Insets(int topBottom, int rightLeft)
    Constructs a new Insets instance with same value for top and bottom, and for right and left.
    Insets(int top, int right, int bottom, int left)
    Constructs a new Insets instance with four different offsets.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the bottom inset.
    int
    Returns the left inset.
    int
    Returns the right inset.
    int
    Returns the top inset.

    Methods inherited from class java.lang.Object

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

    • EMPTY

      public static final Insets EMPTY
      Empty insets. An Insets instance with all insets set to 0.
  • Constructor Details

    • Insets

      public Insets(int top, int right, int bottom, int left)
      Constructs a new Insets instance with four different offsets.
      Parameters:
      top - the top inset
      right - the right inset
      bottom - the bottom inset
      left - the left inset
    • Insets

      public Insets(int topBottom, int rightLeft)
      Constructs a new Insets instance with same value for top and bottom, and for right and left.
      Parameters:
      topBottom - the top and bottom insets
      rightLeft - the right and left insets
    • Insets

      public Insets(int topRightBottomLeft)
      Constructs a new Insets instance with same value for all four offsets.
      Parameters:
      topRightBottomLeft - the top, right, bottom, and left insets
  • Method Details

    • getTop

      public int getTop()
      Returns the top inset.
      Returns:
      the top inset
    • getRight

      public int getRight()
      Returns the right inset.
      Returns:
      the right inset
    • getBottom

      public int getBottom()
      Returns the bottom inset.
      Returns:
      the bottom inset
    • getLeft

      public int getLeft()
      Returns the left inset.
      Returns:
      the left inset
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.