Class Insets

java.lang.Object
com.cedarsoftware.util.geom.Insets

public final class Insets extends Object
Zero-dependency geometric primitive - Immutable Insets class representing the borders of a container.

This class provides an API-compatible replacement for java.awt.Insets without requiring the java.desktop module (~8MB), making it ideal for headless servers, microservices, and modular applications.

No AWT dependency - This class is completely independent and does not require java.awt.

Author:
John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

License

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Insets(int top, int left, int bottom, int right)
    Creates Insets with the specified top, left, bottom, and right values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the inset from the bottom.
    int
    Returns the inset from the left.
    int
    Returns the inset from the right.
    int
    Returns the inset from the top.
    int
     
     

    Methods inherited from class java.lang.Object

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

    • Insets

      public Insets(int top, int left, int bottom, int right)
      Creates Insets with the specified top, left, bottom, and right values.
      Parameters:
      top - the inset from the top
      left - the inset from the left
      bottom - the inset from the bottom
      right - the inset from the right
  • Method Details

    • getTop

      public int getTop()
      Returns the inset from the top.
    • getLeft

      public int getLeft()
      Returns the inset from the left.
    • getBottom

      public int getBottom()
      Returns the inset from the bottom.
    • getRight

      public int getRight()
      Returns the inset from the right.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object