public class TLcdSLDSymbolizerPainterFactory extends Object implements ILcdSLDSymbolizerPainterFactory, ILcdCloneable
ILcdSLDSymbolizerPainterFactory
that provides support for creating
symbolizer painters for point, line, polygon, raster and text symbolizers.
This class provides specific methods, depending on the type of symbolizer to create
a symbolizer painter for: createPointSymbolizerPainter,
createLineSymbolizerPainter,
createPolygonSymbolizerPainter,
createRasterSymbolizerPainter,
createTextSymbolizerPainter.
Each of these methods calls methods specific to the setup of the painter they will create, listed below.
The line symbolizer painter is set up to let the style be interpreted by a ILcdGraphicsProvider
.
The graphics provider is responsible to set up a Graphics so that the style defined in the symbolizer is applied
when rendering on the Graphics. The actual rendering is done by ILcdGXYPainter
implementations which
are not allowed to alter the settings on the Graphics. These painters are provided by a
ILcdGXYPainterProvider
. The painter provider is required since the symbolizer does not impose any
restrictions on the geometry that should be rendered. E.g., a line symbolizer can be applied to arcs, arcbands,
circles, buffers, ... . The method to create a line symbolizer therefor calls
ILcdGraphicsProvider
that alters the Graphics so
that any line rendering will have the style defined in the Stroke applied to it.
ILcdGXYPainterProvider
that returns
ILcdGXYPainter
instances which do not apply any style and are capable of rendering outlined vector
geometries e.g., an outlined circle, an outlined bounds, an outlined buffer, ... .
ILcdGraphicsProvider
that alters the Graphics so
that any area rendering will have the style defined in the Fill of the polygon symbolizer applied to it.
ILcdGXYPainterProvider
that returns
ILcdGXYPainter
instances which do not apply any style and are capable of rendering filled vector
geometries e.g., a filled circle, a filled bounds, a filled buffer, ... . Note that these painters should NOT
render the outline of an area.
ILcdObjectIconProvider
. As the line
and the polygon symbolizer it has ILcdGXYPainterProvider
which returns ILcdGXYPainter
instances for different geometries. However, the painter provider should return TLcdGXYIconPainter
instances, as the ILcdIcon
returned by the icon provider should be set to the painter returned by the
painter provider. The method to create a point symbolizer painter calls
ILcdGXYPainterProvider
that only returns
TLcdGXYIconPainter
instances.
ILcdObjectIconProvider
that returns for an object the
ILcdIcon
that represents the Graphic for the point symbolizer for that object.
ILcdGXYPainterProvider
.
The method to create a raster symbolizer painter calls:
ILcdGXYPainterProvider
capable of
rendering raster data (ILcdRaster
, ILcdMultilevelRaster
, ILcdEarthTileSet
and/or ALcdImage
).
If the painter provider returns a TLcdGXYImagePainter
(default), it is automatically configured
based on the supported raster symbolizer properties (opacity, gamma value, color map, channel selection).
ILcdGXYLabelPainter
. The text symbolizer style is
split up in three parts: a ILcdGraphicsProvider
for the halo of the text,
a ILcdGraphicsProvider
for the fill of the text and a
TLcdSLDTextSymbolizerPropertiesProvider
which encapsulates the rest of the styling information.
This method calls
ILcdSLDGraphicsProvider
which applies the style
defined by the Graphic in the Fill when rendering the Halo of the text.
ILcdSLDGraphicsProvider
which applies the style
defined by the Font and the Fill when rendering the text. Note that this methods implementation uses the graphics
provider created with createFillGraphicsProvider method in order to combine both into one graphics provider.
A symbolizer can optionally contain vendor options
,
which define additional behavior beyond the OGC Styled Layer Descriptor / Symbology Encoding standards.
A vendor option is defined by a name and a value. The following vendor options are supported:
followLine
, which takes a boolean value and can be configured on a text symbolizer
to render curved labels that follow a feature's geometry.removeAlphaChannel
, which takes a boolean value and can be configured on a raster symbolizer
to remove the alpha channel from an image.conflictResolution
, which takes a boolean value and can be configured on a text symbolizer
to disable label placement conflict resolution (label decluttering).repeat
, which takes an integer value and can be configured on a text symbolizer
to repeat labels along a path, taking into account the specified integer in pixels
as distance to be used between subsequent labels; this parameter is only supported for curved labels (= if the vendor option followLine
is set to true). If repeating is enabled, the label gets repeated 10 times at the most.Constructor and Description |
---|
TLcdSLDSymbolizerPainterFactory() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
protected ILcdGXYEditorProvider |
createFillEditorProvider()
Create an editor provider that edits filled objects.
|
protected ILcdSLDGraphicsProvider |
createFillGraphicsProvider(TLcdSLDFill aFill,
TLcdSLDContext aSLDContext)
Creates a
ILcdSLDGraphicsProvider that sets up a Graphics object according to the styling
information contained in the TLcdSLDFill passed. |
protected ILcdGXYPainterProvider |
createFillPainterProvider()
Create a painter provider that paints objects in filled mode.
|
protected ILcdSLDGraphicsProvider |
createFontFillGraphicsProvider(TLcdSLDTextSymbolizer aSLDTextSymbolizer,
TLcdSLDContext aSLDContext)
Creates a graphics provider that takes into account the Font and the Fill style settings of a text symbolizer.
|
protected ILcdObjectIconProvider |
createIconProvider(TLcdSLDGraphic aGraphic,
TLcdSLDContext aSLDContext)
Creates an icon provider that supports marks and external graphics in formats supported by the JVM by default.
|
protected ALcdSLDSymbolizerPainter |
createLineSymbolizerPainter(TLcdSLDLineSymbolizer aSLDLineSymbolizer,
TLcdSLDContext aSLDContext)
Creates a
TLcdSLDLineSymbolizerPainter , based on
the graphics provider for strokes returned by createStrokeGraphicsProvider,
the painter provider for strokes returned by createStrokePainterProvider,
the SLD context passed. |
protected ILcdGXYEditorProvider |
createPointEditorProvider()
Creates and
ILcdGXYEditorProvider that will be used to edit objects that
are rendered as points. |
protected ILcdGXYPainterProvider |
createPointPainterProvider()
Creates the ILcdGXYPainterProvider the point symbolizer painter will delegate the actual painting to.
|
protected ALcdSLDSymbolizerPainter |
createPointSymbolizerPainter(TLcdSLDPointSymbolizer aSLDPointSymbolizer,
TLcdSLDContext aSLDContext)
Creates a point symbolizer painter based on the icon provider created with createIconProvider, the
painter provider created with createPointPainterProvider and the context passed.
|
protected ALcdSLDSymbolizerPainter |
createPolygonSymbolizerPainter(TLcdSLDPolygonSymbolizer aSLDPolygonSymbolizer,
TLcdSLDContext aSLDContext)
Creates a polygon symbolizer painter, based on
the graphics provider for strokes returned by createStrokeGraphicsProvider,
the painter provider for strokes returned by createStrokePainterProvider,
the graphics provider for fills returned by createFillGraphicsProvider,
the painter provider for fills returned by createStrokePainterProvider and
the SLD context passed.
|
protected ILcdGXYEditorProvider |
createRasterEditorProvider()
Creates and
ILcdGXYEditorProvider that can be used to edit
rasters
This method is currently not used and returns null by default. |
protected ILcdGXYPainterProvider |
createRasterPainterProvider()
Creates a painter provider for rasters.
|
protected ALcdSLDSymbolizerPainter |
createRasterSymbolizerPainter(TLcdSLDRasterSymbolizer aSLDRasterSymbolizer,
TLcdSLDContext aSLDContext)
Creates a raster symbolizer painter that styles objects according to
the supplied
TLcdSLDRasterSymbolizer . |
protected ILcdObjectIconProvider |
createSelectionIconProvider(TLcdSLDGraphic aGraphic,
TLcdSLDContext aSLDContext)
Creates an icon provider that supports marks and external graphics in
formats supported by the JVM by default.
|
protected ILcdGXYEditorProvider |
createStrokeEditorProvider(ALcdSLDSymbolizer aSymbolizer)
Returns an editor provider to edit lines.
|
protected ILcdSLDGraphicsProvider |
createStrokeGraphicsProvider(TLcdSLDStroke aStroke,
ALcdSLDSymbolizer aSymbolizer,
TLcdSLDContext aSLDContext)
Creates a
ILcdSLDGraphicsProvider that sets up a Graphics
object according to the styling information contained in the
TLcdSLDStroke passed. |
protected ILcdSLDGraphicsProvider |
createStrokeGraphicsProvider(TLcdSLDStroke aStroke,
TLcdSLDContext aSLDContext)
Deprecated.
Override
createStrokeGraphicsProvider(TLcdSLDStroke, ALcdSLDSymbolizer, TLcdSLDContext)
instead of this method. |
protected ILcdGXYPainterProvider |
createStrokePainterProvider(ALcdSLDSymbolizer aSymbolizer)
Deprecated.
Override
createStrokePainterProvider(ALcdSLDSymbolizer,TLcdSLDContext)
instead of this method. |
protected ILcdGXYPainterProvider |
createStrokePainterProvider(ALcdSLDSymbolizer aSymbolizer,
TLcdSLDContext aSLDContext)
Returns a painter provider to paint lines.
|
ALcdSLDSymbolizerPainter |
createSymbolizerPainter(ALcdSLDSymbolizer aSLDSymbolizer,
TLcdSLDContext aSLDContext)
Calls on a specific method depending on the symbolizer type.
|
protected ALcdSLDSymbolizerPainter |
createTextSymbolizerPainter(TLcdSLDTextSymbolizer aSLDTextSymbolizer,
TLcdSLDContext aSLDContext)
Creates a text symbolizer label painter that styles objects according to the supplied TLcdSLDTextSymbolizer.
|
boolean |
getPaintCache()
Returns whether caching is used by the painters created by the default implementation of this
painter factory.
|
void |
setPaintCache(boolean aPaintCache)
Turns caching of the representation of the object on or off.
|
public void setPaintCache(boolean aPaintCache)
ILcdCache
. By default, caching is turned on.
This field only applies to the default implementations of the methods that create painter or
editor providers. Please respect this field when overriding methods of this class.aPaintCache
- A flag indicating whether to use caching when painting an object.getPaintCache()
,
createStrokePainterProvider(ALcdSLDSymbolizer,TLcdSLDContext)
,
createFillPainterProvider()
public boolean getPaintCache()
true
if caching is used to paint this painter's object, false
otherwise.setPaintCache(boolean)
,
createStrokePainterProvider(ALcdSLDSymbolizer,TLcdSLDContext)
,
createFillPainterProvider()
public ALcdSLDSymbolizerPainter createSymbolizerPainter(ALcdSLDSymbolizer aSLDSymbolizer, TLcdSLDContext aSLDContext)
TLcdSLDLineSymbolizer
,
TLcdSLDPolygonSymbolizer
, TLcdSLDPointSymbolizer
,
TLcdSLDTextSymbolizer
, and TLcdSLDRasterSymbolizer
.createSymbolizerPainter
in interface ILcdSLDSymbolizerPainterFactory
aSLDSymbolizer
- the model for the styling information to take into account.aSLDContext
- the context for which the painter should be created.createPointSymbolizerPainter(com.luciad.ogc.sld.model.TLcdSLDPointSymbolizer, TLcdSLDContext)
,
createLineSymbolizerPainter(com.luciad.ogc.sld.model.TLcdSLDLineSymbolizer, TLcdSLDContext)
,
createPolygonSymbolizerPainter(com.luciad.ogc.sld.model.TLcdSLDPolygonSymbolizer, TLcdSLDContext)
,
createRasterSymbolizerPainter(com.luciad.ogc.sld.model.TLcdSLDRasterSymbolizer, TLcdSLDContext)
,
createTextSymbolizerPainter(com.luciad.ogc.sld.model.TLcdSLDTextSymbolizer, TLcdSLDContext)
protected ALcdSLDSymbolizerPainter createRasterSymbolizerPainter(TLcdSLDRasterSymbolizer aSLDRasterSymbolizer, TLcdSLDContext aSLDContext)
TLcdSLDRasterSymbolizer
.
The symbolizer painter for the outline is created with createSymbolizerPainter for either the line
or polygon symbolizer contained in the outline.
Note that overlap behaviour and contrast enhancement (apart from the gamma value) are not taken into account.aSLDRasterSymbolizer
- a raster symbolizeraSLDContext
- the SLD contextcreateRasterPainterProvider()
,
createSymbolizerPainter(com.luciad.ogc.sld.model.ALcdSLDSymbolizer, TLcdSLDContext)
protected ALcdSLDSymbolizerPainter createTextSymbolizerPainter(TLcdSLDTextSymbolizer aSLDTextSymbolizer, TLcdSLDContext aSLDContext)
aSLDTextSymbolizer
- a text symbolizeraSLDContext
- the SLD contextprotected ILcdSLDGraphicsProvider createFontFillGraphicsProvider(TLcdSLDTextSymbolizer aSLDTextSymbolizer, TLcdSLDContext aSLDContext)
aSLDTextSymbolizer
- the text symbolizer to interpret the style of.aSLDContext
- the context in which the style should be interpreted.protected ALcdSLDSymbolizerPainter createPointSymbolizerPainter(TLcdSLDPointSymbolizer aSLDPointSymbolizer, TLcdSLDContext aSLDContext)
aSLDPointSymbolizer
- the symbolizer model to create a painter for.aSLDContext
- the context in which the painter should be applied.TLcdSLDPointSymbolizerPainter
createIconProvider(com.luciad.ogc.sld.model.TLcdSLDGraphic, TLcdSLDContext)
protected ILcdObjectIconProvider createIconProvider(TLcdSLDGraphic aGraphic, TLcdSLDContext aSLDContext)
aGraphic
- the Graphic model to create an icon for.aSLDContext
- the context to create the icons in.protected ILcdObjectIconProvider createSelectionIconProvider(TLcdSLDGraphic aGraphic, TLcdSLDContext aSLDContext)
aGraphic
- the Graphic model to create an icon for.aSLDContext
- the context to create the icons in.createIconProvider(TLcdSLDGraphic, TLcdSLDContext)
protected ALcdSLDSymbolizerPainter createPolygonSymbolizerPainter(TLcdSLDPolygonSymbolizer aSLDPolygonSymbolizer, TLcdSLDContext aSLDContext)
aSLDPolygonSymbolizer
- the model for the styling instructions to take into account.aSLDContext
- the context for which the painter should be created.protected ALcdSLDSymbolizerPainter createLineSymbolizerPainter(TLcdSLDLineSymbolizer aSLDLineSymbolizer, TLcdSLDContext aSLDContext)
TLcdSLDLineSymbolizerPainter
, based on
aSLDLineSymbolizer
- the model for the styling instructions to take into account.aSLDContext
- the context for which the painter should be created.TLcdSLDLineSymbolizerPainter
protected ILcdSLDGraphicsProvider createFillGraphicsProvider(TLcdSLDFill aFill, TLcdSLDContext aSLDContext)
ILcdSLDGraphicsProvider
that sets up a Graphics object according to the styling
information contained in the TLcdSLDFill
passed.
This implementation returns different implementations of ILcdSLDGraphicsProvider
, depending on
whether the TLcdSLDFill
contains a graphic fill or not. CSS parameters are disregarded when
the graphic fill is not null.aFill
- the styling information that should be taken into account.aSLDContext
- the context for which the graphics provider should be created.ILcdSLDGraphicsProvider
that takes the graphic fill into account, when it is different
from null, or that takes the CSS parameters into account otherwise.protected ILcdSLDGraphicsProvider createStrokeGraphicsProvider(TLcdSLDStroke aStroke, ALcdSLDSymbolizer aSymbolizer, TLcdSLDContext aSLDContext)
ILcdSLDGraphicsProvider
that sets up a Graphics
object according to the styling information contained in the
TLcdSLDStroke
passed. CSS parameters are disregarded when the
graphic fill or graphic stroke is not null.aStroke
- the styling information that should be taken into account.aSymbolizer
- The symbolizer that contains the stroke, can be used to
retrieve information about the uom.aSLDContext
- the context for which the graphics provider should be
created.ILcdSLDGraphicsProvider
that takes into account the
first non null parameter that it encounters in the
TLcdSLDStroke
passed, in the following order: graphic
stroke, graphic fill, CSS parameters.protected ILcdSLDGraphicsProvider createStrokeGraphicsProvider(TLcdSLDStroke aStroke, TLcdSLDContext aSLDContext)
createStrokeGraphicsProvider(TLcdSLDStroke, ALcdSLDSymbolizer, TLcdSLDContext)
instead of this method.ILcdSLDGraphicsProvider
that sets up a Graphics
object according to the styling information contained in the
TLcdSLDStroke
passed. CSS parameters are disregarded when the
graphic fill or graphic stroke is not null.aStroke
- the styling information that should be taken into account.aSLDContext
- the context for which the graphics provider should be
created.ILcdSLDGraphicsProvider
that takes into account the
first non null parameter that it encounters in the
TLcdSLDStroke
passed, in the following order: graphic
stroke, graphic fill, CSS parameters.protected ILcdGXYPainterProvider createStrokePainterProvider(ALcdSLDSymbolizer aSymbolizer)
createStrokePainterProvider(ALcdSLDSymbolizer,TLcdSLDContext)
instead of this method.ILcdArcBand
,
ILcdArc
,
ILcdCircularArc
,
ILcdBounds
,
ILcdGeoBuffer
,
TLcdLonLatBuffer
,
TLcdLonLatHeightBuffer
,
ILcdVariableGeoBuffer
,
ILcdCircle
,
ILcdCircleBy3Points
,
ILcdEllipse
,
ILcdPolygon
,
ILcdComplexPolygon
,
ILcdPolyline
,
ILcdRaster
,
ILcdMultilevelRaster
,
ILcdPoint
,
ILcdCompositeCurve
,
TLcdLonLatCompositeRing
,
TLcdXYCompositeRing
,
ILcdSurface
,
ILcdShapeList
, and
ILcdBounded
.
The points and rasters are rendered as specified in the standard.
If the symbolizer is a polygon symbolizer, point lists will be rendered as polygons, otherwise they will be
rendered as polylines.aSymbolizer
- depending on the symbolizer the painters returned by the painter provider might be
configured differently, e.g. the TLcdGXYPointListPainter
mode should be set differently when the
stroke painter provider should be created for a linesymbolizer or a polygonsymbolizer.protected ILcdGXYPainterProvider createStrokePainterProvider(ALcdSLDSymbolizer aSymbolizer, TLcdSLDContext aSLDContext)
ILcdArcBand
,
ILcdArc
,
ILcdCircularArc
,
ILcdBounds
,
ILcdGeoBuffer
,
TLcdLonLatBuffer
,
TLcdLonLatHeightBuffer
,
ILcdVariableGeoBuffer
,
ILcdCircle
,
ILcdCircleBy3Points
,
ILcdEllipse
,
ILcdPolygon
,
ILcdComplexPolygon
,
ILcdPolyline
,
ILcdRaster
,
ILcdMultilevelRaster
,
ILcdPoint
,
ILcdCompositeCurve
,
TLcdLonLatCompositeRing
,
TLcdXYCompositeRing
,
ILcdSurface
,
ILcdShapeList
, and
ILcdBounded
.
The points and rasters are rendered as specified in the standard.
If the symbolizer is a polygon symbolizer, point lists will be rendered as polygons, otherwise they will be
rendered as polylines.aSymbolizer
- depending on the symbolizer the painters returned by the painter provider might be
configured differently, e.g. the TLcdGXYPointListPainter
mode should be set differently when the
stroke painter provider should be created for a linesymbolizer or a polygonsymbolizer.aSLDContext
- the context for which the painter provider should be created.protected ILcdGXYPainterProvider createFillPainterProvider()
ILcdArcBand
,
ILcdArc
,
ILcdCircularArc
,
ILcdBounds
,
ILcdGeoBuffer
,
TLcdLonLatBuffer
,
TLcdLonLatHeightBuffer
,
ILcdVariableGeoBuffer
,
ILcdCircle
,
ILcdCircleBy3Points
,
ILcdEllipse
,
ILcdPolygon
,
ILcdComplexPolygon
,
ILcdPolyline
,
ILcdRaster
,
ILcdMultilevelRaster
,
ILcdPoint
,
ILcdCompositeCurve
,
TLcdLonLatCompositeRing
,
TLcdXYCompositeRing
,
ILcdSurface
,
ILcdShapeList
, and
ILcdBounded
.
The points and rasters are rendered as specified in the standard.protected ILcdGXYPainterProvider createPointPainterProvider()
ILcdGXYPainterProvider
must always return
a TLcdGXYIconPainter
for every object.
This implementation provides support for objects which implement ILcdBounded
.ILcdGXYPainterProvider returning a TLcdGXYIconPainter
for every object.
protected ILcdGXYPainterProvider createRasterPainterProvider()
TLcdGXYImagePainter
(default), it is automatically configured
based on the supported raster symbolizer properties (opacity, gamma value, color map, channel selection).protected ILcdGXYEditorProvider createStrokeEditorProvider(ALcdSLDSymbolizer aSymbolizer)
ILcdArcBand
,
ILcdArc
,
ILcdCircularArc
,
ILcdBounds
,
ILcdGeoBuffer
,
TLcdLonLatBuffer
,
TLcdLonLatHeightBuffer
,
ILcdVariableGeoBuffer
,
ILcdCircle
,
ILcdCircleBy3Points
,
ILcdEllipse
,
ILcdPolygon
,
ILcdComplexPolygon
,
ILcdPolyline
,
ILcdCompositeCurve
,
TLcdLonLatCompositeRing
,
TLcdXYCompositeRing
,
ILcdShapeList
, and
ILcdBounded
.aSymbolizer
- depending on the symbolizer the editors returned by the editor provider might be
configured differently, e.g. the TLcdGXYPointListPainter
mode should be set differently when the
stroke editor provider should be created for a linesymbolizer or a polygonsymbolizer.protected ILcdGXYEditorProvider createFillEditorProvider()
ILcdArcBand
,
ILcdArc
,
ILcdCircularArc
,
ILcdBounds
,
ILcdGeoBuffer
,
TLcdLonLatBuffer
,
TLcdLonLatHeightBuffer
,
ILcdVariableGeoBuffer
,
ILcdCircle
,
ILcdCircleBy3Points
,
ILcdEllipse
,
ILcdPolygon
,
ILcdComplexPolygon
,
ILcdPolyline
,
TLcdLonLatCompositeRing
,
TLcdXYCompositeRing
,
ILcdSurface
,
ILcdShapeList
, and
ILcdBounded
.protected ILcdGXYEditorProvider createPointEditorProvider()
ILcdGXYEditorProvider
that will be used to edit objects that
are rendered as points.
Note that this ILcdGXYEditorProvider
must always return
a TLcdGXYIconPainter
for every object.
This implementation provides support for objects that implement ILcdBounded
.ILcdGXYEditorProvider returning a TLcdGXYIconPainter
for every object.
protected ILcdGXYEditorProvider createRasterEditorProvider()
ILcdGXYEditorProvider
that can be used to edit
rasters
This method is currently not used and returns null by default. Editing
rasters is not supported.public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()