Methods Summary |
---|
public java.lang.String | getTraitImpl(java.lang.String name)AnimateTransform supports the type trait.
Returns the trait value as String. In SVG Tiny only certain traits can be
obtained as a String value. Syntax of the returned String matches the
syntax of the corresponding attribute. This element is exactly equivalent
to {@link org.w3c.dom.svg.SVGElement#getTraitNS getTraitNS} with
namespaceURI set to null.
The method is meant to be overridden by derived classes. The
implementation pattern is that derived classes will override the method
and call their super class' implementation. If the ElementNode
implementation is called, it means that the trait is either not supported
or that it cannot be seen as a String.
if (SVGConstants.SVG_TYPE_ATTRIBUTE == name) {
switch (type) {
case TYPE_TRANSLATE:
return SVGConstants.SVG_TRANSLATE_VALUE;
case TYPE_SCALE:
return SVGConstants.SVG_SCALE_VALUE;
case TYPE_ROTATE:
return SVGConstants.SVG_ROTATE_VALUE;
case TYPE_SKEW_X:
return SVGConstants.SVG_SKEW_X;
case TYPE_SKEW_Y:
default:
return SVGConstants.SVG_SKEW_Y;
}
} else {
return super.getTraitImpl(name);
}
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype TimedElementNode .
return new AnimateTransform(doc);
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)AnimateTransform supports the type trait.
if (SVGConstants.SVG_TYPE_ATTRIBUTE == name) {
checkWriteLoading(name);
if (SVGConstants.SVG_TRANSLATE_VALUE.equals(value)) {
type = TYPE_TRANSLATE;
} else if (SVGConstants.SVG_SCALE_VALUE.equals(value)) {
type = TYPE_SCALE;
} else if (SVGConstants.SVG_ROTATE_VALUE.equals(value)) {
type = TYPE_ROTATE;
} else if (SVGConstants.SVG_SKEW_X.equals(value)) {
type = TYPE_SKEW_X;
} else if (SVGConstants.SVG_SKEW_Y.equals(value)) {
type = TYPE_SKEW_Y;
} else {
throw illegalTraitValue(name, value);
}
} else {
super.setTraitImpl(name, value);
}
|
boolean | supportsTrait(java.lang.String traitName)Supported traits: to, attributeName
if (SVGConstants.SVG_TYPE_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTrait(traitName);
}
|