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 final int | hash
A cached hash code for faster secondary usage. |
| private final Image | |
| pack-priv Boolean | opaque
The Background will cache here whether this BackgroundImage is opaque. |
| pack-priv final BackgroundPosition | |
| pack-priv final BackgroundRepeat | |
| pack-priv final BackgroundRepeat | |
| pack-priv final BackgroundSize |
| Access | Constructor and Description |
|---|---|
| public | BackgroundImage(Image
The image to use. This cannot be null. image, BackgroundRepeat The BackgroundRepeat for the x axis. If null, this value defaults to REPEAT. repeatX, BackgroundRepeat The BackgroundRepeat for the y axis. If null, this value defaults to REPEAT. repeatY, BackgroundPosition The BackgroundPosition to use. If null, defaults to BackgroundPosition.DEFAULT. position, BackgroundSize The BackgroundSize. If null, defaults to BackgroundSize.DEFAULT. size)Creates a new BackgroundImage. |
| 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 BackgroundPosition | Returns: the position of this BackgroundImage relative to the RegionThe position of this BackgroundImage relative to the Region. |
| public final BackgroundRepeat | Returns: the BackgroundRepeat that indicates if the background image is to be repeated along the x-axis of the regionIndicates in what manner (if at all) the background image is to be repeated along the x-axis of the region. |
| public final BackgroundRepeat | Returns: the BackgroundRepeat that indicates if the background image is to be repeated along the y-axis of the regionIndicates in what manner (if at all) the background image is to be repeated along the y-axis of the region. |
| public final BackgroundSize | Returns: the size of this image relative to the RegionThe size of this image relative to the Region. |
| public int | |
| public BackgroundImage | interpolate(BackgroundImage endValue, double t)
Implements javafx. Returns an intermediate value between the value of this |
| private boolean | isSame(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size)
|
| hash | back to summary |
|---|---|
| private final int hash A cached hash code for faster secondary usage. It is expected that BackgroundImage will be pulled from a cache in many cases. | |
| image | back to summary |
|---|---|
| private final Image image | |
| opaque | back to summary |
|---|---|
| pack-priv Boolean opaque The Background will cache here whether this BackgroundImage is opaque. If this value is null, then it means we don't yet know. If it is non null, then we know for certain it either is, or is not, opaque. Opaque in this case means that the BackgroundImage's image is opaque. | |
| position | back to summary |
|---|---|
| pack-priv final BackgroundPosition position | |
| repeatX | back to summary |
|---|---|
| pack-priv final BackgroundRepeat repeatX | |
| repeatY | back to summary |
|---|---|
| pack-priv final BackgroundRepeat repeatY | |
| size | back to summary |
|---|---|
| pack-priv final BackgroundSize size | |
| BackgroundImage | back to summary |
|---|---|
| public BackgroundImage(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) Creates a new BackgroundImage. The
| |
| 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 BackgroundImage will be skipped at rendering time.
| |
| getPosition | back to summary |
|---|---|
| public final BackgroundPosition getPosition() The position of this BackgroundImage relative to the Region. Note that any position outside the background area of the region will be clipped.
| |
| getRepeatX | back to summary |
|---|---|
| public final BackgroundRepeat getRepeatX() Indicates in what manner (if at all) the background image is to be repeated along the x-axis of the region. This will never be null.
| |
| getRepeatY | back to summary |
|---|---|
| public final BackgroundRepeat getRepeatY() Indicates in what manner (if at all) the background image is to be repeated along the y-axis of the region. This will never be null.
| |
| getSize | back to summary |
|---|---|
| public final BackgroundSize getSize() The size of this image relative to 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 BackgroundImage interpolate(BackgroundImage 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.
| |
| isSame | back to summary |
|---|---|
| private boolean isSame(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) | |