BackgroundImage within the
Region's drawing area.
The BackgroundImage can be positioned either from the left or right side
along the horizontal axis, and from either the top or bottom side along
the vertical axis. The horizontalSide and
verticalSide properties define to which side the
remaining properties pertain. The horizontalPosition
specifies the distance of the BackgroundImage from the corresponding side of the Region,
and horizontalAsPercentage indicates whether
this is as a literal value or a percentage. Similar properties exist for
specifying the size relative to the vertical axis.
For example, suppose I had a BackgroundPosition with a horizontalSide
of Side.RIGHT, a horizontalPosition of .05, and a
horizontalAsPercentage of true. In this case, the right
side of the BackgroundImage will be 5% of the width of the Region from
the Region's right edge.
| Modifier and Type | Field and Description |
|---|---|
| public static final BackgroundPosition | CENTER
A BackgroundPosition which will center a BackgroundImage. |
| public static final BackgroundPosition | DEFAULT
The default BackgroundPosition for any BackgroundImage. |
| private final int | hash
A cached has code value. |
| private final boolean | |
| private final double | |
| private final Side | |
| private final boolean | |
| private final double | |
| private final Side |
| Access | Constructor and Description |
|---|---|
| public | BackgroundPosition(Side
The horizontal side, must be either null, LEFT, or RIGHT. If null, LEFT
will be used. If TOP or BOTTOM is specified, an IllegalArgumentException
is thrown. horizontalSide, double The horizontal position value. horizontalPosition, boolean Whether to interpret the horizontal position as a decimal or percentage horizontalAsPercentage, Side The vertical side, must be either null, TOP, or BOTTOM. If null, TOP
will be used. If LEFT or RIGHT is specified, an IllegalArgumentException
is thrown. verticalSide, double The vertical position value. verticalPosition, boolean Whether to interpret the vertical position as a decimal or percentage verticalAsPercentage)Creates a new BackgroundPosition. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public final double | Returns: the horizontal position of the BackgroundImageThe value indicating the position of the BackgroundImage relative
to the Region along the side indicated by the
|
| public final Side | Returns: the Side along the horizontal axis to which the BackgroundImage is anchoredThe side along the horizontal axis to which the BackgroundImage is anchored. |
| public final double | Returns: the vertical position of the BackgroundImageThe value indicating the position of the BackgroundImage relative
to the Region along the side indicated by the |
| public final Side | Returns: the Side along the vertical axis to which the BackgroundImage is anchoredThe side along the vertical axis to which the BackgroundImage is anchored. |
| public int | |
| public BackgroundPosition | interpolate(BackgroundPosition
the target value endValue, double the interpolation factor t)Implements javafx. Returns an intermediate value between the value of this |
| public final boolean | Returns: true if horizontalPosition should be interpreted as a percentageSpecifies whether the |
| private boolean | |
| public final boolean | Returns: true if verticalPosition should be interpreted as a percentageSpecifies whether the |
| CENTER | back to summary |
|---|---|
| public static final BackgroundPosition CENTER A BackgroundPosition which will center a BackgroundImage. | |
| DEFAULT | back to summary |
|---|---|
| public static final BackgroundPosition DEFAULT The default BackgroundPosition for any BackgroundImage. The default is to have no insets and to be defined as 0% and 0%. That is, the position is in the top-left corner. | |
| hash | back to summary |
|---|---|
| private final int hash A cached has code value. | |
| horizontalAsPercentage | back to summary |
|---|---|
| private final boolean horizontalAsPercentage | |
| horizontalPosition | back to summary |
|---|---|
| private final double horizontalPosition | |
| horizontalSide | back to summary |
|---|---|
| private final Side horizontalSide | |
| verticalAsPercentage | back to summary |
|---|---|
| private final boolean verticalAsPercentage | |
| verticalPosition | back to summary |
|---|---|
| private final double verticalPosition | |
| verticalSide | back to summary |
|---|---|
| private final Side verticalSide | |
| BackgroundPosition | back to summary |
|---|---|
| public BackgroundPosition(Side horizontalSide, double horizontalPosition, boolean horizontalAsPercentage, Side verticalSide, double verticalPosition, boolean verticalAsPercentage) Creates a new BackgroundPosition.
| |
| 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. | |
| getHorizontalPosition | back to summary |
|---|---|
| public final double getHorizontalPosition() The value indicating the position of the BackgroundImage relative
to the Region along the side indicated by the
| |
| getHorizontalSide | back to summary |
|---|---|
| public final Side getHorizontalSide() The side along the horizontal axis to which the BackgroundImage is anchored. This will only be LEFT or RIGHT and never null.
| |
| getVerticalPosition | back to summary |
|---|---|
| public final double getVerticalPosition() The value indicating the position of the BackgroundImage relative
to the Region along the side indicated by the
| |
| getVerticalSide | back to summary |
|---|---|
| public final Side getVerticalSide() The side along the vertical axis to which the BackgroundImage is anchored. This will only be TOP or BOTTOM and never null.
| |
| 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 BackgroundPosition interpolate(BackgroundPosition 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.
| |
| isHorizontalAsPercentage | back to summary |
|---|---|
| public final boolean isHorizontalAsPercentage() Specifies whether the
| |
| isSame | back to summary |
|---|---|
| private boolean isSame(Side horizontalSide, double horizontalPosition, boolean horizontalAsPercentage, Side verticalSide, double verticalPosition, boolean verticalAsPercentage) | |
| isVerticalAsPercentage | back to summary |
|---|---|
| public final boolean isVerticalAsPercentage() Specifies whether the
| |