Klasse Insets2D

java.lang.Object
de.erichseifert.gral.graphics.Insets2D
Bekannte direkte Unterklassen:
Insets2D.Double

public abstract class Insets2D extends Object

Space to be kept free at the four edges of a container, in double precision. This exists because java.awt.Insets stores only int values, which is not enough for the fractional coordinates plots are laid out in.

The class itself is abstract; Insets2D.Double is the implementation:

// top, left, bottom, right — the same order as java.awt.Insets
plot.setInsets(new Insets2D.Double(20.0, 60.0, 40.0, 20.0));

// The same amount on every side.
container.setInsets(new Insets2D.Double(10.0));

Note the argument order: it starts at the top and goes clockwise, so the left inset — usually the largest one, since it has to hold the tick labels of the y axis — is the second value, not the first.

  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifikator und Typ
    Klasse
    Beschreibung
    static class 
    Class that stores insets as double values.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Creates a new Insets2D object.
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    abstract double
    Returns the insets at the bottom.
    double
    Returns the sum of horizontal insets.
    abstract double
    Returns the insets at the left.
    abstract double
    Returns the insets at the right.
    abstract double
    Returns the insets at the top.
    double
    Returns the sum of vertical insets.
    abstract void
    setInsets(double top, double left, double bottom, double right)
    Sets the insets to the specified values.
    abstract void
    Sets the insets according to the specified insets.

    Von Klasse geerbte Methoden Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • Insets2D

      public Insets2D()
      Creates a new Insets2D object.
  • Methodendetails

    • getTop

      public abstract double getTop()
      Returns the insets at the top.
      Gibt zurück:
      Top insets.
    • getLeft

      public abstract double getLeft()
      Returns the insets at the left.
      Gibt zurück:
      Left insets.
    • getBottom

      public abstract double getBottom()
      Returns the insets at the bottom.
      Gibt zurück:
      Bottom insets.
    • getRight

      public abstract double getRight()
      Returns the insets at the right.
      Gibt zurück:
      Right insets.
    • getHorizontal

      public double getHorizontal()
      Returns the sum of horizontal insets.
      Gibt zurück:
      Horizontal insets.
    • getVertical

      public double getVertical()
      Returns the sum of vertical insets.
      Gibt zurück:
      Vertical insets.
    • setInsets

      public abstract void setInsets(Insets2D insets)
      Sets the insets according to the specified insets.
      Parameter:
      insets - Insets to be set.
    • setInsets

      public abstract void setInsets(double top, double left, double bottom, double right)
      Sets the insets to the specified values.
      Parameter:
      top - Top insets.
      left - Left insets.
      bottom - Bottom insets.
      right - Right insets.