Package com.kitfox.svg.animation
Class AnimationElement
- java.lang.Object
-
- com.kitfox.svg.SVGElement
-
- com.kitfox.svg.animation.AnimationElement
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AnimateBase
,SetSmil
public abstract class AnimationElement extends SVGElement
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
AC_REPLACE
Accumlative statestatic int
AC_SUM
private int
accumulateType
static int
AD_REPLACE
Additive state of trackstatic int
AD_SUM
private int
additiveType
static int
AT_AUTO
static int
AT_CSS
static int
AT_XML
protected java.lang.String
attribName
protected int
attribType
private TimeBase
beginTime
private TimeBase
durTime
private TimeBase
endTime
private int
fillType
static int
FT_AUTO
static int
FT_DEFAULT
static int
FT_FREEZE
static int
FT_HOLD
static int
FT_REMOVE
static int
FT_TRANSITION
-
Fields inherited from class com.kitfox.svg.SVGElement
children, cssClass, diagram, id, ignorePresAttrib, inlineStyles, parent, presAttribs, serialVersionUID, SVG_NS, trackManager, xmlBase
-
-
Constructor Summary
Constructors Constructor Description AnimationElement()
Creates a new instance of AnimateEle
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
animationElementToString(int attrValue)
(package private) double
evalDurTime()
(package private) double
evalEndTime()
Evaluates the ending time of this element.void
evalParametric(AnimationTimeEval state, double curTime)
protected void
evalParametric(AnimationTimeEval state, double curTime, double repeatCount, double repeatDur)
Compares current time to start and end times and determines what degree of time interpolation this track currently represents.(package private) double
evalStartTime()
int
getAccumulateType()
int
getAdditiveType()
java.lang.String
getAttribName()
int
getAttribType()
TimeBase
getBeginTime()
TimeBase
getDurTime()
TimeBase
getEndTime()
int
getFillType()
(package private) boolean
hasEndTime()
Checks to see if an end time has been specified for this element.void
loaderStartElement(SVGLoaderHelper helper, org.xml.sax.Attributes attrs, SVGElement parent)
Called during SAX load process to notify that this tag has begun the process of being loadedvoid
rebuild()
protected void
rebuild(AnimTimeParser animTimeParser)
void
setAccumulateType(int accumulateType)
void
setAdditiveType(int additiveType)
void
setBeginTime(TimeBase beginTime)
void
setDurTime(TimeBase durTime)
void
setEndTime(TimeBase endTime)
void
setFillType(int fillType)
boolean
updateTime(double curTime)
Updates all attributes in this diagram associated with a time event.-
Methods inherited from class com.kitfox.svg.SVGElement
addAttribute, build, buildPath, getChild, getChild, getChildren, getId, getInlineAttributes, getNumChildren, getParent, getParentContext, getPath, getPres, getPresAbsolute, getPresentationAttributes, getRoot, getStyle, getStyle, getStyle, getStyleAbsolute, getTagName, getXMLBase, hasAttribute, indexOfChild, lerp, loaderAddChild, loaderAddText, loaderEndElement, nextFloat, parsePathList, parseSingleTransform, parseTransform, popParentContext, pushParentContext, removeAttribute, removeChild, setAttribute, setDiagram, swapChildren
-
-
-
-
Field Detail
-
attribName
protected java.lang.String attribName
-
attribType
protected int attribType
-
AT_CSS
public static final int AT_CSS
- See Also:
- Constant Field Values
-
AT_XML
public static final int AT_XML
- See Also:
- Constant Field Values
-
AT_AUTO
public static final int AT_AUTO
- See Also:
- Constant Field Values
-
beginTime
private TimeBase beginTime
-
durTime
private TimeBase durTime
-
endTime
private TimeBase endTime
-
fillType
private int fillType
-
FT_REMOVE
public static final int FT_REMOVE
- See Also:
- Constant Field Values
-
FT_FREEZE
public static final int FT_FREEZE
- See Also:
- Constant Field Values
-
FT_HOLD
public static final int FT_HOLD
- See Also:
- Constant Field Values
-
FT_TRANSITION
public static final int FT_TRANSITION
- See Also:
- Constant Field Values
-
FT_AUTO
public static final int FT_AUTO
- See Also:
- Constant Field Values
-
FT_DEFAULT
public static final int FT_DEFAULT
- See Also:
- Constant Field Values
-
AD_REPLACE
public static final int AD_REPLACE
Additive state of track- See Also:
- Constant Field Values
-
AD_SUM
public static final int AD_SUM
- See Also:
- Constant Field Values
-
additiveType
private int additiveType
-
AC_REPLACE
public static final int AC_REPLACE
Accumlative state- See Also:
- Constant Field Values
-
AC_SUM
public static final int AC_SUM
- See Also:
- Constant Field Values
-
accumulateType
private int accumulateType
-
-
Method Detail
-
animationElementToString
public static java.lang.String animationElementToString(int attrValue)
-
loaderStartElement
public void loaderStartElement(SVGLoaderHelper helper, org.xml.sax.Attributes attrs, SVGElement parent) throws org.xml.sax.SAXException
Description copied from class:SVGElement
Called during SAX load process to notify that this tag has begun the process of being loaded- Overrides:
loaderStartElement
in classSVGElement
- Parameters:
helper
- - An object passed to all SVG elements involved in this build process to aid in sharing information.attrs
- - Attributes of this tag- Throws:
org.xml.sax.SAXException
-
getAttribName
public java.lang.String getAttribName()
-
getAttribType
public int getAttribType()
-
getAdditiveType
public int getAdditiveType()
-
getAccumulateType
public int getAccumulateType()
-
evalParametric
public void evalParametric(AnimationTimeEval state, double curTime)
-
evalParametric
protected void evalParametric(AnimationTimeEval state, double curTime, double repeatCount, double repeatDur)
Compares current time to start and end times and determines what degree of time interpolation this track currently represents. Returns Float.NaN if this track cannot be evaluated at the passed time (ie, it is before or past the end of the track, or it depends upon an unknown event)- Parameters:
state
- - A structure that will be filled with information regarding the applicability of this animatoin element at the passed time.curTime
- - Current time in secondsrepeatCount
- - Optional number of repetitions of length 'dur' to do. Set to Double.NaN to not consider this in the calculation.repeatDur
- - Optional amoun tof time to repeat the animaiton. Set to Double.NaN to not consider this in the calculation.
-
evalStartTime
double evalStartTime()
-
evalDurTime
double evalDurTime()
-
evalEndTime
double evalEndTime()
Evaluates the ending time of this element. Returns 0 if not specified.- See Also:
hasEndTime()
-
hasEndTime
boolean hasEndTime()
Checks to see if an end time has been specified for this element.
-
updateTime
public boolean updateTime(double curTime)
Updates all attributes in this diagram associated with a time event. Ie, all attributes with track information.- Specified by:
updateTime
in classSVGElement
- Returns:
- - true if this node has changed state as a result of the time update
-
rebuild
public void rebuild() throws SVGException
- Throws:
SVGException
-
rebuild
protected void rebuild(AnimTimeParser animTimeParser) throws SVGException
- Throws:
SVGException
-
getBeginTime
public TimeBase getBeginTime()
- Returns:
- the beginTime
-
setBeginTime
public void setBeginTime(TimeBase beginTime)
- Parameters:
beginTime
- the beginTime to set
-
getDurTime
public TimeBase getDurTime()
- Returns:
- the durTime
-
setDurTime
public void setDurTime(TimeBase durTime)
- Parameters:
durTime
- the durTime to set
-
getEndTime
public TimeBase getEndTime()
- Returns:
- the endTime
-
setEndTime
public void setEndTime(TimeBase endTime)
- Parameters:
endTime
- the endTime to set
-
getFillType
public int getFillType()
- Returns:
- the fillType
-
setFillType
public void setFillType(int fillType)
- Parameters:
fillType
- the fillType to set
-
setAdditiveType
public void setAdditiveType(int additiveType)
- Parameters:
additiveType
- the additiveType to set
-
setAccumulateType
public void setAccumulateType(int accumulateType)
- Parameters:
accumulateType
- the accumulateType to set
-
-