public class BorderImage extends 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.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(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.
|
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.DEFAULTrepeatX
- 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()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.