Class Insets
java.lang.Object
javafx.geometry.Insets
- All Implemented Interfaces:
Interpolatable<Insets>
public class Insets extends Object implements Interpolatable<Insets>
A set of inside offsets for the 4 side of a rectangular area
- Since:
- JavaFX 2.0
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
static final Insets |
EMPTY |
Empty insets. |
Constructor Summary
| Constructor | Description |
|---|---|
Insets |
Constructs a new Insets instance with same value for all four offsets. |
Insets |
Constructs a new Insets instance with four different offsets. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
final double |
getBottom() |
The inset on the bottom side. |
final double |
getLeft() |
The inset on the left side. |
final double |
getRight() |
The inset on the right side. |
final double |
getTop() |
The inset on the top side. |
int |
hashCode() |
Returns a hash code value for the insets. |
Insets |
interpolate |
Returns an intermediate value between the value of this Interpolatable and the specified endValue using the linear interpolation factor t, ranging from 0 (inclusive) to 1 (inclusive). |
String |
toString() |
Returns a string representation for the insets. |
Field Details
EMPTY
public static final Insets EMPTY
Empty insets. An
Insets instance with all offsets equal to zero.Constructor Details
Insets
public Insets(double top, double right, double bottom, double left)
Constructs a new Insets instance with four different offsets.
- Parameters:
-
top- the top offset -
right- the right offset -
bottom- the bottom offset -
left- the left offset
Insets
public Insets(double topRightBottomLeft)
Constructs a new Insets instance with same value for all four offsets.
- Parameters:
-
topRightBottomLeft- the value used for top, bottom, right and left offset
Method Details
getTop
public final double getTop()
The inset on the top side.
- Interpolation Type:
- linear
- Returns:
- the inset on the top side
getRight
public final double getRight()
The inset on the right side.
- Interpolation Type:
- linear
- Returns:
- the inset on the right side
getBottom
public final double getBottom()
The inset on the bottom side.
- Interpolation Type:
- linear
- Returns:
- the inset on the bottom side
getLeft
public final double getLeft()
The inset on the left side.
- Interpolation Type:
- linear
- Returns:
- the inset on the left side
interpolate
public Insets interpolate(Insets endValue, double t)
Returns an intermediate value between the value of this
Interpolatable and the specified endValue using the linear interpolation factor t, ranging from 0 (inclusive) to 1 (inclusive). The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value.
- Specified by:
-
interpolatein interfaceInterpolatable<Insets> - Parameters:
-
endValue- the target value -
t- the interpolation factor - Returns:
- the intermediate value
- Throws:
-
NullPointerException- ifendValueisnull - Since:
- 24
equals
hashCode
toString
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.