Methods Summary |
---|
protected com.sun.perseus.j2d.PaintDef | computePaint()Computes the paint in user space on use.
if (computedPaint == null) {
buildGradientColorMap();
computedPaint =
new LinearGradientPaintDef(x1,
y1,
x2,
y2,
lastColorMapFractions,
lastColorMapRGBA,
LinearGradientPaintDef.CYCLE_NONE,
isObjectBBox,
transform);
}
return computedPaint;
|
TraitAnim | createTraitAnimImpl(java.lang.String traitName)LinearGradient handles x1, y1, x2, y2 traits as
FloatTraitAnims.
if (SVGConstants.SVG_X1_ATTRIBUTE == traitName
||
SVGConstants.SVG_X2_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y1_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y2_ATTRIBUTE == traitName) {
return new FloatTraitAnim(this, traitName, TRAIT_TYPE_FLOAT);
} else {
return super.createTraitAnimImpl(traitName);
}
|
float | getFloatTraitImpl(java.lang.String name)
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
return x1;
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
return y1;
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
return x2;
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return y2;
} else {
return super.getFloatTraitImpl(name);
}
|
public java.lang.String | getLocalName()
return SVGConstants.SVG_LINEAR_GRADIENT_TAG;
|
public java.lang.String | getTraitImpl(java.lang.String name)
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
return Float.toString(x1);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
return Float.toString(y1);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
return Float.toString(x2);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return Float.toString(y2);
} else {
return super.getTraitImpl(name);
}
|
public float | getX1()
return x1;
|
public float | getX2()
return x2;
|
public float | getY1()
return y1;
|
public float | getY2()
return y2;
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype Rect .
return new LinearGradient(doc);
|
void | setFloatArrayTrait(java.lang.String name, float[][] value)Set the trait value as float array.
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(value[0][0]);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(value[0][0]);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
setX2(value[0][0]);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
setY2(value[0][0]);
} else {
super.setFloatArrayTrait(name, value);
}
|
public void | setFloatTraitImpl(java.lang.String name, float value)Set the trait value as float.
Supported float traits: stroke-width, stroke-miterlimit,
stroke-dashoffset, fill-opacity, stroke-opacity.
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(value);
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(value);
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
setX2(value);
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
setY2(value);
} else {
super.setFloatTraitImpl(name, value);
}
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset,
fill-rule, stroke-linejoin, stroke-linecap, display, visibility,
color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray
if (SVGConstants.SVG_X1_ATTRIBUTE == name) {
setX1(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_Y1_ATTRIBUTE == name) {
setY1(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_X2_ATTRIBUTE == name) {
setX2(parseFloatTrait(name, value));
} else if (SVGConstants.SVG_Y2_ATTRIBUTE == name) {
setY2(parseFloatTrait(name, value));
} else {
super.setTraitImpl(name, value);
}
|
public void | setX1(float newX1)Sets the x1 property.
if (newX1 == x1) {
return;
}
this.x1 = newX1;
onPaintChange();
|
public void | setX2(float newX2)Sets the x2 property.
if (newX2 == x2) {
return;
}
this.x2 = newX2;
onPaintChange();
|
public void | setY1(float newY1)Sets the y1 property.
if (newY1 == y1) {
return;
}
this.y1 = newY1;
onPaintChange();
|
public void | setY2(float newY2)Sets the y2 property.
if (newY2 == y2) {
return;
}
this.y2 = newY2;
onPaintChange();
|
boolean | supportsTrait(java.lang.String traitName)LinearGradient handles x1, x2, y1, y2.
if (SVGConstants.SVG_X1_ATTRIBUTE == traitName
||
SVGConstants.SVG_X2_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y1_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y2_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTrait(traitName);
}
|
java.lang.String | toStringTrait(java.lang.String name, float[][] value)
if (SVGConstants.SVG_X1_ATTRIBUTE == name
||
SVGConstants.SVG_Y1_ATTRIBUTE == name
||
SVGConstants.SVG_X2_ATTRIBUTE == name
||
SVGConstants.SVG_Y2_ATTRIBUTE == name) {
return Float.toString(value[0][0]);
} else {
return super.toStringTrait(name, value);
}
|
public float[][] | validateFloatArrayTrait(java.lang.String traitName, java.lang.String value, java.lang.String reqNamespaceURI, java.lang.String reqLocalName, java.lang.String reqTraitNamespace, java.lang.String reqTraitName)Validates the input trait value.
if (SVGConstants.SVG_X1_ATTRIBUTE == traitName
||
SVGConstants.SVG_X2_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y1_ATTRIBUTE == traitName
||
SVGConstants.SVG_Y2_ATTRIBUTE == traitName) {
return new float[][] {{parseFloatTrait(traitName, value)}};
} else {
return super.validateFloatArrayTrait(traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
}
|