public class TLspAISStyler extends ALspLabelStyler
AIS
data based on Symbology Encoding
.
This styler can be used for bodies
as well
as labels
.
This styler looks for .sld
files in a set of locations based on the data type of an object.
<datatype>.sld
..sld
files ("com/luciad/ais/symbology/se"
) are automatically added to the list with lowest priority. There is a file for each of the AIS data types.<datatype>_3D.sld
. If no such file is found, it will look for a file named <datatype>.sld
Consider an example where you have an object with data type MyAerodrome
, extending from Aerodrome
,
and you created a styler with location com/my/ais/se
. The styler will sequentially look for these files, and use the first it encounters:
You have various ways to customize the styling provided by this styler.
Provide custom .sld
files
In the example above, you can override the styling of all aerodromes if you provide com/my/ais/se/Aerodrome.sld
.
Note that this file completely replaces the default one, so no existing rules are kept. You can copy one of the
existing files from "com/luciad/ais/symbology/se"
, or create one from scratch.
Use custom property retriever
Sometimes, you may need to use properties that are not available on your data model but rather calculated from other properties.
Also, some of the default styling relies on property names that may not exist on your data model (see further).
In this case, it may be useful to use your own SLD property retriever.
You can provide it through the SLD context in the constructor of this styler.
Wrap this styler
For complete control, you can wrap this styler and delegate to this styler in your style
method.
You can choose when to delegate, when to adapt styles or when to submit your own styles.
See ALspStyleCollectorWrapper
to make wrapping easier.
This styler does styling based on information that is commonly present in the AIS sub-types, but not explicitly
modeled in the TLcdAISDataTypes
, for example
runway
surface type
.
To do this, the default .sld
files used by this styler (in "com/luciad/ais/symbology/se") refer
to properties that do not exist in the data model. If your model does have these properties, they will be picked up.
Otherwise, you can create your own .sld
files based on the default ones, as described above, and for example
adjust them to use other properties.
The properties are:
aerodromes
: Identifierairspaces
: Class, Identifier, Name, Type, ControllingAgency, LowerLimit, LowerLimitUnit, LowerLimitReference, UpperLimit, UpperLimitUnit, UpperLimitReferenceATS routes
: Identifiernavaids
: Identifier, Name, Type, Frequency, MorseCoderefueling tracks
: Identifierrunways
: SurfaceTypewaypoints
: Nameobstacles
: Name
Similarly, the default .sld
files refer to properties that are intercepted to calculate geometry from domain objects:
holdings
and procedures
: GeometryLineNormal, GeometryLineMissed, GeometryLineConnector, GeometryLineDecorator, GeometryLineError, GeometryPointDecorator, GeometryPointrunways
: GeometryRunwayBuffer
This styler can display AIS labels using a custom SLD extension, AISTextSymbolizer
.
This symbolizer is an extension of a regular TextSymbolizer
, so you can use its customization tags,
as well as some others. You can configure what properties to use for specific parts of the label.
For more details, see the documentation in the schema definition com/luciad/ais/symbology/se/lcd_icao_sld.xsd
.
Example:
<FeatureTypeStyle> <Rule> <lcd:AISTextSymbolizer> <lcd:PropertyMappings> <lcd:PropertyMapping key="Identifier">Id</lcd:PropertyMapping> <lcd:PropertyMapping key="Type">NavaidClass</lcd:PropertyMapping> ... </lcd:PropertyMappings> </lcd:AISTextSymbolizer> </Rule> </FeatureTypeStyle>
Constructor and Description |
---|
TLspAISStyler(String... aBaseDirectories)
Creates a new styler that looks in the given directories for
.sld files. |
TLspAISStyler(TLcdSLDContext aSLDContext,
String... aBaseDirectories)
Creates a new styler that looks in the given directories for
.sld files. |
Modifier and Type | Method and Description |
---|---|
void |
style(Collection<?> aObjects,
ALspLabelStyleCollector aLabelStyleCollector,
TLspContext aContext)
Convenience method that takes an
ALspLabelStyleCollector as argument instead of
an ALspStyleCollector . |
void |
style(Collection<?> aObjects,
ALspStyleCollector aStyleCollector,
TLspContext aContext)
Implementation of
ILspStyler.style that either casts the ALspStyleCollector
to ALspLabelStyleCollector if possible, or adapts it otherwise. |
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListener
public TLspAISStyler(String... aBaseDirectories)
Creates a new styler that looks in the given directories for .sld
files. These directories can either
be absolute paths or relative paths in the classpath.
The first location has the highest priority. The default AIS files
("com/luciad/ais/symbology/se"
) will automatically be appended and have
lowest priority.
See class javadoc for details on how the given directories are used.
aBaseDirectories
- An optional set of directories to search for .sld
files.public TLspAISStyler(TLcdSLDContext aSLDContext, String... aBaseDirectories)
Creates a new styler that looks in the given directories for .sld
files. These directories can either
be absolute paths or relative paths in the classpath.
The first location has the highest priority. The default AIS files
("com/luciad/ais/symbology/se"
) will automatically be appended and have
lowest priority.
A SLD context can be provided, for example to provide a custom property retriever.
See class javadoc for details on how the given directories are used.
aSLDContext
- The SLD context to use. Can be null
aBaseDirectories
- An optional set of directories to search for .sld
filespublic void style(Collection<?> aObjects, ALspLabelStyleCollector aLabelStyleCollector, TLspContext aContext)
ALspLabelStyler
Convenience method that takes an ALspLabelStyleCollector
as argument instead of
an ALspStyleCollector
. This method is called from
ALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext)
.
style
in class ALspLabelStyler
aObjects
- The set of domain objects to provide information foraLabelStyleCollector
- The label style collector to submit the information to.aContext
- The contextALspLabelStyleCollector
,
ILspStyler
public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext)
ALspLabelStyler
Implementation of ILspStyler.style
that either casts the ALspStyleCollector
to ALspLabelStyleCollector
if possible, or adapts it otherwise. In the latter case, the labeling-specific
calls (label
, anchorLabel
,
algorithm
, ...) are ignored. The ALspLabelStyleCollector
is then
passed to the style(Collection,ALspLabelStyleCollector,TLspContext)
method.
style
in interface ILspStyler
style
in class ALspLabelStyler
aObjects
- The objects to be styled.aStyleCollector
- A style collector to which all styling information
should be passed, this collector is only valid within this method
call, and can no longer be used afterwards.aContext
- Provides context information that may affect styling, such as view specific properties.