|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.slick.svg.Gradient
public class Gradient
A gradient definition from an SVG file, includes the stops, name and transform.
| Constructor Summary | |
|---|---|
Gradient(java.lang.String name,
boolean radial)
Create a new gradient definition |
|
| Method Summary | |
|---|---|
void |
addStep(float location,
Color c)
Add a colour step/stop to the gradient |
void |
genImage()
Generate the image used for texturing the gradient across shapes |
Color |
getColorAt(float p)
Get the intepolated colour at the given location on the gradient |
Image |
getImage()
Get the image generated for this gradient |
float |
getR()
Get the radius value given for this gradient |
Transform |
getTransform()
Get the transform to apply during this gradient application |
float |
getX1()
Get the first x value given for this gradient (cx in the case of radial) |
float |
getX2()
Get the second x value given for this gradient (fx in the case of radial) |
float |
getY1()
Get the first y value given for this gradient (cy in the case of radial) |
float |
getY2()
Get the second y value given for this gradient (fy in the case of radial) |
boolean |
isRadial()
Check if the gradient is radial |
void |
reference(java.lang.String ref)
Reference another gradient, i.e. |
void |
resolve(Diagram diagram)
Resolve the gradient reference |
void |
setR(float r)
Set the radius given in the SVG |
void |
setTransform(Transform trans)
Set the transform given for this definition |
void |
setX1(float x1)
Set the first x value given for the gradient (cx in the case of radial) |
void |
setX2(float x2)
Set the second x value given for the gradient (fx in the case of radial) |
void |
setY1(float y1)
Set the first y value given for the gradient (cy in the case of radial) |
void |
setY2(float y2)
Set the second y value given for the gradient (fy in the case of radial) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Gradient(java.lang.String name,
boolean radial)
name - The name of the gradientradial - True if the gradient is radial| Method Detail |
|---|
public boolean isRadial()
public void setTransform(Transform trans)
trans - The transform given for this definitionpublic Transform getTransform()
public void reference(java.lang.String ref)
ref - The name of the other gradient to referencepublic void resolve(Diagram diagram)
diagram - The diagram to resolve againstpublic void genImage()
public Image getImage()
public void setR(float r)
r - The radius for radial gradientspublic void setX1(float x1)
x1 - The first x value given for the gradientpublic void setX2(float x2)
x2 - The second x value given for the gradientpublic void setY1(float y1)
y1 - The first y value given for the gradientpublic void setY2(float y2)
y2 - The second y value given for the gradientpublic float getR()
public float getX1()
public float getX2()
public float getY1()
public float getY2()
public void addStep(float location,
Color c)
location - The location on the gradient the colour affectsc - The color to applypublic Color getColorAt(float p)
p - The point of the gradient (0 >= n >= 1)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||