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 1
color
- 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.Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.