Java Doc for StreamingRenderer.java in  » GIS » GeoTools-2.4.1 » org » geotools » renderer » lite » 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 » GeoTools 2.4.1 » org.geotools.renderer.lite 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.renderer.lite.StreamingRenderer

StreamingRenderer
final public class StreamingRenderer implements GTRenderer(Code)
A streaming implementation of the GTRenderer interface.
  • The code is relatively simple to understand, so it can be used as a simple example of an SLD compliant rendering code
  • Uses as little memory as possible
Use this class if you need a stateless renderer that provides low memory footprint and decent rendering performance on the first call but don't need good optimal performance on subsequent calls on the same data. Notice: for the time being, this class doesn't support GridCoverage stylers, that will be rendered using the non geophisics version of the GridCoverage, if available, with the geophisics one, otherwise.

At the moment the streaming renderer is not thread safe
author:
   James Macgill
author:
   dblasby
author:
   jessie eichar
author:
   Simone Giannecchini
author:
   Andrea Aime
author:
   Alessio Fabiani
version:
   $Id: StreamingRenderer.java 29443 2008-02-25 10:04:01Z jgarnett $



Field Summary
final public static  StringDECLARED_SCALE_DENOM_KEY
    
final public static  StringDPI_KEY
    
final public static  StringFORCE_CRS_KEY
    
final public static  StringLABEL_CACHE_KEY
    
final public static  StringMEMORY_PRE_LOADING_KEY
    
final public static  StringOPTIMIZED_DATA_LOADING_KEY
    
final public static  StringSCALE_ACCURATE
     Computes the scale as the ratio between map distances and real world distances, assuming 90dpi and taking into consideration projection deformations and actual earth shape.
final public static  StringSCALE_COMPUTATION_METHOD_KEY
    
final public static  StringSCALE_OGC
     Very simple and lenient scale computation method that conforms to the OGC SLD specification 1.0, page 26.
final public static  StringTEXT_RENDERING_KEY
    
final public static  StringTEXT_RENDERING_OUTLINE
     Text will be rendered using the associated GlyphVector outline, that is, a Shape .
final public static  StringTEXT_RENDERING_STRING
     Text will be rendered using the usual calls gc.drawString/drawGlyphVector. This is a little faster, and more consistent with how the platform renders the text in other applications.
 interror
    
protected  LabelCachelabelCache
    

Constructor Summary
public  StreamingRenderer()
     Creates a new instance of LiteRenderer without a context.

Method Summary
public  voidaddRenderListener(RenderListener listener)
     adds a listener that responds to error events of feature rendered events.
public  booleangetConcatTransforms()
     Flag which controls behaviour for applying affine transformation to the graphics object. a boolean flag.
public  MapContextgetContext()
    
public  doublegetGeneralizationDistance()
     Returns the generalization distance in the screen space.
public  RenderingHintsgetJava2DHints()
    
public static  MathTransformgetMathTransform(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)
    
public  MapgetRendererHints()
    
public  booleanisCanTransform()
    
public  booleanisInteractive()
     Getter for property interactive.
public  voidpaint(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen)
     Renders features based on the map layers and their styles as specified in the map context using setContext.
public  voidpaint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea)
     Renders features based on the map layers and their styles as specified in the map context using setContext.
public  voidpaint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea)
     Renders features based on the map layers and their styles as specified in the map context using setContext.
public  voidpaint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea, AffineTransform worldToScreen)
     Renders features based on the map layers and their styles as specified in the map context using setContext.
public  voidpaint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea, AffineTransform worldToScreen)
     Renders features based on the map layers and their styles as specified in the map context using setContext.
 CollectionqueryLayer(MapLayer currLayer, CollectionSource source)
     Queries a given layer's Source instance to be rendered.
 FeatureCollectionqueryLayer(MapLayer currLayer, FeatureSource source, FeatureType schema, LiteFeatureTypeStyle[] styles, Envelope mapArea, CoordinateReferenceSystem mapCRS, CoordinateReferenceSystem featCrs, Rectangle screenSize, GeometryAttributeType geometryAttribute, AffineTransform worldToScreenTransform)
     Queries a given layer's features to be rendered based on the target rendering bounding box.

If optimizedDataLoadingEnabled attribute has been set to true, the following optimization will be performed in order to limit the number of features returned:

  • Just the features whose geometric attributes lies within envelope will be queried
  • The queried attributes will be limited to just those needed to perform the rendering, based on the requiered geometric and non geometric attributes found in the Layer's style rules
  • If a Query has been set to limit the resulting layer's features, the final filter to obtain them will respect it.
public  voidremoveRenderListener(RenderListener listener)
     Removes a render listener.
public  voidsetConcatTransforms(boolean flag)
     Sets the flag which controls behaviour for applying affine transformation to the graphics object.
Parameters:
  flag - If true then the transform will be concatenated to theexisting transform.
public  voidsetContext(MapContext context)
    
public  voidsetGeneralizationDistance(double d)
    

Sets the generalizazion distance in the screen space.

public  voidsetInteractive(boolean interactive)
     Sets the interactive status of the renderer.
public  voidsetJava2DHints(RenderingHints hints)
    
public  voidsetRendererHints(Map hints)
    
public  voidstopRendering()
    

Field Detail
DECLARED_SCALE_DENOM_KEY
final public static String DECLARED_SCALE_DENOM_KEY(Code)



DPI_KEY
final public static String DPI_KEY(Code)



FORCE_CRS_KEY
final public static String FORCE_CRS_KEY(Code)



LABEL_CACHE_KEY
final public static String LABEL_CACHE_KEY(Code)



MEMORY_PRE_LOADING_KEY
final public static String MEMORY_PRE_LOADING_KEY(Code)



OPTIMIZED_DATA_LOADING_KEY
final public static String OPTIMIZED_DATA_LOADING_KEY(Code)



SCALE_ACCURATE
final public static String SCALE_ACCURATE(Code)
Computes the scale as the ratio between map distances and real world distances, assuming 90dpi and taking into consideration projection deformations and actual earth shape.
Use this method only when in need of accurate computation. Will break if the data extent is outside of the currenct projection definition area.



SCALE_COMPUTATION_METHOD_KEY
final public static String SCALE_COMPUTATION_METHOD_KEY(Code)



SCALE_OGC
final public static String SCALE_OGC(Code)
Very simple and lenient scale computation method that conforms to the OGC SLD specification 1.0, page 26.
This method is quite approximative, but should never break and ensure constant scale even on lat/lon unprojected maps (because in that case scale is computed as if the area was along the equator no matter what the real position is).



TEXT_RENDERING_KEY
final public static String TEXT_RENDERING_KEY(Code)
The text rendering method, either TEXT_RENDERING_OUTLINE or TEXT_RENDERING_STRING



TEXT_RENDERING_OUTLINE
final public static String TEXT_RENDERING_OUTLINE(Code)
Text will be rendered using the associated GlyphVector outline, that is, a Shape . This ensures perfect centering between the text and the halo, but introduces more text aliasing.



TEXT_RENDERING_STRING
final public static String TEXT_RENDERING_STRING(Code)
Text will be rendered using the usual calls gc.drawString/drawGlyphVector. This is a little faster, and more consistent with how the platform renders the text in other applications. The downside is that on most platform the label and its eventual halo are not properly centered.



error
int error(Code)



labelCache
protected LabelCache labelCache(Code)




Constructor Detail
StreamingRenderer
public StreamingRenderer()(Code)
Creates a new instance of LiteRenderer without a context. Use it only to gain access to utility methods of this class or if you want to render random feature collections instead of using the map context interface




Method Detail
addRenderListener
public void addRenderListener(RenderListener listener)(Code)
adds a listener that responds to error events of feature rendered events.
See Also:   RenderListener
Parameters:
  listener - the listener to add.



getConcatTransforms
public boolean getConcatTransforms()(Code)
Flag which controls behaviour for applying affine transformation to the graphics object. a boolean flag. If true then the transform will be concatenatedto the existing transform. If false it will be replaced.



getContext
public MapContext getContext()(Code)



getGeneralizationDistance
public double getGeneralizationDistance()(Code)
Returns the generalization distance in the screen space.



getJava2DHints
public RenderingHints getJava2DHints()(Code)



getMathTransform
public static MathTransform getMathTransform(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)(Code)



getRendererHints
public Map getRendererHints()(Code)



isCanTransform
public boolean isCanTransform()(Code)



isInteractive
public boolean isInteractive()(Code)
Getter for property interactive. Value of property interactive.



paint
public void paint(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen)(Code)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the size of the output area and the transformation from coordinates to pixels are known. The latter determines the map scale. The viewport (the visible part of the map) will be calculated internally.
Parameters:
  graphics - The graphics object to draw to.
Parameters:
  paintArea - The size of the output area in output units (eg: pixels).
Parameters:
  worldToScreen - A transform which converts World coordinates to Screencoordinates.




paint
public void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea)(Code)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the area of the visible part of the map and the size of the output area are known. The transform between the two is calculated internally.
Parameters:
  graphics - The graphics object to draw to.
Parameters:
  paintArea - The size of the output area in output units (eg: pixels).
Parameters:
  mapArea - the map's visible area (viewport) in map coordinates.




paint
public void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea)(Code)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the area of the visible part of the map and the size of the output area are known. The transform between the two is calculated internally.
Parameters:
  graphics - The graphics object to draw to.
Parameters:
  paintArea - The size of the output area in output units (eg: pixels).
Parameters:
  mapArea - the map's visible area (viewport) in map coordinates.




paint
public void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea, AffineTransform worldToScreen)(Code)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that paint area, enelope and worldToScreen transform are already computed. Use this method to avoid recomputation. Note however that no check is performed that they are really in sync!
Parameters:
  graphics - The graphics object to draw to.
Parameters:
  paintArea - The size of the output area in output units (eg: pixels).
Parameters:
  mapArea - the map's visible area (viewport) in map coordinates.
Parameters:
  worldToScreen - A transform which converts World coordinates to Screencoordinates.




paint
public void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea, AffineTransform worldToScreen)(Code)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that paint area, enelope and worldToScreen transform are already computed. Use this method to avoid recomputation. Note however that no check is performed that they are really in sync!
Parameters:
  graphics - The graphics object to draw to.
Parameters:
  paintArea - The size of the output area in output units (eg: pixels).
Parameters:
  mapArea - the map's visible area (viewport) in map coordinates. Itsassociate CRS is ALWAYS 2D
Parameters:
  worldToScreen - A transform which converts World coordinates to Screencoordinates.




queryLayer
Collection queryLayer(MapLayer currLayer, CollectionSource source)(Code)
Queries a given layer's Source instance to be rendered.

Note: This is proof-of-concept quality only! At the moment the query is not filtered, that means all objects with all fields are read from the datastore for every call to this method. This method should work like StreamingRenderer.queryLayer(MapLayer,FeatureSource,FeatureType,LiteFeatureTypeStyle[],Envelope,CoordinateReferenceSystem,CoordinateReferenceSystem,Rectangle,GeometryAttributeType) and eventually replace it.


Parameters:
  currLayer - The actually processed layer for rendering
Parameters:
  source - Source to read data from



queryLayer
FeatureCollection queryLayer(MapLayer currLayer, FeatureSource source, FeatureType schema, LiteFeatureTypeStyle[] styles, Envelope mapArea, CoordinateReferenceSystem mapCRS, CoordinateReferenceSystem featCrs, Rectangle screenSize, GeometryAttributeType geometryAttribute, AffineTransform worldToScreenTransform) throws IllegalFilterException, IOException, IllegalAttributeException(Code)
Queries a given layer's features to be rendered based on the target rendering bounding box.

If optimizedDataLoadingEnabled attribute has been set to true, the following optimization will be performed in order to limit the number of features returned:

  • Just the features whose geometric attributes lies within envelope will be queried
  • The queried attributes will be limited to just those needed to perform the rendering, based on the requiered geometric and non geometric attributes found in the Layer's style rules
  • If a Query has been set to limit the resulting layer's features, the final filter to obtain them will respect it. This means that the bounding box filter and the Query filter will be combined, also including maxFeatures from Query
  • At least that the layer's definition query explicitly says to retrieve some attribute, no attributes will be requested from it, for performance reassons. So it is desirable to not use a Query for filtering a layer wich includes attributes. Note that including the attributes in the result is not necessary for the query's filter to get properly processed.

NOTE : This is an internal method and should only be called by paint(Graphics2D, Rectangle, AffineTransform). It is package protected just to allow unit testing it.


Parameters:
  currLayer - the actually processing layer for renderition
Parameters:
  schema -
Parameters:
  source -
Parameters:
  envelope - the spatial extent wich is the target area fo the renderingprocess
Parameters:
  destinationCrs - DOCUMENT ME!
Parameters:
  sourceCrs -
Parameters:
  screenSize -
Parameters:
  geometryAttribute - the set of features resulting from currLayer afterquering its feature source
throws:
  IllegalFilterException - if something goes wrong constructing the bbox filter
throws:
  IOException -
throws:
  IllegalAttributeException -
See Also:   MapLayer.setQuery(org.geotools.data.Query)



removeRenderListener
public void removeRenderListener(RenderListener listener)(Code)
Removes a render listener.
See Also:   RenderListener
Parameters:
  listener - the listener to remove.



setConcatTransforms
public void setConcatTransforms(boolean flag)(Code)
Sets the flag which controls behaviour for applying affine transformation to the graphics object.
Parameters:
  flag - If true then the transform will be concatenated to theexisting transform. If false it will be replaced.



setContext
public void setContext(MapContext context)(Code)



setGeneralizationDistance
public void setGeneralizationDistance(double d)(Code)

Sets the generalizazion distance in the screen space.

Default value is 1, meaning that two subsequent points are collapsed to one if their on screen distance is less than one pixel

Set the distance to 0 if you don't want any kind of generalization


Parameters:
  d -



setInteractive
public void setInteractive(boolean interactive)(Code)
Sets the interactive status of the renderer. An interactive renderer won't wait for long image loading, preferring an alternative mark instead
Parameters:
  interactive - new value for the interactive property



setJava2DHints
public void setJava2DHints(RenderingHints hints)(Code)



setRendererHints
public void setRendererHints(Map hints)(Code)



stopRendering
public void stopRendering()(Code)
If you call this method from another thread than the one that called paint or render the rendering will be forcefully stopped before termination



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.