Class SVGOMAnimatedNumber
java.lang.Object
org.apache.batik.anim.dom.AbstractSVGAnimatedValue
org.apache.batik.anim.dom.SVGOMAnimatedNumber
- All Implemented Interfaces:
AnimatedLiveAttributeValue, LiveAttributeValue, org.w3c.dom.svg.SVGAnimatedNumber
public class SVGOMAnimatedNumber
extends AbstractSVGAnimatedValue
implements org.w3c.dom.svg.SVGAnimatedNumber
This class implements the
SVGAnimatedNumber interface.- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether the parsed number can be a percentage.protected floatThe current animated value.protected floatThe current base value.protected booleanWhether the value is changing.protected floatThe default value.protected booleanWhether the base value is valid.Fields inherited from class AbstractSVGAnimatedValue
element, hasAnimVal, listeners, localName, namespaceURI -
Constructor Summary
ConstructorsConstructorDescriptionSVGOMAnimatedNumber(AbstractElement elt, String ns, String ln, float val) Creates a new SVGOMAnimatedNumber.SVGOMAnimatedNumber(AbstractElement elt, String ns, String ln, float val, boolean allowPercentage) Creates a new SVGOMAnimatedNumber possibly parsing it as a percentage. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when an Attr node has been added.voidattrModified(Attr node, String oldv, String newv) Called when an Attr node has been modified.voidattrRemoved(Attr node, String oldv) Called when an Attr node has been removed.floatDOM: ImplementsSVGAnimatedNumber.getAnimVal().floatDOM: ImplementsSVGAnimatedNumber.getBaseVal().getUnderlyingValue(AnimationTarget target) Returns the base value of the attribute as anAnimatableValue.voidsetBaseVal(float baseVal) DOM: ImplementsSVGAnimatedNumber.setBaseVal(float).protected voidupdate()Updates the base value from the attribute.protected voidUpdates the animated value with the givenAnimatableValue.
-
Field Details
-
defaultValue
protected float defaultValueThe default value. -
allowPercentage
protected boolean allowPercentageWhether the parsed number can be a percentage. -
valid
protected boolean validWhether the base value is valid. -
baseVal
protected float baseValThe current base value. -
animVal
protected float animValThe current animated value. -
changing
protected boolean changingWhether the value is changing.
-
-
Constructor Details
-
SVGOMAnimatedNumber
Creates a new SVGOMAnimatedNumber.- Parameters:
elt- The associated element.ns- The attribute's namespace URI.ln- The attribute's local name.val- The default value, if the attribute is not specified.
-
SVGOMAnimatedNumber
public SVGOMAnimatedNumber(AbstractElement elt, String ns, String ln, float val, boolean allowPercentage) Creates a new SVGOMAnimatedNumber possibly parsing it as a percentage.- Parameters:
elt- The associated element.ns- The attribute's namespace URI.ln- The attribute's local name.val- The default value, if the attribute is not specified.allowPercentage- Allows number specified as a percentage.
-
-
Method Details
-
getBaseVal
public float getBaseVal()DOM: ImplementsSVGAnimatedNumber.getBaseVal().- Specified by:
getBaseValin interfaceorg.w3c.dom.svg.SVGAnimatedNumber
-
update
protected void update()Updates the base value from the attribute. -
setBaseVal
DOM: ImplementsSVGAnimatedNumber.setBaseVal(float).- Specified by:
setBaseValin interfaceorg.w3c.dom.svg.SVGAnimatedNumber- Throws:
DOMException
-
getAnimVal
public float getAnimVal()DOM: ImplementsSVGAnimatedNumber.getAnimVal().- Specified by:
getAnimValin interfaceorg.w3c.dom.svg.SVGAnimatedNumber
-
getUnderlyingValue
Returns the base value of the attribute as anAnimatableValue.- Specified by:
getUnderlyingValuein interfaceAnimatedLiveAttributeValue
-
updateAnimatedValue
Updates the animated value with the givenAnimatableValue.- Specified by:
updateAnimatedValuein classAbstractSVGAnimatedValue
-
attrAdded
Called when an Attr node has been added.- Specified by:
attrAddedin interfaceLiveAttributeValue
-
attrModified
Called when an Attr node has been modified.- Specified by:
attrModifiedin interfaceLiveAttributeValue
-
attrRemoved
Called when an Attr node has been removed.- Specified by:
attrRemovedin interfaceLiveAttributeValue
-