java.lang.Object
omix.lang.Gradient
omix.lang.LinearGradient
- All Implemented Interfaces:
Serializable
,Brush
,Paint
public final class LinearGradient extends Gradient
This class represents linear gradients. Linear gradients interpolate colors between
start and end points which are given in X and Y.
Outside these points the gradient is either padded,
reflected or repeated depending on the currently set spread method.
- Author:
- Dr. Peter Droste, Omix Visualization
- See Also:
- Serialized Form
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description LinearGradient(Map<Double,Color> stops, Gradient.Spread spread)
Creates a gradient according to the submitted set of colors.LinearGradient(Color color)
The same as LinearGradient(color, color, Spread.PadSpread)LinearGradient(Color color0, Color color1)
The same as LinearGradient(color0, color1, Spread.PadSpread)LinearGradient(Color color0, Color color1, Gradient.Spread spread)
Creates a gradient between the two submitted colors.LinearGradient(Color color, Gradient.Spread spread)
The same as LinearGradient(color, color, spread) -
Method Summary
Modifier and Type Method Description LinearGradient
clone()
boolean
equals(Object obj)
double
getEndX()
double
getEndY()
double
getStartX()
double
getStartY()
int
hashCode()
void
setEnd(double endX, double endY)
changes the coordinates of the end pointvoid
setEndX(double endX)
changes the x coordinate of the end pointvoid
setEndY(double endY)
changes the y coordinate of the end pointvoid
setStart(double startX, double startY)
changes the coordinates of the start pointvoid
setStartX(double startX)
changes the x coordinate of the start pointvoid
setStartY(double startY)
changes the y coordinate of the start point
-
Constructor Details
-
LinearGradient
The same as LinearGradient(color0, color1, Spread.PadSpread)- Parameters:
color0
- Color at value 0.0color1
- Color at value 1.0
-
LinearGradient
The same as LinearGradient(color, color, Spread.PadSpread)- Parameters:
color
- Color at value 0.0 and 1.0
-
LinearGradient
@ConstructorProperties({"color0","color1","spread"}) public LinearGradient(Color color0, Color color1, Gradient.Spread spread)Creates a gradient between the two submitted colors.- Parameters:
color0
- Color at value 0.0color1
- Color at value 1.0spread
- Spread of the gradient
-
LinearGradient
@ConstructorProperties({"stops","spread"}) public LinearGradient(Map<Double,Color> stops, Gradient.Spread spread)Creates a gradient according to the submitted set of colors.- Parameters:
stops
- color stopsspread
- Spread of the gradient
-
LinearGradient
@ConstructorProperties({"color","spread"}) public LinearGradient(Color color, Gradient.Spread spread)The same as LinearGradient(color, color, spread)- Parameters:
color
- Color at value 0.0 and 1.0spread
- Spread of the gradient
-
-
Method Details
-
getStartX
public double getStartX()- Returns:
- the x coordinate of the start point
-
setStartX
public void setStartX(double startX)changes the x coordinate of the start point- Parameters:
startX
-
-
getStartY
public double getStartY()- Returns:
- the y coordinate of the start point
-
setStartY
public void setStartY(double startY)changes the y coordinate of the start point- Parameters:
startY
-
-
setStart
public void setStart(double startX, double startY)changes the coordinates of the start point- Parameters:
startX
-startY
-
-
getEndX
public double getEndX()- Returns:
- the x coordinate of the end point
-
setEndX
public void setEndX(double endX)changes the x coordinate of the end point- Parameters:
endX
-
-
getEndY
public double getEndY()- Returns:
- the y coordinate of the end point
-
setEndY
public void setEndY(double endY)changes the y coordinate of the end point- Parameters:
endY
-
-
setEnd
public void setEnd(double endX, double endY)changes the coordinates of the end point- Parameters:
endX
-endY
-
-
clone
-
hashCode
public int hashCode() -
equals
-