public final class Stop extends 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);
| Constructor and Description |
|---|
Stop(double offset,
Color color)
Creates a new instance of Stop.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(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. |
String |
toString()
Returns a string representation of this
Stop object. |
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(Object obj)
public int hashCode()
Stop object.Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.