| java.lang.Object org.apache.batik.anim.timing.TimedElement
All known Subclasses: org.apache.batik.anim.timing.TimeContainer,
TimedElement | abstract public class TimedElement implements SMILConstants(Code) | | An abstract base class for elements that can have timing applied to them.
The concrete versions of this class do not necessarily have to be the
same as the DOM class, and in fact, this will mostly be impossible unless
creating new DOM classes that inherit from these elements.
author: Cameron McCormack version: $Id: TimedElement.java 522271 2007-03-25 14:42:45Z dvholten $ |
Constructor Summary | |
public | TimedElement() Creates a new TimedElement. |
Method Summary | |
protected void | addDependent(TimingSpecifier dependent, boolean forBegin) Adds a dependent TimingSpecifier for this element. | protected float | addInstanceTime(InstanceTime time, boolean isBegin) Called by a TimingSpecifier of this element when a new
InstanceTime is created. | public void | beginElement() Adds a time to the begin time instance list that will cause
the element to begin immediately (if restart semantics allow it). | public void | beginElement(float offset) Adds a time to the begin time instance list that will cause
the element to begin at some offset to the current time (if restart
semantics allow it). | public boolean | canBegin() Returns whether this element can be begun or restarted currently. | public boolean | canEnd() Returns whether this element can be ended currently. | protected Interval | computeInterval(boolean first, boolean fixedBegin, float beginAfter) Computes an interval from the begin and end instance time lists. | public AnimationException | createException(String code, Object[] params) Creates and returns a new
AnimationException . | public void | deinitialize() Deinitializes this timed element. | public void | endElement() Adds a time to the end time instance list that will cause
the element to end immediately (if restart semantics allow it). | public void | endElement(float offset) Adds a time to the end time instance list that will cause
the element to end at some offset to the current time (if restart
semantics allow it). | protected boolean | endHasEventConditions() Returns whether the end timing specifier list contains any eventbase,
accesskey or repeat timing specifiers. | void | eventOccurred(TimingSpecifier t, Event e) Invoked by a
TimingSpecifier to indicate that an event occurred
that would create a new instance time for this timed element. | protected void | fireTimeEvent(String eventType, float time, int detail) Fires a TimeEvent of the given type on this element. | abstract protected void | fireTimeEvent(String eventType, Calendar time, int detail) Fires a TimeEvent of the given type on this element. | public static String | formatMessage(String key, Object[] args) Implements
org.apache.batik.i18n.Localizable.formatMessage(StringObject[]) . | public float | getActiveDur(float B, float end) Returns the active duration time of this element. | public float | getActiveTime() Returns the current active time of this element. | abstract protected EventTarget | getAnimationEventTarget() Returns the target of this animation as an
EventTarget . | public float | getCurrentBeginTime() Returns the begin time of the current interval, in parent simple time,
or Float.NaN if the element is not active. | abstract public Element | getElement() Returns the DOM element that corresponds to this timed element, if
such a DOM element exists. | abstract protected EventTarget | getEventTargetById(String id) Returns the event target with the given ID. | protected float | getImplicitDur() Returns the implicit duration of the element. | public float | getLastSampleTime() Returns the last sample time of this element, in local active time. | public static Locale | getLocale() Implements
org.apache.batik.i18n.Localizable.getLocale . | public TimedDocumentRoot | getRoot() Returns the root time container of this timed element. | abstract protected EventTarget | getRootEventTarget() Returns the event target that should be listened to for
access key events. | public float | getSimpleDur() Returns the simple duration time of this element. | public float | getSimpleTime() Returns the current simple time of this element. | abstract protected TimedElement | getTimedElementById(String id) Returns the timed element with the given ID. | public void | initialize() Initializes this timed element. | protected float | instanceTimeChanged(InstanceTime time, boolean isBegin) Called by a TimingSpecifier of this element when an InstanceTime
has been updated. | abstract public boolean | isBefore(TimedElement other) Returns whether this timed element comes before the given timed element
in document order. | abstract protected boolean | isConstantAnimation() Returns whether this timed element is for a constant animation (i.e., a
'set' animation. | public static boolean | isUnresolved(float t) Returns whether the given time value is equal to the
TimedElement.UNRESOLVED value. | protected float | maxTime(float t1, float t2) Returns the maximum of two time values. | protected float | minTime(float t1, float t2) Returns the minimum of two time values. | protected float | minusTime(float t1, float t2) Subtracts one simple time from another. | protected float | multiplyTime(float t, float n) Multiplies one simple time by n. | protected float | notifyNewInterval(Interval interval) Notifies dependents of a new interval. | protected float | notifyRemoveInterval(Interval interval) Notifies dependents of a removed interval. | public void | parseAttributes(String begin, String dur, String end, String min, String max, String repeatCount, String repeatDur, String fill, String restart) Parses the animation attributes for this timed element. | protected void | parseBegin(String begin) Parses a new 'begin' attribute. | protected float | parseClockValue(String s, boolean parseOffset) Parses a clock value or offset and returns it as a float. | protected void | parseDur(String dur) Parses a new 'dur' attribute. | protected void | parseEnd(String end) Parses a new 'end' attribute. | protected void | parseFill(String fill) Parses a new 'fill' attribute. | protected void | parseMax(String max) Parses a new 'max' attribute. | protected void | parseMin(String min) Parses a new 'min' attribute. | protected void | parseRepeatCount(String repeatCount) Parses a new 'repeatCount' attribute. | protected void | parseRepeatDur(String repeatDur) Parses a new 'repeatDur' attribute. | protected void | parseRestart(String restart) Parses a new 'restart' attribute. | protected void | removeDependent(TimingSpecifier dependent, boolean forBegin) Removes a dependent TimingSpecifier for this element. | abstract protected void | removeFill() Invoked to indicate that this timed element has had its fill removed. | protected float | removeInstanceTime(InstanceTime time, boolean isBegin) Called by a TimingSpecifier of this element when an InstanceTime
should be removed. | protected void | reset(boolean clearCurrentBegin) Resets this element. | protected float | sampleAt(float parentSimpleTime, boolean hyperlinking) Calculates the local simple time. | abstract protected void | sampledAt(float simpleTime, float simpleDur, int repeatIteration) Invoked to indicate that this timed element has been sampled at the
given time. | abstract protected void | sampledLastValue(int repeatIteration) Invoked to indicate that this timed element has been sampled
at the end of its active time, at an integer multiple of the
simple duration. | protected float | selectNewInterval(float time, Interval interval) Sets the current interval to the one specified. | public static void | setLocale(Locale l) Implements
org.apache.batik.i18n.Localizable.setLocale(java.util.Locale) . | abstract protected void | toActive(float begin) Invoked to indicate this timed element became active at the
specified time. | abstract protected void | toInactive(boolean stillActive, boolean isFrozen) Invoked to indicate that this timed element became inactive. | public static String | toString(float time) Returns a string representation of the given time value. |
FILL_FREEZE | final public static int FILL_FREEZE(Code) | | |
FILL_REMOVE | final public static int FILL_REMOVE(Code) | | |
INDEFINITE | final public static float INDEFINITE(Code) | | |
RESOURCES | final protected static String RESOURCES(Code) | | The error messages bundle class name.
|
RESTART_ALWAYS | final public static int RESTART_ALWAYS(Code) | | |
RESTART_NEVER | final public static int RESTART_NEVER(Code) | | |
RESTART_WHEN_NOT_ACTIVE | final public static int RESTART_WHEN_NOT_ACTIVE(Code) | | |
UNRESOLVED | final public static float UNRESOLVED(Code) | | |
beginDependents | protected LinkedList beginDependents(Code) | | List of TimingSpecifiers on other elements that depend on this
element's begin times.
|
beginInstanceTimes | protected List beginInstanceTimes(Code) | | List of begin InstanceTimes.
|
beginTimes | protected TimingSpecifier[] beginTimes(Code) | | Timing specifiers for the begin times of this element.
|
currentInterval | protected Interval currentInterval(Code) | | The current Interval.
|
currentRepeatIteration | protected int currentRepeatIteration(Code) | | The current repeat iteration.
|
durMedia | protected boolean durMedia(Code) | | Whether the simple duration of this element should be equal
to the implicit duration.
|
endDependents | protected LinkedList endDependents(Code) | | List of TimingSpecifiers on other elements that depend on this
element's end times.
|
endInstanceTimes | protected List endInstanceTimes(Code) | | List of end InstanceTimes.
|
fillMode | protected int fillMode(Code) | | The fill mode for this element. Uses the FILL_* constants
defined in this class.
|
hasParsed | protected boolean hasParsed(Code) | | Whether this timed element has parsed its timing attributes yet.
|
hasPropagated | protected boolean hasPropagated(Code) | | Whether an instance time update message has already been propagated to
this timed element.
|
isActive | protected boolean isActive(Code) | | Whether the element is currently active.
|
isFrozen | protected boolean isFrozen(Code) | | Whether the element is currently frozen.
|
isSampling | protected boolean isSampling(Code) | | Whether this timed element is currently being sampled.
|
lastRepeatTime | protected float lastRepeatTime(Code) | | The local active time of the last repeat.
|
lastSampleTime | protected float lastSampleTime(Code) | | The current time of this element in local active time.
|
localizableSupport | protected static LocalizableSupport localizableSupport(Code) | | The localizable support for the error messages.
|
maxMedia | protected boolean maxMedia(Code) | | Whether the max value was specified as 'media'.
|
minMedia | protected boolean minMedia(Code) | | Whether the min value was specified as 'media'.
|
previousIntervals | protected LinkedList previousIntervals(Code) | | List of previous intervals.
|
repeatDuration | protected float repeatDuration(Code) | | The computed repeat duration of the element.
|
restartMode | protected int restartMode(Code) | | The restart mode for this element. Uses the RESTART_* constants
defined in this class.
|
shouldUpdateCurrentInterval | protected boolean shouldUpdateCurrentInterval(Code) | | Whether the list of instance times should be checked to update
the current interval.
|
TimedElement | public TimedElement()(Code) | | Creates a new TimedElement.
|
addDependent | protected void addDependent(TimingSpecifier dependent, boolean forBegin)(Code) | | Adds a dependent TimingSpecifier for this element.
|
addInstanceTime | protected float addInstanceTime(InstanceTime time, boolean isBegin)(Code) | | Called by a TimingSpecifier of this element when a new
InstanceTime is created. This will be in response to an event
firing, a DOM method being called or a new Instance being
created by a syncbase element.
|
beginElement | public void beginElement()(Code) | | Adds a time to the begin time instance list that will cause
the element to begin immediately (if restart semantics allow it).
|
beginElement | public void beginElement(float offset)(Code) | | Adds a time to the begin time instance list that will cause
the element to begin at some offset to the current time (if restart
semantics allow it).
|
canBegin | public boolean canBegin()(Code) | | Returns whether this element can be begun or restarted currently.
|
canEnd | public boolean canEnd()(Code) | | Returns whether this element can be ended currently.
|
computeInterval | protected Interval computeInterval(boolean first, boolean fixedBegin, float beginAfter)(Code) | | Computes an interval from the begin and end instance time lists.
Parameters: first - indicates whether this is the first interval to compute Parameters: fixedBegin - if true, specifies that the value given for beginAfter is taken to be the actual begintime for the interval; only the end value is computed. Parameters: beginAfter - the earliest possible begin time for the computedinterval. |
deinitialize | public void deinitialize()(Code) | | Deinitializes this timed element.
|
endElement | public void endElement()(Code) | | Adds a time to the end time instance list that will cause
the element to end immediately (if restart semantics allow it).
|
endElement | public void endElement(float offset)(Code) | | Adds a time to the end time instance list that will cause
the element to end at some offset to the current time (if restart
semantics allow it).
|
endHasEventConditions | protected boolean endHasEventConditions()(Code) | | Returns whether the end timing specifier list contains any eventbase,
accesskey or repeat timing specifiers.
|
eventOccurred | void eventOccurred(TimingSpecifier t, Event e)(Code) | | Invoked by a
TimingSpecifier to indicate that an event occurred
that would create a new instance time for this timed element. These
will be processed at the beginning of the next tick.
|
fireTimeEvent | protected void fireTimeEvent(String eventType, float time, int detail)(Code) | | Fires a TimeEvent of the given type on this element.
Parameters: eventType - the type of TimeEvent ("beginEvent", "endEvent"or "repeatEvent"). Parameters: time - the timestamp of the event object Parameters: detail - the repeat iteration, if this event is a repeat event |
fireTimeEvent | abstract protected void fireTimeEvent(String eventType, Calendar time, int detail)(Code) | | Fires a TimeEvent of the given type on this element.
Parameters: eventType - the type of TimeEvent ("beginEvent", "endEvent"or "repeatEvent"). Parameters: time - the timestamp of the event object |
getActiveDur | public float getActiveDur(float B, float end)(Code) | | Returns the active duration time of this element.
|
getActiveTime | public float getActiveTime()(Code) | | Returns the current active time of this element.
|
getAnimationEventTarget | abstract protected EventTarget getAnimationEventTarget()(Code) | | Returns the target of this animation as an
EventTarget . Used
for eventbase timing specifiers where the element ID is omitted.
|
getCurrentBeginTime | public float getCurrentBeginTime()(Code) | | Returns the begin time of the current interval, in parent simple time,
or Float.NaN if the element is not active.
|
getElement | abstract public Element getElement()(Code) | | Returns the DOM element that corresponds to this timed element, if
such a DOM element exists.
|
getEventTargetById | abstract protected EventTarget getEventTargetById(String id)(Code) | | Returns the event target with the given ID.
|
getImplicitDur | protected float getImplicitDur()(Code) | | Returns the implicit duration of the element. Currently, nested time
containers are not supported by SVG so this just returns
TimedElement.UNRESOLVED by default. This should be overriden in derived
classes that play media, since they will have an implicit duration.
|
getLastSampleTime | public float getLastSampleTime()(Code) | | Returns the last sample time of this element, in local active time.
|
getRootEventTarget | abstract protected EventTarget getRootEventTarget()(Code) | | Returns the event target that should be listened to for
access key events.
|
getSimpleDur | public float getSimpleDur()(Code) | | Returns the simple duration time of this element.
|
getSimpleTime | public float getSimpleTime()(Code) | | Returns the current simple time of this element.
|
getTimedElementById | abstract protected TimedElement getTimedElementById(String id)(Code) | | Returns the timed element with the given ID.
|
initialize | public void initialize()(Code) | | Initializes this timed element.
|
instanceTimeChanged | protected float instanceTimeChanged(InstanceTime time, boolean isBegin)(Code) | | Called by a TimingSpecifier of this element when an InstanceTime
has been updated. This will be in response to a dependent
syncbase change.
|
isBefore | abstract public boolean isBefore(TimedElement other)(Code) | | Returns whether this timed element comes before the given timed element
in document order.
|
isConstantAnimation | abstract protected boolean isConstantAnimation()(Code) | | Returns whether this timed element is for a constant animation (i.e., a
'set' animation.
|
isUnresolved | public static boolean isUnresolved(float t)(Code) | | Returns whether the given time value is equal to the
TimedElement.UNRESOLVED value.
|
maxTime | protected float maxTime(float t1, float t2)(Code) | | Returns the maximum of two time values.
|
minTime | protected float minTime(float t1, float t2)(Code) | | Returns the minimum of two time values.
|
minusTime | protected float minusTime(float t1, float t2)(Code) | | Subtracts one simple time from another.
|
multiplyTime | protected float multiplyTime(float t, float n)(Code) | | Multiplies one simple time by n.
|
notifyNewInterval | protected float notifyNewInterval(Interval interval)(Code) | | Notifies dependents of a new interval.
|
notifyRemoveInterval | protected float notifyRemoveInterval(Interval interval)(Code) | | Notifies dependents of a removed interval.
|
parseBegin | protected void parseBegin(String begin)(Code) | | Parses a new 'begin' attribute.
|
parseClockValue | protected float parseClockValue(String s, boolean parseOffset) throws ParseException(Code) | | Parses a clock value or offset and returns it as a float.
|
parseDur | protected void parseDur(String dur)(Code) | | Parses a new 'dur' attribute.
|
parseEnd | protected void parseEnd(String end)(Code) | | Parses a new 'end' attribute.
|
parseFill | protected void parseFill(String fill)(Code) | | Parses a new 'fill' attribute.
|
parseMax | protected void parseMax(String max)(Code) | | Parses a new 'max' attribute.
|
parseMin | protected void parseMin(String min)(Code) | | Parses a new 'min' attribute.
|
parseRepeatCount | protected void parseRepeatCount(String repeatCount)(Code) | | Parses a new 'repeatCount' attribute.
|
parseRepeatDur | protected void parseRepeatDur(String repeatDur)(Code) | | Parses a new 'repeatDur' attribute.
|
parseRestart | protected void parseRestart(String restart)(Code) | | Parses a new 'restart' attribute.
|
removeDependent | protected void removeDependent(TimingSpecifier dependent, boolean forBegin)(Code) | | Removes a dependent TimingSpecifier for this element.
|
removeFill | abstract protected void removeFill()(Code) | | Invoked to indicate that this timed element has had its fill removed.
|
removeInstanceTime | protected float removeInstanceTime(InstanceTime time, boolean isBegin)(Code) | | Called by a TimingSpecifier of this element when an InstanceTime
should be removed. This will be in response to the pruning of an
Interval.
|
reset | protected void reset(boolean clearCurrentBegin)(Code) | | Resets this element.
|
sampleAt | protected float sampleAt(float parentSimpleTime, boolean hyperlinking)(Code) | | Calculates the local simple time. Currently the hyperlinking parameter
is ignored, so DOM timing events are fired during hyperlinking seeks.
If we were following SMIL 2.1 rather than SMIL Animation, then these
events would have to be surpressed.
the number of seconds until this element becomes active againif it currently is not, Float.POSITIVE_INFINITY if thiselement will become active at some undetermined point in thefuture (because of unresolved begin times, for example) orwill never become active again, or 0f if theelement is currently active. |
sampledAt | abstract protected void sampledAt(float simpleTime, float simpleDur, int repeatIteration)(Code) | | Invoked to indicate that this timed element has been sampled at the
given time.
Parameters: simpleTime - the sample time in local simple time Parameters: simpleDur - the simple duration of the element Parameters: repeatIteration - the repeat iteration during which the elementwas sampled |
sampledLastValue | abstract protected void sampledLastValue(int repeatIteration)(Code) | | Invoked to indicate that this timed element has been sampled
at the end of its active time, at an integer multiple of the
simple duration. This is the "last" value that will be used
for filling, which cannot be sampled normally.
|
selectNewInterval | protected float selectNewInterval(float time, Interval interval)(Code) | | Sets the current interval to the one specified. This will notify
dependents and fire the 'begin' and any necessary 'repeat' events.
Parameters: time - the current sampling time Parameters: interval - the Interval object to select to be current the minimum time the animation engine can safely wait, asdetermined by dependents of the interval |
toActive | abstract protected void toActive(float begin)(Code) | | Invoked to indicate this timed element became active at the
specified time.
Parameters: begin - the time the element became active, in document simple time |
toInactive | abstract protected void toInactive(boolean stillActive, boolean isFrozen)(Code) | | Invoked to indicate that this timed element became inactive.
Parameters: stillActive - if true, indicates that the element is still actuallyactive, but between the end of the computed repeatduration and the end of the interval Parameters: isFrozen - whether the element is frozen or not |
toString | public static String toString(float time)(Code) | | Returns a string representation of the given time value.
|
|
|