|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.renderer.j2d.Renderer
org.geotools.display.canvas.BufferedCanvas2D
as part of the port
of J2D-renderer to the new GO-1 based API. Note that it is not possible to mix
J2D-renderer classes with GO-1 rendering engine. Migration from J2D-renderer to the
GO-1 API will requires the replacement of all deprecated classes together. Because
the new GO-1 rendering engine is a work in progress, see
GEOT-776 in order to determine
if enough functionalites have been ported for yours need.
A renderer for drawing map objects into a Graphics2D
. A newly constructed
Renderer
is initially empty. To make something appears, RenderedLayer
s
must be added using one of addLayer(...)
methods. The visual content depends of
the RenderedLayer
subclass. It may be an isoline (RenderedGeometries
),
a remote sensing image (RenderedGridCoverage
), a set of arbitrary marks
(RenderedMarks
), a map scale (RenderedMapScale
), etc.
Field Summary | |
protected java.awt.RenderingHints |
hints
Deprecated. A set of rendering hints. |
protected java.beans.PropertyChangeSupport |
listeners
Deprecated. Listeners to be notified about any changes in this layer's properties. |
Constructor Summary | |
Renderer(java.awt.Component owner)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D . |
Method Summary | |
void |
addLayer(RenderedLayer layer)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#add . |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener . |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener . |
void |
dispose()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#dispose . |
javax.swing.Action |
getAction(GeoMouseEvent event)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getAction . |
CoordinateSystem |
getCoordinateSystem()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getObjectiveCRS . |
int |
getLayerCount()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getGraphics . |
RenderedLayer[] |
getLayers()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getGraphics . |
java.util.Locale |
getLocale()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getLocale . |
java.lang.String |
getName(java.util.Locale locale)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getTitle . |
ImageType |
getOffscreenBuffered(float zOrder)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getOffscreenBuffered . |
java.awt.geom.Rectangle2D |
getPreferredArea()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getEnvelope2D . |
java.awt.geom.Dimension2D |
getPreferredPixelSize()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getTypicalCellDimension . |
java.lang.Object |
getRenderingHint(java.awt.RenderingHints.Key key)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getRenderingHint . |
float |
getScale()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getScale . |
java.lang.String |
getToolTipText(GeoMouseEvent event)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#getToolTipText . |
void |
paint(java.awt.Graphics2D graph,
java.awt.geom.AffineTransform zoom,
java.awt.Rectangle zoomableBounds)
Deprecated. Use paint(Graphics2D, Rectangle, AffineTransform) instead. |
void |
paint(java.awt.Graphics2D graph,
java.awt.Rectangle zoomableBounds,
java.awt.geom.AffineTransform zoom)
Deprecated. Use paint(Graphics2D,Rectangle,AffineTransform,boolean) instead. |
void |
paint(java.awt.Graphics2D graph,
java.awt.Rectangle zoomableBounds,
java.awt.geom.AffineTransform zoom,
boolean isPrinting)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#paint . |
void |
removeAllLayers()
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removeAll . |
void |
removeLayer(RenderedLayer layer)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#remove . |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener . |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener . |
void |
setCoordinateSystem(CoordinateSystem cs)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setObjectiveCRS . |
void |
setOffscreenBuffered(float lower,
float upper,
ImageType type)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setOffscreenBuffered . |
void |
setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
Deprecated. Replaced by org.geotools.display.canvas.BufferedCanvas2D#setRenderingHint . |
java.lang.String |
toString()
Deprecated. Returns a string representation of this renderer and all its RenderedLayer s.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final java.awt.RenderingHints hints
Hints.COORDINATE_TRANSFORMATION_FACTORY
and
any of Hints.FINEST_RESOLUTION
.
Hints.FINEST_RESOLUTION
,
Hints.REQUIRED_RESOLUTION
,
Hints.COORDINATE_TRANSFORMATION_FACTORY
,
Hints.PREFETCH
,
RenderingHints.KEY_RENDERING
,
RenderingHints.KEY_COLOR_RENDERING
,
RenderingHints.KEY_INTERPOLATION
protected final java.beans.PropertyChangeSupport listeners
"preferredArea"
.
Constructor Detail |
public Renderer(java.awt.Component owner)
org.geotools.display.canvas.BufferedCanvas2D
.
owner
- The widget that own this renderer, or null
if none.Method Detail |
public java.lang.String getName(java.util.Locale locale)
org.geotools.display.canvas.BufferedCanvas2D#getTitle
.
locale
- The desired locale, or null
for a default locale.
null
if none.getLocale()
,
Component.getName()
,
RenderedLayer.getName(java.util.Locale)
public java.util.Locale getLocale()
org.geotools.display.canvas.BufferedCanvas2D#getLocale
.
Component
, if it have one. Otherwise,
a default locale will be returned.
Component.getLocale()
,
JComponent.getDefaultLocale()
,
Locale.getDefault()
public CoordinateSystem getCoordinateSystem()
org.geotools.display.canvas.BufferedCanvas2D#getObjectiveCRS
.
RenderedLayer
s. Note that underlying data in
RenderedLayer
s doesn't need to be in this coordinate system:
transformations will performed on the fly as needed at rendering time.
public void setCoordinateSystem(CoordinateSystem cs) throws org.opengis.referencing.operation.TransformException
org.geotools.display.canvas.BufferedCanvas2D#setObjectiveCRS
.
RenderedLayer
s. Layers are notified of the
coordinate system change with RenderedLayer.setCoordinateSystem(org.geotools.cs.CoordinateSystem)
.
cs
- The view coordinate system. If the specified coordinate system has more
than two dimensions, then it must be a CompoundCoordinateSystem
with a two dimensional headCS
.
org.opengis.referencing.operation.TransformException
- If cs
can't be reduced to a two-dimensional
coordinate system, or if data can't be transformed for some other reason.public java.awt.geom.Rectangle2D getPreferredArea()
org.geotools.display.canvas.BufferedCanvas2D#getEnvelope2D
.
null
if this area can't be computed.public java.awt.geom.Dimension2D getPreferredPixelSize()
org.geotools.display.canvas.BufferedCanvas2D#getTypicalCellDimension
.
RenderedLayer.getPreferredPixelSize()
for each layers and returns the finest resolution.
null
if no layer provided a preferred pixel size.public float getScale()
org.geotools.display.canvas.BufferedCanvas2D#getScale
.
Float.NaN
if the scale is unknow.
The scale factor is usually smaller than 1. For example for a 1:1000 scale,
the scale factor will be 0.001. This scale factor takes in account the physical
size of the rendering device (e.g. the screen size) if such information is available.
Note that this scale can't be more accurate than the
information supplied
by the underlying system.
Float.NaN
.RenderingContext.getScale()
public void addLayer(RenderedLayer layer) throws java.lang.IllegalArgumentException
org.geotools.display.canvas.BufferedCanvas2D#add
.
Renderer
do not draw anything as long
as at least one layer hasn't be added. A RenderedLayer
can be anything like
an isobath, a remote sensing image, city locations, map scale, etc. The drawing order
(relative to other layers) is determined by the z-order property. A RenderedLayer
object can be added to only one
Renderer
object.
layer
- Layer to add to this Renderer
. This method call
will be ignored if layer
has already been added to this
Renderer
.
java.lang.IllegalArgumentException
- If layer
has already been added
to an other Renderer
, or if the layer can't be added for
some other reason.removeLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeAllLayers()
,
getLayers()
,
getLayerCount()
public void removeLayer(RenderedLayer layer) throws java.lang.IllegalArgumentException
org.geotools.display.canvas.BufferedCanvas2D#remove
.
RenderedLayer.setVisible
(false)
.
layer
- The layer to remove. This method call will be ignored
if layer
has already been removed from this
Renderer
.
java.lang.IllegalArgumentException
- If layer
is owned by
an other Renderer
than this
.addLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeAllLayers()
,
getLayers()
,
getLayerCount()
public void removeAllLayers()
org.geotools.display.canvas.BufferedCanvas2D#removeAll
.
addLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeLayer(org.geotools.renderer.j2d.RenderedLayer)
,
getLayers()
,
getLayerCount()
public RenderedLayer[] getLayers()
org.geotools.display.canvas.BufferedCanvas2D#getGraphics
.
null
. Change to this array, will not affect this
Renderer
.addLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeAllLayers()
,
getLayerCount()
public int getLayerCount()
org.geotools.display.canvas.BufferedCanvas2D#getGraphics
.
getLayers()
,
addLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeLayer(org.geotools.renderer.j2d.RenderedLayer)
,
removeAllLayers()
public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
org.geotools.display.canvas.BufferedCanvas2D#getRenderingHint
.
key
- The hint key (e.g. Hints.FINEST_RESOLUTION
).
null
if there is no
hint for the specified key.Hints.FINEST_RESOLUTION
,
Hints.REQUIRED_RESOLUTION
,
Hints.COORDINATE_TRANSFORMATION_FACTORY
,
Hints.PREFETCH
,
RenderingHints.KEY_RENDERING
,
RenderingHints.KEY_COLOR_RENDERING
,
RenderingHints.KEY_INTERPOLATION
public void setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)
org.geotools.display.canvas.BufferedCanvas2D#setRenderingHint
.
key
- The hint key (e.g. Hints.FINEST_RESOLUTION
).value
- The hint value. A null
value remove the hint.Hints.FINEST_RESOLUTION
,
Hints.REQUIRED_RESOLUTION
,
Hints.COORDINATE_TRANSFORMATION_FACTORY
,
Hints.PREFETCH
,
RenderingHints.KEY_RENDERING
,
RenderingHints.KEY_COLOR_RENDERING
,
RenderingHints.KEY_INTERPOLATION
public ImageType getOffscreenBuffered(float zOrder)
org.geotools.display.canvas.BufferedCanvas2D#getOffscreenBuffered
.
type
argument given to the last call to
setOffscreenBuffered(...)
for a range containing
zOrder
.
zOrder
- The z-order to query.
ImageType.NONE
, ImageType.VOLATILE
or
ImageType.BUFFERED
enumeration.public void setOffscreenBuffered(float lower, float upper, ImageType type)
org.geotools.display.canvas.BufferedCanvas2D#setOffscreenBuffered
.
VolatileImage
); the image will then been reused as much as possible. The offscreen
buffer may be invalidate at any time by some external event (including a call to any of
RenderedLayer.repaint()
methods) and will be recreated as needed. Using offscreen
buffer for background layers that do not change often (e.g. a background map) help to make
the GUI more responsive to frequent changes in foreground layers (e.g. a glass pane with
highlighted selections).
lower
- The lower z-order, inclusive.upper
- The upper z-order, inclusive.type
- ImageType.VOLATILE
for enabling offscreen buffering for the specified
range, or ImageType.NONE
for disabling it.public void paint(java.awt.Graphics2D graph, java.awt.geom.AffineTransform zoom, java.awt.Rectangle zoomableBounds)
paint(Graphics2D, Rectangle, AffineTransform)
instead.
Renderer
and all visible layers it contains.
This method invokes RenderedLayer.paint(org.geotools.renderer.j2d.RenderingContext)
for each layer.
graph
- The graphics handler.zoom
- The zoom (usually provided by ZoomPane.zoom
.zoomableBounds
- The bounds of drawing area (usually provided by
ZoomPane.getZoomableBounds(java.awt.Rectangle)
).public void paint(java.awt.Graphics2D graph, java.awt.Rectangle zoomableBounds, java.awt.geom.AffineTransform zoom)
paint(Graphics2D,Rectangle,AffineTransform,boolean)
instead.
Renderer
and all visible layers it contains.
paint
in interface Renderer2D
graph
- The graphics handler to draw to.zoomableBounds
- The bounds of the output area in output units (usually pixels).
The upper left corner is (0,0) in most cases. However, a different value
is allowed if some widget area must be preserved, for example a margin on
the left and top size for painting a graduation.zoom
- A transform which converts "World coordinates" to output
coordinates.
This transform will be concatenated to the graphics
transform (as of
graphics.transform
(transform)
)
before the rendering take place.public void paint(java.awt.Graphics2D graph, java.awt.Rectangle zoomableBounds, java.awt.geom.AffineTransform zoom, boolean isPrinting)
org.geotools.display.canvas.BufferedCanvas2D#paint
.
Renderer
and all visible layers it contains.
This method invokes RenderedLayer.paint(org.geotools.renderer.j2d.RenderingContext)
for each layer.
graph
- The graphics handler to draw to.zoomableBounds
- The bounds of the output area in output units (usually pixels).
Those bounds are usually provided by
ZoomPane.getZoomableBounds(java.awt.Rectangle)
).zoom
- A transform which converts "World coordinates" to
output coordinates. This transform is usually provided by
ZoomPane.zoom
.isPrinting
- true
if the map is printed instead of painted on screen.
When printing, layers like RenderedGridCoverage
should block until
all data are available instead of painting only available data and invokes
RenderedLayer.repaint()
later.public java.lang.String getToolTipText(GeoMouseEvent event)
org.geotools.display.canvas.BufferedCanvas2D#getToolTipText
.
event
- The mouse event.
null
if there is no tool tip for the given
mouse location.public javax.swing.Action getAction(GeoMouseEvent event)
org.geotools.display.canvas.BufferedCanvas2D#getAction
.
event
- The mouse event.
null
if there is no action for the given mouve event.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener
.
"preferredArea"
change events.
listener
- The property change listener to be addedpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
org.geotools.display.canvas.BufferedCanvas2D#addPropertyChangeListener
.
PropertyChangeListener
for a specific property.
The listener will be invoked only when that specific property changes.
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener
.
PropertyChangeListener
that
was registered for all properties.
listener
- The property change listener to be removedpublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
org.geotools.display.canvas.BufferedCanvas2D#removePropertyChangeListener
.
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removed.public void dispose()
org.geotools.display.canvas.BufferedCanvas2D#dispose
.
Renderer
defines this method to invoke RenderedLayer.dispose()
for
all layers. The results of referencing a renderer or any of its layers after a call to
dispose()
are undefined. However, invoking this method more than once is
safe.
RenderedLayer.dispose()
,
PlanarImage.dispose()
public java.lang.String toString()
RenderedLayer
s.
The offscreen buffer type, if any, appears in the
right column. This method is for debugging purpose only and may change in any future
version.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |