Top Description Fields Constructors Methods
javafx.scene.paint

public final Class Stop

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .Collections, .List, javafx.beans.NamedArg

Defines one element of the ramp of colors to use on a gradient. For more information see 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);
Since
JavaFX 2.0

Field Summary

Modifier and TypeField 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<Stop>
private double
offset

The offset variable is a number ranging from 0 to 1 that indicates where this gradient stop is placed.

Constructor Summary

AccessConstructor and Description
public
Stop(double
Stop's position (ranging from 0 to 1
offset
,
Color
Stop's color
color
)

Creates a new instance of Stop.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this object is equal to the obj argument; false otherwise.
equals
(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final Color

Returns:

the color of the gradient at this offset
getColor
()

Gets the color of the gradient at this offset.

public final double

Returns:

position of the Stop within the gradient (ranging from 0 to 1)
getOffset
()

Gets a number ranging from 0 to 1 that indicates where this gradient stop is placed.

public int

Returns:

a hash code for this Stop object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this Stop object.

pack-priv static List<Stop>
normalize(Stop[] stops)

pack-priv static List<Stop>
public String

Returns:

a string representation of this Stop object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this Stop object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

colorback to summary
private Color color

The color of the gradient at this offset.

Default Value
Color.BLACK
hashback 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_STOPSback to summary
pack-priv static final List<Stop> NO_STOPS
offsetback to summary
private double offset

The 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.

Default Value
0.0

Constructor Detail

Stopback to summary
public Stop(double offset, Color color)

Creates a new instance of Stop.

Parameters
offset:double

Stop's position (ranging from 0 to 1

color:Color

Stop's color

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is equal to the obj argument; false otherwise.

Annotations
@Override
getColorback to summary
public final Color getColor()

Gets the color of the gradient at this offset.

Returns:Color

the color of the gradient at this offset

getOffsetback to summary
public final double getOffset()

Gets 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.

Returns:double

position of the Stop within the gradient (ranging from 0 to 1)

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this Stop object.

Returns:int

a hash code for this Stop object.

Annotations
@Override
normalizeback to summary
pack-priv static List<Stop> normalize(Stop[] stops)
normalizeback to summary
pack-priv static List<Stop> normalize(List<Stop> stops)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Stop object.

Returns:String

a string representation of this Stop object.

Annotations
@Override