Class Insets

java.lang.Object
tripleplay.ui.util.Insets
Direct Known Subclasses:
Insets.Mutable

public class Insets extends Object
Corresponds to the distances that some rectangular object's edges will be offset when, for example, it is contained in another rectangle.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Insets with changeable values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static Insets
    Read-only instance with zero for all edges.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Insets(float top, float right, float bottom, float left)
    Creates new insets.
  • Method Summary

    Modifier and Type
    Method
    Description
    pythagoras.f.Dimension
    addTo(pythagoras.f.Dimension size)
    Adds these insets to the supplied dimensions.
    adjust(float dtop, float dright, float dbottom, float dleft)
    Returns a new instance which is the supplied adjustments added to these insets.
    float
    Gets the bottom inset.
    float
    Returns this total adjustment to height.
    float
    Gets the left inset.
    Gets or creates a copy of these insets that can be mutated.
    float
    Gets the right inset.
    pythagoras.f.Dimension
    subtractFrom(pythagoras.f.Dimension size)
    Adds these insets from the supplied dimensions.
    static Insets
    symmetric(float horiz, float vert)
    Returns a read-only instance with left and right set to one value and top and bottom set to another.
    float
    top()
    Gets the top inset.
     
    static Insets
    uniform(float val)
    Returns a read-only instance with all edges set to the same value.
    float
    Returns the total adjustment to width.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • ZERO

      public static Insets ZERO
      Read-only instance with zero for all edges.
  • Constructor Details

    • Insets

      public Insets(float top, float right, float bottom, float left)
      Creates new insets.
  • Method Details

    • uniform

      public static Insets uniform(float val)
      Returns a read-only instance with all edges set to the same value.
    • symmetric

      public static Insets symmetric(float horiz, float vert)
      Returns a read-only instance with left and right set to one value and top and bottom set to another.
    • top

      public float top()
      Gets the top inset.
    • right

      public float right()
      Gets the right inset.
    • bottom

      public float bottom()
      Gets the bottom inset.
    • left

      public float left()
      Gets the left inset.
    • width

      public float width()
      Returns the total adjustment to width.
    • height

      public float height()
      Returns this total adjustment to height.
    • addTo

      public pythagoras.f.Dimension addTo(pythagoras.f.Dimension size)
      Adds these insets to the supplied dimensions. Returns size for chaining.
    • subtractFrom

      public pythagoras.f.Dimension subtractFrom(pythagoras.f.Dimension size)
      Adds these insets from the supplied dimensions. Returns size for chaining.
    • mutable

      public Insets.Mutable mutable()
      Gets or creates a copy of these insets that can be mutated. Note, if storing an instance, the caller is expected to assign to the return value here in case a new object is allocated.
    • adjust

      public Insets adjust(float dtop, float dright, float dbottom, float dleft)
      Returns a new instance which is the supplied adjustments added to these insets.
    • toString

      public String toString()
      Overrides:
      toString in class Object