public final class BackgroundImage
extends java.lang.Object
Region
. A BackgroundImage must have an Image specified (it cannot be
null). The repeatX
and repeatY
properties define how the image is to be repeated in each direction. The
position
property defines how to position the image on the
Region while the size
property defines the size of the image
on the Region. For example, the size
might be defined with
cover = true
, meaning the image
should be stretched to cover the entire rendering surface of the Region.
Because the BackgroundImage is immutable, it can safely be used in any cache, and can safely be reused among multiple Regions.
Modifier and Type | Field and Description |
---|---|
private int |
hash
A cached hash code for faster secondary usage.
|
(package private) Image |
image |
(package private) java.lang.Boolean |
opaque
The Background will cache here whether this BackgroundImage is opaque.
|
(package private) BackgroundPosition |
position |
(package private) BackgroundRepeat |
repeatX |
(package private) BackgroundRepeat |
repeatY |
(package private) BackgroundSize |
size |
Constructor and Description |
---|
BackgroundImage(Image image,
BackgroundRepeat repeatX,
BackgroundRepeat repeatY,
BackgroundPosition position,
BackgroundSize size)
Creates a new BackgroundImage.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Image |
getImage()
The image to be used.
|
BackgroundPosition |
getPosition()
The position of this BackgroundImage relative to the Region.
|
BackgroundRepeat |
getRepeatX()
Indicates in what manner (if at all) the background image
is to be repeated along the x-axis of the region.
|
BackgroundRepeat |
getRepeatY()
Indicates in what manner (if at all) the background image
is to be repeated along the y-axis of the region.
|
BackgroundSize |
getSize()
The size of this image relative to the Region.
|
int |
hashCode() |
final Image image
final BackgroundRepeat repeatX
final BackgroundRepeat repeatY
final BackgroundPosition position
final BackgroundSize size
java.lang.Boolean opaque
private final int hash
public BackgroundImage(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size)
image
must be specified.image
- The image to use. This cannot be null.repeatX
- The BackgroundRepeat for the x axis. If null, this value defaults to REPEAT.repeatY
- The BackgroundRepeat for the y axis. If null, this value defaults to REPEAT.position
- The BackgroundPosition to use. If null, defaults to BackgroundPosition.DEFAULT.size
- The BackgroundSize. If null, defaults to BackgroundSize.DEFAULT.public final Image getImage()
public final BackgroundRepeat getRepeatX()
public final BackgroundRepeat getRepeatY()
public final BackgroundPosition getPosition()
public final BackgroundSize getSize()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object