javafx.scene.paint.LinearGradient and
javafx.scene.paint.RadialGradient.
Example:
// object bounding box relative (proportional:true, default)
Stop[] stops = { new Stop(0, Color.WHITE), new Stop(1, Color.BLACK)};
LinearGradient lg = new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, stops);
Rectangle r = new Rectangle();
r.setFill(lg);
| Modifier and Type | Field and Description |
|---|---|
| private Color | color
The color of the gradient at this offset. |
| private int | hash
The cached hash code, used to improve performance in situations where we cache gradients, such as in the CSS routines. |
| pack-priv static final List | |
| private double | offset
The |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this object is equal to the obj argument; false otherwise.the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public final Color | Returns: the color of the gradient at this offsetGets the color of the gradient at this offset. |
| public final double | Returns: position of the Stop within the gradient (ranging from0 to 1)Gets a number ranging from |
| public int | Returns: a hash code for thisStop object.Overrides java. Returns a hash code for this |
| public Stop | interpolate(Stop endValue, double t)
Implements javafx. Returns an intermediate value between the value of this |
| pack-priv static List | Returns: the interpolated list, which may also befirstList or secondList;
if a new list is returned, it is unmodifiablethe first list, not firstList, List<Stop> nullthe second list, not secondList, double t)nullInterpolates between two normalized lists of stops. |
| private static Stop | interpolateVirtualStop(Stop A2, Stop B2, Stop B1, double t)
Consider two lists A and B, where A contains three stops, and B contains two stops:
|
| pack-priv static List | |
| pack-priv static List | |
| public String | Returns: a string representation of thisStop object.Overrides java. Returns a string representation of this |
| color | back to summary |
|---|---|
| private Color color The color of the gradient at this offset.
| |
| hash | back to summary |
|---|---|
| private int hash The cached hash code, used to improve performance in situations where we cache gradients, such as in the CSS routines. | |
| NO_STOPS | back to summary |
|---|---|
| pack-priv static final List<Stop> NO_STOPS | |
| offset | back to summary |
|---|---|
| private double offset The
| |
| Stop | back to summary |
|---|---|
| public Stop(double offset, Color color) Creates a new instance of Stop.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Indicates whether some other object is "equal to" this one. | |
| getColor | back to summary |
|---|---|
| public final Color getColor() Gets the color of the gradient at this offset.
| |
| getOffset | back to summary |
|---|---|
| public final double getOffset() Gets a number ranging from
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code for this
| |
| interpolate | back to summary |
|---|---|
| public Stop interpolate(Stop 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.
| |
| interpolateLists | back to summary |
|---|---|
| pack-priv static List Interpolates between two normalized lists of stops. | |
| interpolateVirtualStop | back to summary |
|---|---|
| private static Stop interpolateVirtualStop(Stop A2, Stop B2, Stop B1, double t) Consider two lists A and B, where A contains three stops, and B contains two stops:
Given the stops A{1,2,3} and B{1,2} in the diagram above, this method computes a new virtual
stop X that matches the offset of A2, and then interpolates between X and A2.
| |
| normalize | back to summary |
|---|---|
| pack-priv static List | |
| normalize | back to summary |
|---|---|
| pack-priv static List | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this | |