public interface GTRenderer
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
Modifier and Type | Method and Description |
---|---|
void |
addRenderListener(RenderListener listener)
adds a listener that responds to error events of feature rendered events.
|
MapContext |
getContext()
Deprecated.
The
MapContext class is being phased out. Please use getMapContent() . |
RenderingHints |
getJava2DHints()
Hints used to configure Java2D Graphics prior to rendering.
|
MapContent |
getMapContent()
Gets the
MapContent instance which contains the data being rendered. |
Map<Object,Object> |
getRendererHints()
Hints used to configure rendering process
|
void |
paint(Graphics2D graphics,
Rectangle paintArea,
AffineTransform worldToScreen)
Renders features based on the map layers and their styles as specified in the map content
using
setContext . |
void |
paint(Graphics2D graphics,
Rectangle paintArea,
Envelope mapArea)
Renders features based on the map layers and their styles as specified in the map context
using
setContext . |
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
using
setContext . |
void |
paint(Graphics2D graphics,
Rectangle paintArea,
ReferencedEnvelope mapArea)
Renders features based on the map layers and their styles as specified in the map context
using
setContext . |
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
using
setContext . |
void |
removeRenderListener(RenderListener listener)
Removes a render listener.
|
void |
setContext(MapContext context)
Deprecated.
The
MapContext class is being phased out. Please use setMapContent(org.geotools.map.MapContent) . |
void |
setJava2DHints(RenderingHints hints)
Hints used to configure Java2D Graphics prior to rendering.
|
void |
setMapContent(MapContent mapContent)
Sets the
MapContent which contains the data to be rendered. |
void |
setRendererHints(Map<Object,Object> hints)
Hints used to configure rendering process.
|
void |
stopRendering()
If you call this method from another thread than the one that called
paint or
render the rendering will be forcefully stopped before termination. |
void stopRendering()
paint
or
render
the rendering will be forcefully stopped before termination.void addRenderListener(RenderListener listener)
listener
- the listener to add.RenderListener
void removeRenderListener(RenderListener listener)
listener
- the listener to remove.RenderListener
void setJava2DHints(RenderingHints hints)
RenderingHints getJava2DHints()
void setRendererHints(Map<Object,Object> hints)
hints
- Map<Object,Object> getRendererHints()
void setContext(MapContext context)
MapContext
class is being phased out. Please use setMapContent(org.geotools.map.MapContent)
.context
- void setMapContent(MapContent mapContent)
MapContent
which contains the data to be rendered.mapContent
- the map contentMapContext getContext()
MapContext
class is being phased out. Please use getMapContent()
.MapContent getMapContent()
MapContent
instance which contains the data being rendered.MapContent
instancevoid paint(Graphics2D graphics, Rectangle paintArea, AffineTransform worldToScreen)
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.
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.void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea)
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.
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.void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea)
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.
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.void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea, AffineTransform worldToScreen)
setContext
.
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!
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.void paint(Graphics2D graphics, Rectangle paintArea, ReferencedEnvelope mapArea, AffineTransform worldToScreen)
setContext
.
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!
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.Copyright © 1996–2019 Geotools. All rights reserved.