Klasse Insets2D
java.lang.Object
de.erichseifert.gral.graphics.Insets2D
- Bekannte direkte Unterklassen:
Insets2D.Double
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 KlassenModifikator und TypKlasseBeschreibungstatic classClass that stores insets as double values. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungabstract doubleReturns the insets at the bottom.doubleReturns the sum of horizontal insets.abstract doublegetLeft()Returns the insets at the left.abstract doublegetRight()Returns the insets at the right.abstract doublegetTop()Returns the insets at the top.doubleReturns the sum of vertical insets.abstract voidsetInsets(double top, double left, double bottom, double right) Sets the insets to the specified values.abstract voidSets the insets according to the specified insets.
-
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
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.
-