Java Doc for SVGPlayer.java in  » IDE-Netbeans » vmd.analyzer » org » netbeans » microedition » svg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » vmd.analyzer » org.netbeans.microedition.svg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
final public static  intPAUSED
     Animator is paused (i.e.
final public static  intPLAYING
    
final public static  intSTOPPED
     Animator is stopped (i.e.
final public static  intTOP_LEFTTOPTOP_RIGHTLEFTCENTERRIGHTBOTTOM_LEFTBOTTOMBOTTOM_RIGHT
     Anchor point constants.

Constructor Summary
public  SVGPlayer(SVGImage svgImage, Display display)
     Creates a new instance of SvgAnimatorHelper.

Method Summary
public  voidaddCommand(Command cmd)
    
public  voidcommandAction(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  SVGAnimatorgetAnimator()
     Gets SVGAnimator created in this player.
public synchronized  intgetAnimatorState()
    
final protected  CommandListenergetCommandListener()
     Gets command listener assigned to this displayable.
protected  DisplaygetDisplay()
    
public  SVGAnimationElementgetSVGAnimationElementById(String id)
     Gets SVGAnimationElement from the SVGImage used for this SVGPlayer.
public  SVGElementgetSVGElementById(String id)
     Gets SVGElement from the SVGImage used for this SVGPlayer.
public  SVGEventListenergetSVGEventListener()
    
final public  SVGImagegetSVGImage()
     Gets SVGImage used to create this SVGPlayer.
public  SVGLocatableElementgetSVGLocatableElementById(String id)
     Gets SVGLocatableElement from the SVGImage used for this SVGPlayer.
public  SVGEventListenergetSafeSVGEventListener()
     Gets user's "Safe" SVGEventListener which is being called in the document update thread.
public  SVGRectgetScreenBBox(String id)
     Returns the screen bounding box for the desired element.
Parameters:
  id - the id of the element whose bounding box is retrieved.
public  CanvasgetSvgCanvas()
    
public  TickergetTicker()
    
public  floatgetTimeIncrement()
     Gets time increment of the animation.
public  StringgetTitle()
    
public  voidinvokeAndWait(Runnable runnable)
     Proxy call for SVGAnimator.invokeAndWait() method.
public synchronized  voidinvokeAndWaitSafely(Runnable runnable)
     Invokes the input Runnable in the document update thread and returns after the Runnable has completed.
public  voidinvokeLater(Runnable runnable)
     Proxy call for SVGAnimator.invokeLater() method.
public synchronized  voidinvokeLaterSafely(Runnable runnable)
     Schedule the input Runnable for execution in the update thread\ at a later time.
public  booleanisResetAnimationWhenStopped()
    
protected  voidpaint(Graphics graphics)
    
public synchronized  voidpause()
     Pauses the animation.
public synchronized  voidplay()
     Starts the animation.
public  voidremoveCommand(Command cmd)
    
public  voidreset()
     reset the animation, so it starts again from the beginning.
public  voidrotate(String id, float angle)
     Rotates the element with the given id by the given angle.
public  voidrotate(SVGElement svgElement, float angle)
     Rotates the element with the given id by the given angle.
Parameters:
  svgElement - the element which should be rotated.
public  voidrotateAbout(String id, float angle, int anchor)
     Rotates the element with the given id by the given angle about the desired anchor point.
public  voidrotateAbout(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  voidrotateAboutSafely(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  voidrotateSafely(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  voidscale(String id, float sx, float sy)
     Scales the element with the specified id by the given factor along the x and y axis.
public  voidscale(SVGElement svgElement, float sx, float sy)
     Scales the element with the specified id by the given factor along the x and y axis.
public  voidscaleAbout(String id, float sx, float sy, int anchor)
     Scales the element with the given id about the desired anchor point.
public  voidscaleAbout(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  voidscaleAboutSafely(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  voidscaleSafely(String id, float sx, float sy)
     Scales the element with the specified id by the given factor along the x and y axis.
public  voidscreenTranslate(String id, float tx, float ty)
     Translates the element with the specified id by the given amount, in the screen coordinate space.
public  voidscreenTranslate(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  voidscreenTranslateSafely(String id, float tx, float ty)
     Translates the element with the specified id by the given amount, in the screen coordinate space.
public  voidsetCommandListener(CommandListener commandListener)
    
public  voidsetFloatTrait(String id, String traitName, float traitValue)
     Sets the desired trait on the element with the specified identifier.
public  voidsetFloatTraitSafely(String id, String traitName, float traitValue)
     Sets the desired trait on the element with the specified identifier.
public  voidsetFullScreenMode(boolean mode)
    
public  voidsetRGBTrait(String id, String traitName, int rgb)
     Sets the desired RGB value on the element with the specified identifier.
public  voidsetRGBTrait(String id, String traitName, int r, int g, int b)
     Sets the desired RGB value on the element with the specified identifier.
public  voidsetRGBTraitSafely(String id, String traitName, int rgb)
     Sets the desired RGB value on the element with the specified identifier.
public  voidsetRGBTraitSafely(String id, String traitName, int r, int g, int b)
     Sets the desired RGB value on the element with the specified identifier.
public  voidsetResetAnimationWhenStopped(boolean reset)
    
public  voidsetSVGEventListener(SVGEventListener svgEventListener)
    
public  voidsetSafeSVGEventListener(SVGEventListener safeSvgEventListener)
     Sets a user's SVGEventListener to be called in the document update thread.
public  voidsetStartAnimationImmediately(boolean startAnimation)
    
public  voidsetTicker(Ticker ticker)
    
public  voidsetTimeIncrement(float timeIncrement)
     Sets time increment for the animation.
public  voidsetTitle(String s)
    
public  voidsetTrait(String id, String traitName, String traitValue)
     Sets the desired trait on the element with the specified identifier.
public  voidsetTraitSafely(String id, String traitName, String traitValue)
     Sets the desired trait on the element with the specified identifier.
public  voidstartAnimation(String elementId)
     Starts immediately animation on the given animation element.
public  voidstartAnimation(String elementId, float delay)
     Starts immediately animation on the given animation element.
public  voidstartAnimationSafely(String elementId)
     Starts immediately animation on the given animation element.
public synchronized  voidstop()
     Stops the animation.
public  voidstopAnimation(String elementId)
     Stops animation on the given animation element.
public  voidstopAnimation(String elementId, float delay)
     Stops animation on the given animation element, with given delay.
public  voidstopAnimationSafely(String elementId)
     Stops animation on the given animation element.
public  voidtranslate(String id, float tx, float ty)
     Translates the element with the specified id by the given amount, in user space.
public  voidtranslate(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  voidtranslateSafely(String id, float tx, float ty)
     Translates the element with the specified id by the given amount, in user space.

Field Detail
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.




Constructor Detail
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.





Method Detail
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



invokeAndWait
public void invokeAndWait(Runnable runnable) throws InterruptedException(Code)
Proxy call for SVGAnimator.invokeAndWait() method.
Parameters:
  runnable - Runnable to be passed to SVGAnimator.invokeAndWait(runnable) method.
throws:
  java.lang.InterruptedException -



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




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.