Java Doc for SVGCanvas.java in  » 6.0-JDK-Modules » j2me » com » sun » perseus » midp » 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 » 6.0 JDK Modules » j2me » com.sun.perseus.midp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.microedition.lcdui.Canvas
   com.sun.perseus.midp.SVGCanvas

SVGCanvas
class SVGCanvas extends Canvas implements CanvasUpdateListener(Code)
This class provides support for an LCDUI Canvas extension which can display an SVG Document.
version:
   $Id: SVGCanvas.java,v 1.16 2006/04/21 06:40:56 st125089 Exp $


Field Summary
final public static  intCLEAR_COLOR
     Color used to clear the canvas' background.
final public static  intSMIL_ANIMATION_FRAME_LENGTH
    
final public static  intSTATE_PAUSED
     Paused state, i.e., repainting buffer but no longer advancing the time.
final public static  intSTATE_PLAYING
     Playing state, i.e., playing animations and repainting buffer.
final public static  intSTATE_STOPPED
     Initial state.
protected  SimpleCanvasManagercanvasManager
     The SimpleCanvasManager manages the area where the SVG content is rendered.
protected  SMILSample.DocumentWallClockclock
     The animation clock.
protected  DocumentNodedocumentNode
    
protected  GraphicsSurfaceDestinationgsd
     Used to blit the offscreen onto the graphics destination.
protected  ModelNodelastMouseTarget
     The last mouse event target.
protected  booleanlastWasPressed
     True if the last pointer event was a pointer pressed event.
protected  intlastX
     Last x position on a pointer pressed event.
protected  intlastY
     Last y position on a pointer pressed event.
protected  NativeSurfaceoffscreen
    
protected  intoffscreenHeight
    
protected  intoffscreenWidth
    
protected  PiscesRendererpr
     The PiscesRenderer associated with the offscreen.
protected  RenderGraphicsrg
    
protected  SMILSamplesmilSample
     The animation sampler, which runs animations in the update thread.
protected  intstate
     The current player state.
protected  SVGEventListenersvgEventListener
     The associated SVGEventListener.
protected  floattimeIncrement
     The time increment for the animation.
protected  RunnableQueueupdateQueue
     The RunnableQueue is the _only_ valid way to access the model tree.

Constructor Summary
public  SVGCanvas(DocumentNode documentNode)
    
Parameters:
  documentNode - the documentNode this component will render.

Method Summary
protected  voidbuildOffscreen(int width, int height)
     The offscreen buffer has the size of the component.
protected  voidcheckOffscreen()
     Checks if the offscreen buffer needs to be built or rebuilt.
protected  voiddispatchKeyEvent(String eventType, int keyCode)
     Dispatches a key event to the DOM tree.
protected  voiddispatchPointerEvent(String eventType, float[] pt)
     Dispatches a mouse event to the DOM tree.
public  floatgetTimeIncrement()
     Get the current time increment for animation rendering.
protected  voidhideNotify()
     Invoked when the component is hidden.
public  voidinitialLoadComplete(Exception e)
     Called by the SimpleCanvasManager when the initial load is complete.
 voidinvokeAndWait(Runnable runnable)
     Invoke the Runnable in the Document update thread and return only after this Runnable has finished.
 voidinvokeLater(Runnable runnable)
     Schedule execution of the input Runnable in the update thread at a later time.
protected  voidkeyPressed(int keyCode)
     Invoked when a key has been pressed.
protected  voidkeyReleased(int keyCode)
     Invoked when a key has been released.
protected  voidpaint(Graphics g)
    
public  voidpause()
     Transition this SVGAnimator to the paused state. The SVGAnimator stops advancing the document's current time automatically (see the SVGDocument's setCurrentTime method).
public  voidplay()
     Transition this SVGAnimator to the playing state.
protected  voidpointerPressed(int x, int y)
     Invoked when a mouse button has been pressed on a component.
protected  voidpointerReleased(int x, int y)
     Invoked when a mouse button has been released on a component.
public  voidsetSVGEventListener(SVGEventListener svgEventListener)
     Associate the specified SVGEventListener with this SVGAnimator.
Parameters:
  svgEventListener - the SVGEventListener that will receiveevents forwarded by this SVGAnimator.
public  voidsetTimeIncrement(float timeIncrement)
     Set the time increment to be used for animation rendering.
Parameters:
  timeIncrement - the minimal period of time, in seconds, thatshould elapse between frame.
protected  voidshowNotify()
     Invoked when the component is shown.
protected  voidsizeChanged(int w, int h)
     Invoked when the component's size changes.
 StringstateToString()
     Helper method.
public  voidstop()
     Transition this SVGAnimator to the stopped state.
public  voidupdateComplete(Object canvasManager)
     Invoked by the SimpleCanvasManager when it is done updating the canvas.

Field Detail
CLEAR_COLOR
final public static int CLEAR_COLOR(Code)
Color used to clear the canvas' background.



SMIL_ANIMATION_FRAME_LENGTH
final public static int SMIL_ANIMATION_FRAME_LENGTH(Code)
SMIL Animation's frame length, in milliseconds



STATE_PAUSED
final public static int STATE_PAUSED(Code)
Paused state, i.e., repainting buffer but no longer advancing the time.



STATE_PLAYING
final public static int STATE_PLAYING(Code)
Playing state, i.e., playing animations and repainting buffer.



STATE_STOPPED
final public static int STATE_STOPPED(Code)
Initial state.



canvasManager
protected SimpleCanvasManager canvasManager(Code)
The SimpleCanvasManager manages the area where the SVG content is rendered.



clock
protected SMILSample.DocumentWallClock clock(Code)
The animation clock.



documentNode
protected DocumentNode documentNode(Code)
This component displays a DocumentNode object, which is built from the URI



gsd
protected GraphicsSurfaceDestination gsd(Code)
Used to blit the offscreen onto the graphics destination.



lastMouseTarget
protected ModelNode lastMouseTarget(Code)
The last mouse event target.



lastWasPressed
protected boolean lastWasPressed(Code)
True if the last pointer event was a pointer pressed event.



lastX
protected int lastX(Code)
Last x position on a pointer pressed event.



lastY
protected int lastY(Code)
Last y position on a pointer pressed event.



offscreen
protected NativeSurface offscreen(Code)
Offscreen image



offscreenHeight
protected int offscreenHeight(Code)
Offscreen height



offscreenWidth
protected int offscreenWidth(Code)
Offscreen width



pr
protected PiscesRenderer pr(Code)
The PiscesRenderer associated with the offscreen.



rg
protected RenderGraphics rg(Code)
RenderGraphics used to draw into the current offscreen



smilSample
protected SMILSample smilSample(Code)
The animation sampler, which runs animations in the update thread.



state
protected int state(Code)
The current player state.



svgEventListener
protected SVGEventListener svgEventListener(Code)
The associated SVGEventListener.



timeIncrement
protected float timeIncrement(Code)
The time increment for the animation.



updateQueue
protected RunnableQueue updateQueue(Code)
The RunnableQueue is the _only_ valid way to access the model tree. No access to the model should be done other than from the RunnableQueue thread.




Constructor Detail
SVGCanvas
public SVGCanvas(DocumentNode documentNode)(Code)

Parameters:
  documentNode - the documentNode this component will render. The inputDocumentNode must be fully loaded before this method is called.Note: if the DocumentNode already has an associated RunnableQueue,it is simply replaced. It is the responsibility of the caller to stop that RunnableQueue if need be.
throws:
  IllegalArgumentException - see SVGCanvas.setURI setURI.




Method Detail
buildOffscreen
protected void buildOffscreen(int width, int height)(Code)
The offscreen buffer has the size of the component. This method is called in the MIDP painting thread.
Parameters:
  width - the requested minimum buffer width
Parameters:
  height - the requested minimum buffer height



checkOffscreen
protected void checkOffscreen()(Code)
Checks if the offscreen buffer needs to be built or rebuilt.



dispatchKeyEvent
protected void dispatchKeyEvent(String eventType, int keyCode)(Code)
Dispatches a key event to the DOM tree.
Parameters:
  eventType - the DOM event type.
Parameters:
  keyCode - the key code.



dispatchPointerEvent
protected void dispatchPointerEvent(String eventType, float[] pt)(Code)
Dispatches a mouse event to the DOM tree.
Parameters:
  eventType - the DOM event type.
Parameters:
  pt - the mouse event coordinates.



getTimeIncrement
public float getTimeIncrement()(Code)
Get the current time increment for animation rendering. The SVGAnimator increments the SVG document's current time by this amount upon each rendering. The default value is 0.1 (100 milliseconds). the current time increment, in seconds, used for animationrendering.
See Also:   SVGCanvas.setTimeIncrement



hideNotify
protected void hideNotify()(Code)
Invoked when the component is hidden.



initialLoadComplete
public void initialLoadComplete(Exception e)(Code)
Called by the SimpleCanvasManager when the initial load is complete. This method is called in the RunnableQueue thread.
Parameters:
  e - if not null, it means that the initial load failed due tothis exception.



invokeAndWait
void invokeAndWait(Runnable runnable) throws InterruptedException(Code)
Invoke the Runnable in the Document update thread and return only after this Runnable has finished.
Parameters:
  runnable - the new Runnable to invoke.
throws:
  InterruptedException - if the current thread is waiting,sleeping, or otherwise paused for a long time and another threadinterrupts it.
throws:
  NullPointerException - if runnable is null.
throws:
  IllegalStateException - if the animator is in the stopped state.



invokeLater
void invokeLater(Runnable runnable)(Code)
Schedule execution of the input Runnable in the update thread at a later time.
Parameters:
  runnable - the new Runnable to execute in the Document's updatethread when time permits.
throws:
  NullPointerException - if runnable is null.
throws:
  IllegalStateException - if the animator is in the stopped state.



keyPressed
protected void keyPressed(int keyCode)(Code)
Invoked when a key has been pressed.
Parameters:
  keyCode - the code of the event key



keyReleased
protected void keyReleased(int keyCode)(Code)
Invoked when a key has been released.
Parameters:
  keyCode - the code of the event key



paint
protected void paint(Graphics g)(Code)

See Also:   javax.microedition.lcdui.Canvas.paint



pause
public void pause()(Code)
Transition this SVGAnimator to the paused state. The SVGAnimator stops advancing the document's current time automatically (see the SVGDocument's setCurrentTime method). In consequence, animation playback will be paused until another call to the play method is made, at which points animations will resume from the document's current time. SVGImage updates (through API calls) cause a rendering update while the SVGAnimator is in the paused state.
throws:
  IllegalStateException - if the animator is not in the playingstate.



play
public void play()(Code)
Transition this SVGAnimator to the playing state. In the playing state, both Animation and SVGImage updates cause rendering updates. Note that in the playing state, when the document's current time changes, the animator will seek to the new time, and continue to play animations from this place.
throws:
  IllegalStateException - if the animator is not currently inthe stopped or paused state.



pointerPressed
protected void pointerPressed(int x, int y)(Code)
Invoked when a mouse button has been pressed on a component.
Parameters:
  x - the x-axis coordinate of the pointer event
Parameters:
  y - the y-axis coordinate of the pointer event



pointerReleased
protected void pointerReleased(int x, int y)(Code)
Invoked when a mouse button has been released on a component.
Parameters:
  x - the x-axis coordinate of the pointer event
Parameters:
  y - the y-axis coordinate of the pointer event



setSVGEventListener
public void setSVGEventListener(SVGEventListener svgEventListener)(Code)
Associate the specified SVGEventListener with this SVGAnimator.
Parameters:
  svgEventListener - the SVGEventListener that will receiveevents forwarded by this SVGAnimator. If null,events will not be forwarded by the SVGAnimator.



setTimeIncrement
public void setTimeIncrement(float timeIncrement)(Code)
Set the time increment to be used for animation rendering.
Parameters:
  timeIncrement - the minimal period of time, in seconds, thatshould elapse between frame. Must be greater than zero.
throws:
  IllegalArgumentException - if timeIncrement is less than or equal tozero.
See Also:   SVGCanvas.getTimeIncrement



showNotify
protected void showNotify()(Code)
Invoked when the component is shown.



sizeChanged
protected void sizeChanged(int w, int h)(Code)
Invoked when the component's size changes.
Parameters:
  w - the new width
Parameters:
  h - the new height



stateToString
String stateToString()(Code)
Helper method. Converts the current state to a String.



stop
public void stop()(Code)
Transition this SVGAnimator to the stopped state. In this state, no rendering updates are performed.
throws:
  IllegalStateException - if the animator is not in the playingor paused state.



updateComplete
public void updateComplete(Object canvasManager)(Code)
Invoked by the SimpleCanvasManager when it is done updating the canvas. This is used during the progressive rendering loading phase and when a Runnable has been invoked on the RunnableQueue associated with the SVG image. This method is called in the RunnableQueue thread.
Parameters:
  canvasManager - the SimpleCanvasManager which is reportingthe update.



Fields inherited from javax.microedition.lcdui.Canvas
final public static int DOWN(Code)(Java Doc)
final public static int FIRE(Code)(Java Doc)
final public static int GAME_A(Code)(Java Doc)
final public static int GAME_B(Code)(Java Doc)
final public static int GAME_C(Code)(Java Doc)
final public static int GAME_D(Code)(Java Doc)
final public static int KEY_NUM0(Code)(Java Doc)
final public static int KEY_NUM1(Code)(Java Doc)
final public static int KEY_NUM2(Code)(Java Doc)
final public static int KEY_NUM3(Code)(Java Doc)
final public static int KEY_NUM4(Code)(Java Doc)
final public static int KEY_NUM5(Code)(Java Doc)
final public static int KEY_NUM6(Code)(Java Doc)
final public static int KEY_NUM7(Code)(Java Doc)
final public static int KEY_NUM8(Code)(Java Doc)
final public static int KEY_NUM9(Code)(Java Doc)
final public static int KEY_POUND(Code)(Java Doc)
final public static int KEY_STAR(Code)(Java Doc)
final public static int LEFT(Code)(Java Doc)
final public static int RIGHT(Code)(Java Doc)
final public static int UP(Code)(Java Doc)

Methods inherited from javax.microedition.lcdui.Canvas
public int getGameAction(int keyCode)(Code)(Java Doc)
public int getKeyCode(int gameAction)(Code)(Java Doc)
public String getKeyName(int keyCode)(Code)(Java Doc)
public boolean hasPointerEvents()(Code)(Java Doc)
public boolean hasPointerMotionEvents()(Code)(Java Doc)
public boolean hasRepeatEvents()(Code)(Java Doc)
protected void hideNotify()(Code)(Java Doc)
public boolean isDoubleBuffered()(Code)(Java Doc)
protected void keyPressed(int keyCode)(Code)(Java Doc)
protected void keyReleased(int keyCode)(Code)(Java Doc)
protected void keyRepeated(int keyCode)(Code)(Java Doc)
abstract protected void paint(Graphics g)(Code)(Java Doc)
protected void pointerDragged(int x, int y)(Code)(Java Doc)
protected void pointerPressed(int x, int y)(Code)(Java Doc)
protected void pointerReleased(int x, int y)(Code)(Java Doc)
final public void repaint(int x, int y, int width, int height)(Code)(Java Doc)
final public void repaint()(Code)(Java Doc)
final public void serviceRepaints()(Code)(Java Doc)
public void setFullScreenMode(boolean mode)(Code)(Java Doc)
protected void showNotify()(Code)(Java Doc)
protected void sizeChanged(int w, int h)(Code)(Java Doc)

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