Interface GTRenderer
- All Known Implementing Classes:
StreamingRenderer
Rectangle paintArea = new Rectangle(width, height); ReferencedEnvelope mapArea = map.getBounds(); renderer = new StreamingRenderer(); renderer.setContext(map); RenderingHints hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); renderer.setJava2DHints(hints); Map<Object,Object> rendererParams = new HashMap<Object,Object>(); rendererParams.put("optimizedDataLoadingEnabled",Boolean.valueOf(true) ); renderer.setRendererHints( renderParams ); renderer.paint(graphic, paintArea, mapArea);
- Author:
- David Blasby, Simone Giannecchini
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRenderListener
(RenderListener listener) adds a listener that responds to error events of feature rendered events.Hints used to configure Java2D Graphics prior to rendering.Gets theMapContent
instance which contains the data being rendered.Hints used to configure rendering processvoid
paint
(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen) Renders features based on the map layers and their styles as specified in the map content usingsetContext
.void
paint
(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.void
paint
(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea, AffineTransform worldToScreen) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.void
paint
(Graphics2D graphics, Rectangle paintArea, Envelope mapArea) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.void
paint
(Graphics2D graphics, Rectangle paintArea, Envelope mapArea, AffineTransform worldToScreen) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.void
removeRenderListener
(RenderListener listener) Removes a render listener.void
setJava2DHints
(RenderingHints hints) Hints used to configure Java2D Graphics prior to rendering.void
setMapContent
(MapContent mapContent) Sets theMapContent
which contains the data to be rendered.void
setRendererHints
(Map<?, ?> hints) Hints used to configure rendering process.void
If you call this method from another thread than the one that calledpaint
orrender
the rendering will be forcefully stopped before termination.
-
Method Details
-
stopRendering
void stopRendering()If you call this method from another thread than the one that calledpaint
orrender
the rendering will be forcefully stopped before termination. -
addRenderListener
adds a listener that responds to error events of feature rendered events.- Parameters:
listener
- the listener to add.- See Also:
-
removeRenderListener
Removes a render listener.- Parameters:
listener
- the listener to remove.- See Also:
-
setJava2DHints
Hints used to configure Java2D Graphics prior to rendering. -
getJava2DHints
RenderingHints getJava2DHints()Hints used to configure Java2D Graphics prior to rendering.- Returns:
- Hints
-
setRendererHints
Hints used to configure rendering process. -
getRendererHints
Hints used to configure rendering process- Returns:
- Hints used to configure rendering process
-
setMapContent
Sets theMapContent
which contains the data to be rendered.- Parameters:
mapContent
- the map content
-
getMapContent
MapContent getMapContent()Gets theMapContent
instance which contains the data being rendered.- Returns:
- the
MapContent
instance
-
paint
Renders features based on the map layers and their styles as specified in the map content usingsetContext
.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.paintArea
- The size of the output area in output units (eg: pixels).worldToScreen
- A transform which converts World coordinates to Screen coordinates.
-
paint
Renders features based on the map layers and their styles as specified in the map context usingsetContext
.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.paintArea
- The size of the output area in output units (eg: pixels).mapArea
- the map's visible area (viewport) in map coordinates.
-
paint
Renders features based on the map layers and their styles as specified in the map context usingsetContext
.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.paintArea
- The size of the output area in output units (eg: pixels).mapArea
- the map's visible area (viewport) in map coordinates.
-
paint
void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea, AffineTransform worldToScreen) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.This version of the method assumes that paint area, enelope and worldToScreen transform are already computed and in sync. Use this method to avoid recomputation. Note however that no check is performed that they are really synchronized!
- Parameters:
graphics
- The graphics object to draw to.paintArea
- The size of the output area in output units (eg: pixels).mapArea
- the map's visible area (viewport) in map coordinates.worldToScreen
- A transform which converts World coordinates to Screen coordinates.
-
paint
void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea, AffineTransform worldToScreen) Renders features based on the map layers and their styles as specified in the map context usingsetContext
.This version of the method assumes that paint area, enelope and worldToScreen transform are already computed and in sync. Use this method to avoid recomputation. Note however that no check is performed that they are really synchronized!
- Parameters:
graphics
- The graphics object to draw to.paintArea
- The size of the output area in output units (eg: pixels).mapArea
- the map's visible area (viewport) in map coordinates.worldToScreen
- A transform which converts World coordinates to Screen coordinates.
-