public class BorderImage
extends java.lang.Object
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 |
---|---|
(package private) boolean |
filled |
private int |
hash
A cached hash code for faster secondary usage.
|
(package private) Image |
image |
(package private) Insets |
innerEdge |
(package private) Insets |
insets |
(package private) Insets |
outerEdge |
(package private) BorderRepeat |
repeatX |
(package private) BorderRepeat |
repeatY |
(package private) BorderWidths |
slices |
(package private) BorderWidths |
widths |
Constructor and Description |
---|
BorderImage(Image image,
BorderWidths widths,
Insets insets,
BorderWidths slices,
boolean filled,
BorderRepeat repeatX,
BorderRepeat repeatY)
Creates a new BorderImage.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Image |
getImage()
The image to be used.
|
Insets |
getInsets()
The insets of the BorderImage define where the border should be positioned
relative to the edge of the Region.
|
BorderRepeat |
getRepeatX()
Indicates in what manner (if at all) the border image
is to be repeated along the x-axis of the region.
|
BorderRepeat |
getRepeatY()
Indicates in what manner (if at all) the border image
is to be repeated along the y-axis of the region.
|
BorderWidths |
getSlices()
Defines the slices of the image.
|
BorderWidths |
getWidths()
The widths of the border on each side.
|
int |
hashCode() |
boolean |
isFilled()
Specifies whether or not the center patch (as defined by the left, right, top, and bottom slices)
should be drawn.
|
final Image image
final BorderRepeat repeatX
final BorderRepeat repeatY
final BorderWidths widths
final BorderWidths slices
final boolean filled
final Insets insets
final Insets innerEdge
final Insets outerEdge
private final int hash
public BorderImage(Image image, BorderWidths widths, Insets insets, BorderWidths slices, boolean filled, BorderRepeat repeatX, BorderRepeat repeatY)
image
- The image to use. This must not be null.widths
- The widths of the border in each dimension. A null value results in Insets.EMPTY.insets
- The insets at which to place the border relative to the region.
A null value results in Insets.EMPTY.slices
- The slices for the image. If null, defaults to BorderImageSlices.DEFAULTfilled
- A flag indicating whether the center patch should be drawnrepeatX
- The repeat value for the border image in the x direction. If null, defaults to STRETCH.repeatY
- The repeat value for the border image in the y direction. If null, defaults to the same
value as repeatX.public final Image getImage()
public final BorderRepeat getRepeatX()
public final BorderRepeat getRepeatY()
public final BorderWidths getWidths()
BorderWidths
for more details. If null,
this will default to being 1 pixel wide.public final BorderWidths getSlices()
true
for the filled
property will cause the center to be drawn. A
default value for this property will result in BorderImageSlices.DEFAULT, which
is a border-image-slice of 100%public final boolean isFilled()
public final Insets getInsets()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object