Java Doc for IRenderer.java in  » GIS » udig-1.1 » net » refractions » udig » project » render » 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 » GIS » udig 1.1 » net.refractions.udig.project.render 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.refractions.udig.project.render.IRenderer

IRenderer
public interface IRenderer (Code)
Used to mark an implementation of RenderImpl.class; responsible for rendering a layer.

A renderer has the following responsibilities:

  • A renderer must draw to the image provided by it RenderContext
  • A renderer reprojects victim data if required
  • A renderer applies styles if necessary
  • A renderer is responsible for registering with its layers to obtain notifications whent the layers' styles change
  • If a renderer does not extends the RendererImpl class the renderer must notify its adapters(listeners) when its rendering state changes.
  • If a renderer does extend the RendererImpl class it must call the setState() method when its render state changes or it wishes to notify its listeners that it needs to be redrawn.

    The state that the renderer can use are the following:

    • RENDERING - should be called when the renderer has data that it wishes to display on the screen. May be ignored if the executor uses a timer for refreshing rather than waiting for updates from the renderers
    • DONE - Should be set when rendering is finished.
    • RENDER_REQUEST - should be called when the renderer has received events indicating that it needs to be rerendered. The event listeners should NEVER call render(), instead setState(RENDER_REQUEST) should be used and the frame work will trigger a rerender, most-likely in a seperate thread.
  • If possible a renderer is responsible for registering with its data source, not layer, so it can receive notices of when the data changes. If another method of recieving update is required then the renderer is held responsible.

author:
   jeichar
since:
   0.1


Field Summary
final public static  intCANCELLED
    
final public static  intDISPOSED
    
final public static  intDONE
     Indicates whether the renderer has finished rendering.
final public static  intNEVER
    
final public static  intRENDERING
    
final public static  StringRENDER_EXT
    
final public static  intRENDER_REQUEST
     When a renderer sets its state to RENDER_REQUEST that indicates that is needs to be rerendered.
final public static  intSTARTING
    


Method Summary
public  voiddispose()
    
public  IRenderContextgetContext()
    
public  EnvelopegetRenderBounds()
     Gets the area that will be rendered next.
public  intgetState()
     Returns the current state of rendering.
public  booleanisCacheable()
     Indicates whether the framework is permitted to cache the results of the renderer.
public  voidrender(Graphics2D destination, IProgressMonitor monitor)
    
public  voidrender(IProgressMonitor monitor)
     Ask the renderer to update the internal image using the smaller of getRenderBounds() or ViewportBounds.

Render State

Normally the RenderManager will update the screen every second.
public  voidsetRenderBounds(Envelope boundsToRender)
     Called to set the area that will be rendered.
public  voidsetRenderBounds(Rectangle screenArea)
     Similar to render(Envelope) except the area is defined in screen coordinates.

Field Detail
CANCELLED
final public static int CANCELLED(Code)
Indicates that the renderer has been cancelled rendering



DISPOSED
final public static int DISPOSED(Code)
Indicates that the renderer has been disposed and can no longer be used



DONE
final public static int DONE(Code)
Indicates whether the renderer has finished rendering.

This implies that rendering has started and finished




NEVER
final public static int NEVER(Code)
Indicates that the renderer has been reset and does not have anything to show



RENDERING
final public static int RENDERING(Code)
Indicates whether the renderer job is currently running



RENDER_EXT
final public static String RENDER_EXT(Code)
The name of the Extension Point for Renderers



RENDER_REQUEST
final public static int RENDER_REQUEST(Code)
When a renderer sets its state to RENDER_REQUEST that indicates that is needs to be rerendered. The container of the renderer(usually a renderExecutor) will respond by calling render. This is done so that the container can include run the renderer in a thread seperate from the one that called setState().

IRenderer.setRenderBounds(Envelope) can be called to set the area that needs to be rendered}




STARTING
final public static int STARTING(Code)
Indicates that the renderer has started rendering but does not have data to be displayed





Method Detail
dispose
public void dispose()(Code)
Informs the renderer to dispose of resources



getContext
public IRenderContext getContext()(Code)
Returns the renderer's context object the the renderer's context object
See Also:   IRenderContext



getRenderBounds
public Envelope getRenderBounds()(Code)
Gets the area that will be rendered next.

Please make use of the smaller of getRenderBounds() or the viewport bounds when rendering.

bounds to be drawn next



getState
public int getState()(Code)
Returns the current state of rendering.

The state is the current state of the

Options are:
the current state of rendering.



isCacheable
public boolean isCacheable()(Code)
Indicates whether the framework is permitted to cache the results of the renderer. true if the framework may cache the resulting image and only request the new dirtyareas.



render
public void render(Graphics2D destination, IProgressMonitor monitor) throws RenderException(Code)
Requests the Renderer to render with the graphics2d object

This method will block


Parameters:
  destination - The objects that the Renderer will use for rendering
throws:
  RenderException -



render
public void render(IProgressMonitor monitor) throws RenderException(Code)
Ask the renderer to update the internal image using the smaller of getRenderBounds() or ViewportBounds.

Render State

Normally the RenderManager will update the screen every second. However if the renderer has data that must be displayed then it can call setState(RENDERING) and the Screen will be updated immediately. This should be called with care however since many such calls can cause performance problems.

Internal Image

The RenderContext maintains an "internal image" that you can access using getContext().getGraphics(); you can use Image.createGraphics() to retrive a Graphics2d to draw with. Example Implementation:

 public void render( IProgressMonitor monitor ) throws RenderException {
 if( monitor == null ) monitor = NullProgressMonitor();
 Graphics2D g = getContext().getImage().createGraphics();
 render(g, monitor);
 }   
 

Updating a Portion of the Screen

When the envelope (ie getRenderBounds()) is smaller than the ViewportBounds, the rendered area DOES NOT TAKE UP THE WHOLE MapDisplay. It only takes up the area that the envelope would map to. The purpose of this functionality is to allows only a small area of the MapDisplay to be refreshed rather than the whole area.

Please choose the smallest of:

  • getRenderBounds() - an Envelope in your CRS
  • viewPortBounds()


See Also:   IRenderer.getContext()
See Also:   IRenderContext.getImage
See Also:   IRenderContext.getImage(intint)
See Also:   


See Also:   This method will block
See Also:   


See Also:   


See Also:   A value of null renders the bounds the entire viewport obtained from the
See Also:   ViewportModel.getBounds().
See Also:   


throws:
  RenderException -



setRenderBounds
public void setRenderBounds(Envelope boundsToRender)(Code)
Called to set the area that will be rendered.



setRenderBounds
public void setRenderBounds(Rectangle screenArea)(Code)
Similar to render(Envelope) except the area is defined in screen coordinates. Performs the screen to world transformation and calls render(Envelope).
Parameters:
  screenArea - the area of the screen to re-render.



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