public final class Stop
extends java.lang.Object
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.
|
(package private) static java.util.List<Stop> |
NO_STOPS |
private double |
offset
The
offset variable is a number ranging from 0 to 1
that indicates where this gradient stop is placed. |
| Constructor and Description |
|---|
Stop(double offset,
Color color)
Creates a new instance of Stop.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
Color |
getColor()
Gets the color of the gradient at this offset.
|
double |
getOffset()
Gets a number ranging from
0 to 1
that indicates where this gradient stop is placed. |
int |
hashCode()
Returns a hash code for this
Stop object. |
(package private) static java.util.List<Stop> |
normalize(java.util.List<Stop> stops) |
(package private) static java.util.List<Stop> |
normalize(Stop[] stops) |
java.lang.String |
toString()
Returns a string representation of this
Stop object. |
static final java.util.List<Stop> NO_STOPS
private double offset
offset variable is a number ranging from 0 to 1
that indicates where this gradient stop is placed. For linear gradients,
the offset variable represents a location along the gradient vector.
For radial gradients, it represents a percentage distance from
the focus point to the edge of the outermost/largest circle.private Color color
private int hash
public Stop(double offset,
Color color)
offset - Stop's position (ranging from 0 to 1color - Stop's colorpublic final double getOffset()
0 to 1
that indicates where this gradient stop is placed. For linear gradients,
the offset variable represents a location along the gradient vector.
For radial gradients, it represents a percentage distance from
the focus point to the edge of the outermost/largest circle.0 to 1)public final Color getColor()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the reference object with which to compare.true if this object is equal to the obj argument; false otherwise.public int hashCode()
Stop object.hashCode in class java.lang.ObjectStop object.public java.lang.String toString()
Stop object.toString in class java.lang.ObjectStop object.