| org.netbeans.microedition.svg.SVGPlayer
All known Subclasses: org.netbeans.microedition.svg.SVGAnimatorWrapper,
SVGPlayer | public class SVGPlayer extends Canvas implements CommandListener(Code) | | This class encapsulates SVGAnimator and exposes some of its setters,
so it can be used as a component in NetBeans Visual Designer.
It also adds many utility methods which can be used
to easily manipulate the underlying document of the animated SVG image.
Even though this class extends Canvas, the Canvas is utilized only
for forwarding command actions from Canvas created by SVGAnimator.
author: breh |
Constructor Summary | |
public | SVGPlayer(SVGImage svgImage, Display display) Creates a new instance of SvgAnimatorHelper. |
Method Summary | |
public void | addCommand(Command cmd) | public void | commandAction(Command command, Displayable displayable) | protected float[] | computeAnchorTranslate(SVGRect bbox, int anchor) Computes the translation needed to center the given rectangle about the
desired anchor position.
Parameters: bbox - the object's bounding box, used to compute the translation. Parameters: anchor - the desired anchor position for the translation. | protected SVGAnimator | getAnimator() Gets SVGAnimator created in this player. | public synchronized int | getAnimatorState() | final protected CommandListener | getCommandListener() Gets command listener assigned to this displayable. | protected Display | getDisplay() | public SVGAnimationElement | getSVGAnimationElementById(String id) Gets SVGAnimationElement from the SVGImage used for this SVGPlayer. | public SVGElement | getSVGElementById(String id) Gets SVGElement from the SVGImage used for this SVGPlayer. | public SVGEventListener | getSVGEventListener() | final public SVGImage | getSVGImage() Gets SVGImage used to create this SVGPlayer. | public SVGLocatableElement | getSVGLocatableElementById(String id) Gets SVGLocatableElement from the SVGImage used for this SVGPlayer. | public SVGEventListener | getSafeSVGEventListener() Gets user's "Safe" SVGEventListener which is being called in the
document update thread. | public SVGRect | getScreenBBox(String id) Returns the screen bounding box for the desired element.
Parameters: id - the id of the element whose bounding box is retrieved. | public Canvas | getSvgCanvas() | public Ticker | getTicker() | public float | getTimeIncrement() Gets time increment of the animation. | public String | getTitle() | public void | invokeAndWait(Runnable runnable) Proxy call for SVGAnimator.invokeAndWait() method. | public synchronized void | invokeAndWaitSafely(Runnable runnable) Invokes the input Runnable in the document update thread and returns after
the Runnable has completed. | public void | invokeLater(Runnable runnable) Proxy call for SVGAnimator.invokeLater() method. | public synchronized void | invokeLaterSafely(Runnable runnable) Schedule the input Runnable for execution in the update thread\
at a later time. | public boolean | isResetAnimationWhenStopped() | protected void | paint(Graphics graphics) | public synchronized void | pause() Pauses the animation. | public synchronized void | play() Starts the animation. | public void | removeCommand(Command cmd) | public void | reset() reset the animation, so it starts again from the beginning. | public void | rotate(String id, float angle) Rotates the element with the given id by the given angle. | public void | rotate(SVGElement svgElement, float angle) Rotates the element with the given id by the given angle.
Parameters: svgElement - the element which should be rotated. | public void | rotateAbout(String id, float angle, int anchor) Rotates the element with the given id by the given angle about
the desired anchor point. | public void | rotateAbout(SVGLocatableElement svgLocatableElement, float angle, int anchor) Rotates the element with the given id by the given angle about
the desired anchor point.
Parameters: svgLocatableElement - the element which should be rotated. | public void | rotateAboutSafely(String id, float angle, int anchor) Rotates the element with the given id by the given angle about
the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
This method uses "safe" approach - i.e. | public void | rotateSafely(String id, float angle) Rotates the element with the given id by the given angle.
If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. | public void | scale(String id, float sx, float sy) Scales the element with the specified id by the given factor along the
x and y axis. | public void | scale(SVGElement svgElement, float sx, float sy) Scales the element with the specified id by the given factor along the
x and y axis. | public void | scaleAbout(String id, float sx, float sy, int anchor) Scales the element with the given id about the desired anchor point. | public void | scaleAbout(SVGLocatableElement svgLocatableElement, float sx, float sy, int anchor) Scales the element with the given id about the desired anchor point.
Parameters: svgLocatableElement - element whose trait value should be changed. | public void | scaleAboutSafely(String id, float sx, float sy, int anchor) Scales the element with the given id about the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
This method uses "safe" approach - i.e. | public void | scaleSafely(String id, float sx, float sy) Scales the element with the specified id by the given factor along the
x and y axis. | public void | screenTranslate(String id, float tx, float ty) Translates the element with the specified id by the given amount, in
the screen coordinate space. | public void | screenTranslate(SVGLocatableElement svgLocatableElement, float tx, float ty) Translates the element with the specified id by the given amount, in
the screen coordinate space.
Parameters: svgLocatableElement - the element whose trait value should be changed. | public void | screenTranslateSafely(String id, float tx, float ty) Translates the element with the specified id by the given amount, in
the screen coordinate space. | public void | setCommandListener(CommandListener commandListener) | public void | setFloatTrait(String id, String traitName, float traitValue) Sets the desired trait on the element with the specified identifier. | public void | setFloatTraitSafely(String id, String traitName, float traitValue) Sets the desired trait on the element with the specified identifier. | public void | setFullScreenMode(boolean mode) | public void | setRGBTrait(String id, String traitName, int rgb) Sets the desired RGB value on the element with the specified identifier. | public void | setRGBTrait(String id, String traitName, int r, int g, int b) Sets the desired RGB value on the element with the specified identifier. | public void | setRGBTraitSafely(String id, String traitName, int rgb) Sets the desired RGB value on the element with the specified identifier. | public void | setRGBTraitSafely(String id, String traitName, int r, int g, int b) Sets the desired RGB value on the element with the specified identifier. | public void | setResetAnimationWhenStopped(boolean reset) | public void | setSVGEventListener(SVGEventListener svgEventListener) | public void | setSafeSVGEventListener(SVGEventListener safeSvgEventListener) Sets a user's SVGEventListener to be called in the document update
thread. | public void | setStartAnimationImmediately(boolean startAnimation) | public void | setTicker(Ticker ticker) | public void | setTimeIncrement(float timeIncrement) Sets time increment for the animation. | public void | setTitle(String s) | public void | setTrait(String id, String traitName, String traitValue) Sets the desired trait on the element with the specified identifier. | public void | setTraitSafely(String id, String traitName, String traitValue) Sets the desired trait on the element with the specified identifier. | public void | startAnimation(String elementId) Starts immediately animation on the given animation element. | public void | startAnimation(String elementId, float delay) Starts immediately animation on the given animation element. | public void | startAnimationSafely(String elementId) Starts immediately animation on the given animation element. | public synchronized void | stop() Stops the animation. | public void | stopAnimation(String elementId) Stops animation on the given animation element. | public void | stopAnimation(String elementId, float delay) Stops animation on the given animation element, with given delay. | public void | stopAnimationSafely(String elementId) Stops animation on the given animation element. | public void | translate(String id, float tx, float ty) Translates the element with the specified id by the given amount, in
user space. | public void | translate(SVGElement svgElement, float tx, float ty) Translates the element with the specified id by the given amount, in
user space.
Parameters: svgElement - the element whose trait value should be changed. | public void | translateSafely(String id, float tx, float ty) Translates the element with the specified id by the given amount, in
user space. |
PAUSED | final public static int PAUSED(Code) | | Animator is paused (i.e. when started again, the animation will
continue from the paused state)
|
PLAYING | final public static int PLAYING(Code) | | Animator is running animation
|
STOPPED | final public static int STOPPED(Code) | | Animator is stopped (i.e. when started again, the animation
will start from the beginning)
|
TOP_LEFTTOPTOP_RIGHTLEFTCENTERRIGHTBOTTOM_LEFTBOTTOMBOTTOM_RIGHT | final public static int TOP_LEFTTOPTOP_RIGHTLEFTCENTERRIGHTBOTTOM_LEFTBOTTOMBOTTOM_RIGHT(Code) | | Anchor point constants.
|
SVGPlayer | public SVGPlayer(SVGImage svgImage, Display display) throws IllegalArgumentException(Code) | | Creates a new instance of SvgAnimatorHelper. It requires SVGImage to be animated
and display.
Please note, supplied SVGImage shouldn't be reused in other SVGAnimator.
|
addCommand | public void addCommand(Command cmd)(Code) | | Adds command to the animation canvas (not this canvas)
|
commandAction | public void commandAction(Command command, Displayable displayable)(Code) | | Implementation of CommandListener.commandAction() which forwards
command action from Canvas created by SVGAnimator
to the CommandListener assigned to this component
|
computeAnchorTranslate | protected float[] computeAnchorTranslate(SVGRect bbox, int anchor)(Code) | | Computes the translation needed to center the given rectangle about the
desired anchor position.
Parameters: bbox - the object's bounding box, used to compute the translation. Parameters: anchor - the desired anchor position for the translation. For example,if anchor is "BOTTOM_RIGHT", the returned translation will move thebottom right of the bounding box to the coordinate system's origin. the translation. A float array of size two, with the x-axis translationat index 0 and the y-axis translation at index 1. |
getAnimator | protected SVGAnimator getAnimator()(Code) | | Gets SVGAnimator created in this player. Please use wisely :-)
|
getAnimatorState | public synchronized int getAnimatorState()(Code) | | Returns state of the animation
STOPPED for stopped state, PAUSED for paused state and PLAYING whenthe animation is running. |
getCommandListener | final protected CommandListener getCommandListener()(Code) | | Gets command listener assigned to this displayable. Can be
used by children classes
|
getDisplay | protected Display getDisplay()(Code) | | Gets Display
|
getSVGAnimationElementById | public SVGAnimationElement getSVGAnimationElementById(String id) throws IllegalArgumentException(Code) | | Gets SVGAnimationElement from the SVGImage used for this SVGPlayer.
Parameters: id - an id of the animation element to be obtained SVGAnimationElement corresponding to the given id, or null if there isno such element or the element is not of SVGAnimationElement instance throws: IllegalArgumentException - if the supplied id is null |
getSVGElementById | public SVGElement getSVGElementById(String id) throws IllegalArgumentException(Code) | | Gets SVGElement from the SVGImage used for this SVGPlayer.
Parameters: id - an id of the svg element to be obtained SVGElement corresponding to the given id, or null if there isno such element or the element is not of SVGElement instance throws: IllegalArgumentException - if the supplied id is null |
getSVGEventListener | public SVGEventListener getSVGEventListener()(Code) | | Gets user's SVGEventListener
an instance of the user's SVGEventListener or null if there was no user SVGEvenetListener set. |
getSVGImage | final public SVGImage getSVGImage()(Code) | | Gets SVGImage used to create this SVGPlayer.
SVGImage used to create this object |
getSVGLocatableElementById | public SVGLocatableElement getSVGLocatableElementById(String id) throws IllegalArgumentException(Code) | | Gets SVGLocatableElement from the SVGImage used for this SVGPlayer.
Parameters: id - an id of the svg element to be obtained SVGLocatableElement corresponding to the given id, or null if there isno such element or the element is not of SVGLocatableElement instance throws: IllegalArgumentException - if the supplied id is null |
getSafeSVGEventListener | public SVGEventListener getSafeSVGEventListener()(Code) | | Gets user's "Safe" SVGEventListener which is being called in the
document update thread.
an instance of the user's SVGEventListener being called in the document update thread, or null if there was no user SVGEvenetListener set. |
getScreenBBox | public SVGRect getScreenBBox(String id)(Code) | | Returns the screen bounding box for the desired element.
Parameters: id - the id of the element whose bounding box is retrieved. found screen bounding box or null if the the element with givenwas not found or does not correspond to an instance SVGLocatableElement. |
getSvgCanvas | public Canvas getSvgCanvas()(Code) | | Gets Canvas which was created by the SVGAnimator
|
getTicker | public Ticker getTicker()(Code) | | Gets ticker from the animation canvas (not this canvas)
|
getTimeIncrement | public float getTimeIncrement()(Code) | | Gets time increment of the animation. Proxy call of SVGAnimator.getTimeIncrement().
time increment in seconds. |
getTitle | public String getTitle()(Code) | | Gets title from the animation canvas (not this canvas)
title string |
invokeAndWaitSafely | public synchronized void invokeAndWaitSafely(Runnable runnable)(Code) | | Invokes the input Runnable in the document update thread and returns after
the Runnable has completed. In the case SVGAnimator is in stopped mode or
if the method is being called directly from the document update thread,
the method invokes run() method on runnable directly.
Parameters: runnable - a runnable scheduled for invokation in update thread |
invokeLater | public void invokeLater(Runnable runnable)(Code) | | Proxy call for SVGAnimator.invokeLater() method.
Parameters: runnable - Runnable to be passed to SVGAnimator.invokeLater(runnable) method. |
invokeLaterSafely | public synchronized void invokeLaterSafely(Runnable runnable)(Code) | | Schedule the input Runnable for execution in the update thread\
at a later time. In the case the animator is in stopped mode, the method
invokes the runnable in a separate thread.
Parameters: runnable - a runnable scheduled for invokation in update thread |
isResetAnimationWhenStopped | public boolean isResetAnimationWhenStopped()(Code) | | Should be animation reset whhen stopped
|
paint | protected void paint(Graphics graphics)(Code) | | Dummy paint method - does nothing, because all the rendering is done
by the canvas obtained from SVGAnimator
|
pause | public synchronized void pause()(Code) | | Pauses the animation. Proxy call for SVGAnimator.pause()
|
play | public synchronized void play()(Code) | | Starts the animation. Proxy call for SVGAnimator.play()
|
removeCommand | public void removeCommand(Command cmd)(Code) | | Removes command from the animation canvas (not this canvas)
|
reset | public void reset()(Code) | | reset the animation, so it starts again from the beginning. Can be used in
either when stopped/paused or playing state.
|
rotate | public void rotate(String id, float angle)(Code) | | Rotates the element with the given id by the given angle.
If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element which should be rotated. Parameters: angle - the rotation angle, in degrees |
rotate | public void rotate(SVGElement svgElement, float angle)(Code) | | Rotates the element with the given id by the given angle.
Parameters: svgElement - the element which should be rotated. If null, the operation is not performed. Parameters: angle - the rotation angle, in degrees |
rotateAbout | public void rotateAbout(String id, float angle, int anchor)(Code) | | Rotates the element with the given id by the given angle about
the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
Parameters: id - the id of the element which should be rotated. Parameters: angle - the rotation angle, in degrees Parameters: anchor - the reference point about which to rotate the element. |
rotateAbout | public void rotateAbout(SVGLocatableElement svgLocatableElement, float angle, int anchor)(Code) | | Rotates the element with the given id by the given angle about
the desired anchor point.
Parameters: svgLocatableElement - the element which should be rotated. If null theoperation is not performed. Parameters: angle - the rotation angle, in degrees Parameters: anchor - the reference point about which to rotate the element. |
rotateAboutSafely | public void rotateAboutSafely(String id, float angle, int anchor)(Code) | | Rotates the element with the given id by the given angle about
the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element which should be rotated. Parameters: angle - the rotation angle, in degrees Parameters: anchor - the reference point about which to rotate the element. |
rotateSafely | public void rotateSafely(String id, float angle)(Code) | | Rotates the element with the given id by the given angle.
If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element which should be rotated. Parameters: angle - the rotation angle, in degrees |
scale | public void scale(String id, float sx, float sy)(Code) | | Scales the element with the specified id by the given factor along the
x and y axis. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis |
scale | public void scale(SVGElement svgElement, float sx, float sy)(Code) | | Scales the element with the specified id by the given factor along the
x and y axis.
Parameters: svgElement - element whose trait value should be changed. If null, theoperation is not performed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis |
scaleAbout | public void scaleAbout(String id, float sx, float sy, int anchor)(Code) | | Scales the element with the given id about the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis Parameters: anchor - one of TOP_LEFT, TOP, TOP_RIGHT, LEFT, CENTER, RIGHT,BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT. |
scaleAbout | public void scaleAbout(SVGLocatableElement svgLocatableElement, float sx, float sy, int anchor)(Code) | | Scales the element with the given id about the desired anchor point.
Parameters: svgLocatableElement - element whose trait value should be changed. If nullthe operation is not performed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis Parameters: anchor - one of TOP_LEFT, TOP, TOP_RIGHT, LEFT, CENTER, RIGHT,BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT. |
scaleAboutSafely | public void scaleAboutSafely(String id, float sx, float sy, int anchor)(Code) | | Scales the element with the given id about the desired anchor point.
If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis Parameters: anchor - one of TOP_LEFT, TOP, TOP_RIGHT, LEFT, CENTER, RIGHT,BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT. |
scaleSafely | public void scaleSafely(String id, float sx, float sy)(Code) | | Scales the element with the specified id by the given factor along the
x and y axis. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: sx - the desired scale factor along the x-axis Parameters: sy - the desired scale factor along the y-axis |
screenTranslate | public void screenTranslate(String id, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
the screen coordinate space. If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
screenTranslate | public void screenTranslate(SVGLocatableElement svgLocatableElement, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
the screen coordinate space.
Parameters: svgLocatableElement - the element whose trait value should be changed. If null, the operation is not performed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
screenTranslateSafely | public void screenTranslateSafely(String id, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
the screen coordinate space. If the
element with given ID is not an instance of SVGLocatableElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
setCommandListener | public void setCommandListener(CommandListener commandListener)(Code) | | Sets command listener to this displayable
|
setFloatTrait | public void setFloatTrait(String id, String traitName, float traitValue)(Code) | | Sets the desired trait on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "display" Parameters: traitValue - the value of the trait to set, e.g., "none" |
setFloatTraitSafely | public void setFloatTraitSafely(String id, String traitName, float traitValue)(Code) | | Sets the desired trait on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "display" Parameters: traitValue - the value of the trait to set, e.g., "none" |
setFullScreenMode | public void setFullScreenMode(boolean mode)(Code) | | sets fullscreen mode the animation canvas (not this canvas)
|
setRGBTrait | public void setRGBTrait(String id, String traitName, int rgb)(Code) | | Sets the desired RGB value on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "stroke" or "fill" Parameters: rgb - the color value as an int in the following format 0xXXRRGGBB.The high order byte is ignored. For example, 0xFFFF0000 specifiesred. |
setRGBTrait | public void setRGBTrait(String id, String traitName, int r, int g, int b)(Code) | | Sets the desired RGB value on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "fill" Parameters: r - the desired red component value, in the 0-255 interval Parameters: g - the desired green component value, in the 0-255 interval Parameters: b - the desired blue component value, in the 0-255 interval |
setRGBTraitSafely | public void setRGBTraitSafely(String id, String traitName, int rgb)(Code) | | Sets the desired RGB value on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "stroke" or "fill" Parameters: rgb - the color value as an int in the following format 0xXXRRGGBB.The high order byte is ignored. For example, 0xFFFF0000 specifiesred. |
setRGBTraitSafely | public void setRGBTraitSafely(String id, String traitName, int r, int g, int b)(Code) | | Sets the desired RGB value on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "fill" Parameters: r - the desired red component value, in the 0-255 interval Parameters: g - the desired green component value, in the 0-255 interval Parameters: b - the desired blue component value, in the 0-255 interval |
setResetAnimationWhenStopped | public void setResetAnimationWhenStopped(boolean reset)(Code) | | Sets
|
setSVGEventListener | public void setSVGEventListener(SVGEventListener svgEventListener)(Code) | | Sets a user's SVGEventListener to the SVGAnimator
Parameters: svgEventListener - user SVGEventListener or null if no listener should be set |
setSafeSVGEventListener | public void setSafeSVGEventListener(SVGEventListener safeSvgEventListener)(Code) | | Sets a user's SVGEventListener to be called in the document update
thread.
Parameters: safeSvgEventListener - user SVGEventListener or null if no listener should be set |
setStartAnimationImmediately | public void setStartAnimationImmediately(boolean startAnimation)(Code) | | When set to true, the animation starts immediatelly when
the canvas with animation displayed on the screen
|
setTicker | public void setTicker(Ticker ticker)(Code) | | Sets ticker to the animation canvas (not this canvas)
|
setTimeIncrement | public void setTimeIncrement(float timeIncrement)(Code) | | Sets time increment for the animation. Proxy call for
SVGAnimator.setTimeIncrement()
Parameters: timeIncrement - the minimal time that should ellapse between frame rendering. In seconds. Should be greater than zero. throws: java.lang.IllegalArgumentException - - if timeIncrement is less than or equal to zero. |
setTitle | public void setTitle(String s)(Code) | | Sets title to the animation canvas (not this canvas)
Parameters: s - title String |
setTrait | public void setTrait(String id, String traitName, String traitValue)(Code) | | Sets the desired trait on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Note:This method needs to be called from the document update thread.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "display" Parameters: traitValue - the value of the trait to set, e.g., "none" |
setTraitSafely | public void setTraitSafely(String id, String traitName, String traitValue)(Code) | | Sets the desired trait on the element with the specified identifier. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: traitName - the name of the trait to change, e.g, "display" Parameters: traitValue - the value of the trait to set, e.g., "none" |
startAnimation | public void startAnimation(String elementId)(Code) | | Starts immediately animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
Parameters: elementId - id of the animation element on which the animation should be started throws: IllegalArgumentException - if the elementID does not correspond to a valid SVGAnimationElement |
startAnimation | public void startAnimation(String elementId, float delay)(Code) | | Starts immediately animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
Parameters: elementId - id of the animation element on which the animation should be started Parameters: delay - offset in seconds at which the animation should be started |
startAnimationSafely | public void startAnimationSafely(String elementId)(Code) | | Starts immediately animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: elementId - id of the animation element on which the animation should be started |
stop | public synchronized void stop()(Code) | | Stops the animation. Proxy call for SVGAnimator.stop()
|
stopAnimation | public void stopAnimation(String elementId)(Code) | | Stops animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
Parameters: elementId - id of the animation element on which the animation should be stopped |
stopAnimation | public void stopAnimation(String elementId, float delay)(Code) | | Stops animation on the given animation element, with given delay.
Stops animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
Parameters: elementId - id of the animation element on which the animation should be stopped Parameters: delay - offset in seconds at which the animation should be stopped |
stopAnimationSafely | public void stopAnimationSafely(String elementId)(Code) | | Stops animation on the given animation element. If the given
id does not correspond to a valid animation element, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: elementId - id of the animation element on which the animation should be stopped |
translate | public void translate(String id, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
user space. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
Parameters: id - the id of the element whose trait value should be changed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
translate | public void translate(SVGElement svgElement, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
user space.
Parameters: svgElement - the element whose trait value should be changed. If null,the operation is not performed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
translateSafely | public void translateSafely(String id, float tx, float ty)(Code) | | Translates the element with the specified id by the given amount, in
user space. If the
element with given ID is not an instance of SVGElement, the operation is
not performed.
This method uses "safe" approach - i.e. when it runs in document
update thread it runs directly in the thread, otherwise it is
scheduled using SVGAnimator.invokeAndWait method.
Parameters: id - the id of the element whose trait value should be changed. Parameters: tx - the desired translation along the x-axis Parameters: ty - the desired translation along the y-axis |
|
|