|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.renderer.lite.LiteRenderer
A lite implementation of the Renderer and Renderer2D interfaces. Lite means that:
Field Summary | |
static org.geotools.renderer.lite.LiteRenderer.DefaultRenderListener |
DEFAULT_LISTENER
Deprecated. This listener is added to the list of listeners automatically. |
Constructor Summary | |
LiteRenderer()
Deprecated. Creates a new instance of LiteRenderer without a context. |
|
LiteRenderer(MapContext context)
Deprecated. Creates a new instance of Java2DRenderer. |
Method Summary | |
void |
addRenderListener(RenderListener listener)
Deprecated. adds a listener that responds to error events of feature rendered events. |
void |
applyFill(java.awt.Graphics2D graphic,
Fill fill,
Feature feature)
Deprecated. Renders a filled feature |
static double |
calculateScale(com.vividsolutions.jts.geom.Envelope envelope,
org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem,
int imageWidth,
int imageHeight,
double DPI)
Deprecated. Find the scale denominator of the map. |
com.vividsolutions.jts.geom.Geometry |
getCentroid(com.vividsolutions.jts.geom.Geometry g)
Deprecated. Finds the centroid of the input geometry if input = point, line, polygon --> return a point that represents the centroid of that geom if input = geometry collection --> return a multipoint that represents the centoid of each sub-geom |
boolean |
getConcatTransforms()
Deprecated. Flag which controls behaviour for applying affine transformation to the graphics object. |
double |
getGeneralizationDistance()
Deprecated. Returns the generalization distance in the screen space. |
static long |
getImageLoadingTimeout()
Deprecated. Returns the amount of time the renderer waits for loading an external image before giving up and examining the other images in the Graphic object |
boolean |
isInteractive()
Deprecated. Getter for property interactive. |
boolean |
isOptimizedDataLoadingEnabled()
Deprecated. Returns true if the optimized data loading is enabled, false otherwise. |
void |
paint(java.awt.Graphics2D graphics,
java.awt.Rectangle paintArea,
java.awt.geom.AffineTransform transform)
Deprecated. Render features based on the LayerList, BoundBox and Style specified in this.context. |
void |
paint(java.awt.Graphics2D graphics,
java.awt.Rectangle paintArea,
com.vividsolutions.jts.geom.Envelope envelope)
Deprecated. TODO summary sentence for paint ... |
com.vividsolutions.jts.geom.Coordinate |
pixelToWorld(int x,
int y,
com.vividsolutions.jts.geom.Envelope map)
Deprecated. Converts a coordinate expressed on the device space back to real world coordinates |
void |
removeRenderListener(RenderListener listener)
Deprecated. Removes a render listener. |
void |
render(FeatureCollection features,
com.vividsolutions.jts.geom.Envelope map,
Style s)
Deprecated. Performs the actual rendering process to the graphics context set in setOutput. |
void |
setConcatTransforms(boolean flag)
Deprecated. Sets the flag which controls behaviour for applying affine transformation to the graphics object. |
void |
setGeneralizationDistance(double d)
Deprecated. Sets the generalizazion distance in the screen space. |
static void |
setImageLoadingTimeout(long newTimeout)
Deprecated. Sets the maximum time to wait for getting an external image. |
void |
setInteractive(boolean interactive)
Deprecated. Sets the interactive status of the renderer. |
void |
setMemoryPreloadingEnabled(boolean enabled)
Deprecated. |
void |
setOptimizedDataLoadingEnabled(boolean b)
Deprecated. Enables/disable optimized data loading |
void |
setOutput(java.awt.Graphics g,
java.awt.Rectangle bounds)
Deprecated. Graphics and bounds is to be set in renderer(). |
void |
setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
Deprecated. |
void |
setRenderingHints(java.awt.RenderingHints hints)
Deprecated. |
protected void |
setScaleDenominator(double scaleDenominator)
Deprecated. Setter for property scaleDenominator. |
void |
setTexture(java.awt.Graphics2D graphic,
Graphic gr,
Feature feature)
Deprecated. Sets a texture on the current graphics2D |
void |
stopRendering()
Deprecated. If you call this method from another thread than the one that called paint or
render the rendering will be forcefully stopped before termination |
java.awt.geom.AffineTransform |
worldToScreenTransform(com.vividsolutions.jts.geom.Envelope mapExtent,
java.awt.Rectangle screenSize)
Deprecated. Sets up the affine transform |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.geotools.renderer.lite.LiteRenderer.DefaultRenderListener DEFAULT_LISTENER
Constructor Detail |
public LiteRenderer()
public LiteRenderer(MapContext context)
context
- Contains pointers to layers, bounding box, and style required for rendering.Method Detail |
public void setConcatTransforms(boolean flag)
flag
- If true then the transform will be concatenated to the existing transform. If
false it will be replaced.public static long getImageLoadingTimeout()
public static void setImageLoadingTimeout(long newTimeout)
newTimeout
- the new timeout value in millisecondspublic boolean getConcatTransforms()
public void setOutput(java.awt.Graphics g, java.awt.Rectangle bounds)
render
, this sets where any output will be sent.
setOutput
in interface Renderer
g
- A graphics object for future rendering to be sent to. Note: must be an instance of
lite renderer.bounds
- The size of the output area, required so that scale can be calculated.public void addRenderListener(RenderListener listener)
listener
- the listener to add.RenderListener
public void removeRenderListener(RenderListener listener)
listener
- the listener to remove.RenderListener
protected void setScaleDenominator(double scaleDenominator)
scaleDenominator
- New value of property scaleDenominator.public void stopRendering()
paint
or
render
the rendering will be forcefully stopped before termination
public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, java.awt.geom.AffineTransform transform)
paint
in interface Renderer2D
graphics
- The graphics object to draw to.paintArea
- The size of the output area in output units (eg: pixels).transform
- A transform which converts World coordinates to Screen coordinates.public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, com.vividsolutions.jts.geom.Envelope envelope)
graphics
- paintArea
- envelope
- public static double calculateScale(com.vividsolutions.jts.geom.Envelope envelope, org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem, int imageWidth, int imageHeight, double DPI) throws java.lang.Exception
envelope
- coordinateReferenceSystem
- imageWidth
- imageHeight
- DPI
- screen dots per inch (OGC standard is 90)
java.lang.Exception
public void render(FeatureCollection features, com.vividsolutions.jts.geom.Envelope map, Style s)
The style parameter controls the appearance features. Rules within the style object may cause some features to be rendered multiple times or not at all.
render
in interface Renderer
features
- the feature collection to be renderedmap
- Controls the full extent of the input space. Used in the calculation of scale.s
- A style object. Contains a set of FeatureTypeStylers that are to be applied in order
to control the rendering process.public java.awt.geom.AffineTransform worldToScreenTransform(com.vividsolutions.jts.geom.Envelope mapExtent, java.awt.Rectangle screenSize)
mapExtent
- the map extentscreenSize
- the screen size
public com.vividsolutions.jts.geom.Coordinate pixelToWorld(int x, int y, com.vividsolutions.jts.geom.Envelope map)
pixelToWorld
in interface Renderer
x
- horizontal coordinate on device spacey
- vertical coordinate on device spacemap
- The map extent
public com.vividsolutions.jts.geom.Geometry getCentroid(com.vividsolutions.jts.geom.Geometry g)
g
-
public boolean isInteractive()
isInteractive
in interface Renderer
public void setInteractive(boolean interactive)
setInteractive
in interface Renderer
interactive
- new value for the interactive propertypublic boolean isOptimizedDataLoadingEnabled()
Returns true if the optimized data loading is enabled, false otherwise.
When optimized data loading is enabled, lite renderer will try to load only the needed feature attributes (according to styles) and to load only the features that are in (or overlaps with)the bounding box requested for painting
public void setOptimizedDataLoadingEnabled(boolean b)
b
- public double getGeneralizationDistance()
public void setGeneralizationDistance(double d)
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
d
- public void setMemoryPreloadingEnabled(boolean enabled)
enabled
- public void setRenderingHints(java.awt.RenderingHints hints)
public void setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)
public void applyFill(java.awt.Graphics2D graphic, Fill fill, Feature feature)
graphic
- graphics context used for drawingfill
- how to fill the featurefeature
- the feature to be filledpublic void setTexture(java.awt.Graphics2D graphic, Graphic gr, Feature feature)
graphic
- graphics context used for drawinggr
- the graphic specifiying the texturefeature
- the feature to be painted
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |