Package snap.geom

Class Insets

java.lang.Object
snap.geom.Insets
All Implemented Interfaces:
Cloneable

public class Insets extends Object implements Cloneable
This class represents a margin inset.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    static final Insets
     
    double
     
    double
     
    double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Insets(double aVal)
    Create new Insets.
    Insets(double aTop, double aRight, double aBottom, double aLeft)
    Create new Insets.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Insets
    add(Insets aIns1, double aTop, double aRight, double aBottom, double aLeft)
    Adds two insets together.
    static Insets
    add(Insets aIns1, Insets aIns2)
    Adds two insets together.
    Returns a copy of this gradient paint.
    boolean
    Standard equals method.
    static Insets
    get(String aString)
    Returns an Insets instance from given string.
    double
    Returns the bottom margin.
    double
    Returns the height of the insets (top + bottom).
    double
    Returns the left margin.
    double
    Returns the right margin.
    Returns a string representation of this Insets.
    Returns a string representation of this Insets.
    double
    Returns the top margin.
    double
    Returns the width of the insets (left + right).
    int
    Standard hashCode method.
    boolean
    Returns whether insets are empty.
    Standard toString implementation.

    Methods inherited from class java.lang.Object

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

    • top

      public double top
    • bottom

      public double bottom
    • left

      public double left
    • EMPTY

      public static final Insets EMPTY
  • Constructor Details

    • Insets

      public Insets(double aVal)
      Create new Insets.
    • Insets

      public Insets(double aTop, double aRight, double aBottom, double aLeft)
      Create new Insets.
  • Method Details

    • getTop

      public double getTop()
      Returns the top margin.
    • getRight

      public double getRight()
      Returns the right margin.
    • getBottom

      public double getBottom()
      Returns the bottom margin.
    • getLeft

      public double getLeft()
      Returns the left margin.
    • isEmpty

      public boolean isEmpty()
      Returns whether insets are empty.
    • getWidth

      public double getWidth()
      Returns the width of the insets (left + right).
    • getHeight

      public double getHeight()
      Returns the height of the insets (top + bottom).
    • getString

      public String getString()
      Returns a string representation of this Insets.
    • getStringLong

      public String getStringLong()
      Returns a string representation of this Insets.
    • clone

      public Insets clone()
      Returns a copy of this gradient paint.
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object o)
      Standard equals method.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Standard hashCode method.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • add

      public static Insets add(Insets aIns1, Insets aIns2)
      Adds two insets together.
    • add

      public static Insets add(Insets aIns1, double aTop, double aRight, double aBottom, double aLeft)
      Adds two insets together.
    • get

      public static Insets get(String aString)
      Returns an Insets instance from given string.