repeatX and repeatY properties define how the
image is to be repeated in each direction. The slices property
defines how to slice up the image such that it can be stretched across
the Region, while the widths defines the area on the Region to
fill with the border image. Finally, the outsets define the distance
outward from the edge of the border over which the border extends. The
outsets of the BorderImage contribute to the outsets of the Border, which
in turn contribute to the bounds of the Region.
Because the BorderImage is immutable, it can safely be used in any cache, and can safely be reused among multiple Regions.
When applied to a Region with a defined shape, a BorderImage is ignored.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final int | hash
A cached hash code for faster secondary usage. |
| private final Image | |
| pack-priv final Insets | |
| private final Insets | |
| pack-priv final Insets | |
| private final BorderRepeat | |
| private final BorderRepeat | |
| private final BorderWidths | |
| private final BorderWidths |
| Access | Constructor and Description |
|---|---|
| public | BorderImage(Image
The image to use. This must not be null. image, BorderWidths The widths of the border in each dimension. A null value results in Insets.EMPTY. widths, Insets The insets at which to place the border relative to the region.
A null value results in Insets.EMPTY. insets, BorderWidths The slices for the image. If null, defaults to BorderImageSlices.DEFAULT slices, boolean A flag indicating whether the center patch should be drawn filled, BorderRepeat The repeat value for the border image in the x direction. If null, defaults to STRETCH. repeatX, BorderRepeat The repeat value for the border image in the y direction. If null, defaults to the same
value as repeatX. repeatY)Creates a new BorderImage. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public final Image | |
| public final Insets | Returns: the insets of the BorderImageThe insets of the BorderImage define where the border should be positioned relative to the edge of the Region. |
| public final BorderRepeat | Returns: the BorderRepeat that indicates if the border image is to be repeated along the x-axis of the regionIndicates in what manner (if at all) the border image is to be repeated along the x-axis of the region. |
| public final BorderRepeat | Returns: the BorderRepeat that indicates if the border image is to be repeated along the y-axis of the regionIndicates in what manner (if at all) the border image is to be repeated along the y-axis of the region. |
| public final BorderWidths | Returns: the BorderWidths that defines the slices of the imageDefines the slices of the image. |
| public final BorderWidths | Returns: the BorderWidths of the border on each sideThe widths of the border on each side. |
| public int | |
| public BorderImage | interpolate(BorderImage endValue, double t)
Implements javafx. Returns an intermediate value between the value of this |
| public final boolean | Returns: true if the center patch should be drawnSpecifies whether or not the center patch (as defined by the left, right, top, and bottom slices) should be drawn. |
| private boolean | isSame(Image image, BorderWidths widths, BorderWidths slices, boolean filled, BorderRepeat repeatX, BorderRepeat repeatY)
|
| filled | back to summary |
|---|---|
| private final boolean filled | |
| hash | back to summary |
|---|---|
| private final int hash A cached hash code for faster secondary usage. It is expected that BorderImage will be pulled from a cache in many cases. | |
| image | back to summary |
|---|---|
| private final Image image | |
| innerEdge | back to summary |
|---|---|
| pack-priv final Insets innerEdge | |
| insets | back to summary |
|---|---|
| private final Insets insets | |
| outerEdge | back to summary |
|---|---|
| pack-priv final Insets outerEdge | |
| repeatX | back to summary |
|---|---|
| private final BorderRepeat repeatX | |
| repeatY | back to summary |
|---|---|
| private final BorderRepeat repeatY | |
| slices | back to summary |
|---|---|
| private final BorderWidths slices | |
| widths | back to summary |
|---|---|
| private final BorderWidths widths | |
| BorderImage | back to summary |
|---|---|
| public BorderImage(Image image, BorderWidths widths, Insets insets, BorderWidths slices, boolean filled, BorderRepeat repeatX, BorderRepeat repeatY) Creates a new BorderImage. The image must be specified or a NullPointerException will be thrown.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getImage | back to summary |
|---|---|
| public final Image getImage() The image to be used. This will never be null. If this image fails to load, then the entire BorderImage will be skipped at rendering time and will not contribute to any bounds or other computations.
| |
| getInsets | back to summary |
|---|---|
| public final Insets getInsets() The insets of the BorderImage define where the border should be positioned relative to the edge of the Region. This value will never be null.
| |
| getRepeatX | back to summary |
|---|---|
| public final BorderRepeat getRepeatX() Indicates in what manner (if at all) the border image is to be repeated along the x-axis of the region. If not specified, the default value is STRETCH.
| |
| getRepeatY | back to summary |
|---|---|
| public final BorderRepeat getRepeatY() Indicates in what manner (if at all) the border image is to be repeated along the y-axis of the region. If not specified, the default value is STRETCH.
| |
| getSlices | back to summary |
|---|---|
| public final BorderWidths getSlices() Defines the slices of the image. JavaFX uses a 4-slice scheme where
the slices each divide up an image into 9 patches. The top-left patch
defines the top-left corner of the border. The top patch defines the top
border and the image making up this patch is stretched horizontally
(or whatever is defined for repeatX) to fill all the required space. The
top-right patch goes in the top-right corner, and the right patch is
stretched vertically (or whatever is defined for repeatY) to fill all the
required space. And so on. The center patch is stretched (or whatever is
defined for repeatX, repeatY) in each dimension. By default the center is
omitted (ie: not drawn), although a BorderImageSlices value of
| |
| getWidths | back to summary |
|---|---|
| public final BorderWidths getWidths() The widths of the border on each side. These can be defined
as either to be absolute widths or percentages of the size of
the Region,
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| interpolate | back to summary |
|---|---|
| public BorderImage interpolate(BorderImage endValue, double t) Implements javafx. Doc from javafx. Returns an intermediate value between the value of this 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.
| |
| isFilled | back to summary |
|---|---|
| public final boolean isFilled() Specifies whether or not the center patch (as defined by the left, right, top, and bottom slices) should be drawn.
| |
| isSame | back to summary |
|---|---|
| private boolean isSame(Image image, BorderWidths widths, BorderWidths slices, boolean filled, BorderRepeat repeatX, BorderRepeat repeatY) | |