Package org.apache.batik.anim.dom
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether the parsed number can be a percentage.protected float
The current animated value.protected float
The current base value.protected boolean
Whether the value is changing.protected float
The default value.protected boolean
Whether the base value is valid.Fields inherited from class org.apache.batik.anim.dom.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 TypeMethodDescriptionvoid
Called when an Attr node has been added.void
attrModified
(Attr node, String oldv, String newv) Called when an Attr node has been modified.void
attrRemoved
(Attr node, String oldv) Called when an Attr node has been removed.float
DOM: ImplementsSVGAnimatedNumber.getAnimVal()
.float
DOM: ImplementsSVGAnimatedNumber.getBaseVal()
.getUnderlyingValue
(AnimationTarget target) Returns the base value of the attribute as anAnimatableValue
.void
setBaseVal
(float baseVal) DOM: ImplementsSVGAnimatedNumber.setBaseVal(float)
.protected void
update()
Updates the base value from the attribute.protected void
Updates the animated value with the givenAnimatableValue
.Methods inherited from class org.apache.batik.anim.dom.AbstractSVGAnimatedValue
addAnimatedAttributeListener, fireAnimatedAttributeListeners, fireBaseAttributeListeners, getLocalName, getNamespaceURI, isSpecified, removeAnimatedAttributeListener
-
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:
getBaseVal
in interfaceorg.w3c.dom.svg.SVGAnimatedNumber
-
update
protected void update()Updates the base value from the attribute. -
setBaseVal
DOM: ImplementsSVGAnimatedNumber.setBaseVal(float)
.- Specified by:
setBaseVal
in interfaceorg.w3c.dom.svg.SVGAnimatedNumber
- Throws:
DOMException
-
getAnimVal
public float getAnimVal()DOM: ImplementsSVGAnimatedNumber.getAnimVal()
.- Specified by:
getAnimVal
in interfaceorg.w3c.dom.svg.SVGAnimatedNumber
-
getUnderlyingValue
Returns the base value of the attribute as anAnimatableValue
.- Specified by:
getUnderlyingValue
in interfaceAnimatedLiveAttributeValue
-
updateAnimatedValue
Updates the animated value with the givenAnimatableValue
.- Specified by:
updateAnimatedValue
in classAbstractSVGAnimatedValue
-
attrAdded
Called when an Attr node has been added.- Specified by:
attrAdded
in interfaceLiveAttributeValue
-
attrModified
Called when an Attr node has been modified.- Specified by:
attrModified
in interfaceLiveAttributeValue
-
attrRemoved
Called when an Attr node has been removed.- Specified by:
attrRemoved
in interfaceLiveAttributeValue
-