public class TLcyS57DecoderAddOn extends ALcyFormatAddOn
This add-on provides the support for S57/S52 hydrographic format.
This add-on allows to decode S-57 data and create models for it. It also provides
the S-52 visualization for the S-57 data on a GXY view. If you want to support
S-63 encrypted data as well you should include the TLcyS63FormatAddOn
as well.
The visualization of the S-57 data is defined in the S-52 standard. This standard allows for
a few customizations. Theses customization options are grouped in a TLcdS52DisplaySettings
object (see the S-57 developer guide for more information). Lucy uses two instances of this
TLcdS52DisplaySettings
class: one for ENC/IENC product types and one for the AML product type. This means that all S-57 layers of the same product type have the same
S-52 style (both GXY as Lightspeed layers).
This add-on registers these TLcdS52DisplaySettings
instances as
Lucy services
.
This add-on provides a menu item allowing to customize the S-52 display settings. The menu item
itself can be customized in the configuration file of this add-on. The actual UI to customize the
display settings is created using the registered ILcyCustomizerPanelFactory
instances
on the Lucy back-end. If you want to adjust the UI for the S-52 display settings, you should register
your own ILcyCustomizerPanelFactory
on the back-end capable of creating
ILcyCustomizerPanel
instances for a TLcdS52DisplaySettings
object.
Constructor and Description |
---|
TLcyS57DecoderAddOn() |
Modifier and Type | Method and Description |
---|---|
protected ALcyFormat |
createBaseFormat()
Returns a new data format for this add-on.
|
protected TLcyFormatTool |
createFormatTool(ALcyFormat aFormat)
Creates a new format tool for the given format.
|
protected ALcyFormat |
createFormatWrapper(ALcyFormat aBaseFormat)
Returns a new data format wrapper for this add-on.
|
void |
plugInto(ILcyLucyEnv aLucyEnv)
Creates and plugs in the add-on's format.
|
void |
unplugFrom(ILcyLucyEnv aLucyEnv)
Unplugs the add-on's format.
|
getFormat
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
public void plugInto(ILcyLucyEnv aLucyEnv)
ALcyFormatAddOn
Creates and plugs in the add-on's format.
plugInto
in class ALcyFormatAddOn
aLucyEnv
- the Lucy environment to plug intoALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
public void unplugFrom(ILcyLucyEnv aLucyEnv)
ALcyFormatAddOn
unplugFrom
in class ALcyFormatAddOn
aLucyEnv
- the Lucy environmentALcyAddOn.plugInto(com.luciad.lucy.ILcyLucyEnv)
protected ALcyFormat createBaseFormat()
ALcyFormatAddOn
Returns a new data format for this add-on. Override this method to extend the default format with new functionality.
For example, to alter the icon of the layers of this format, you can decorate the layer factory created in the format:
@Override
protected ALcyFormat createBaseFormat() {
return new ALcyFormatWrapper(super.createBaseFormat()){
@Override
protected ILcdGXYLayerFactory createGXYLayerFactory(){
final ILcdGXYLayerFactory delegate = super.createGXYLayerFactory();
return new ILcdGXYLayerFactory(){
@Override
public ILcdGXYLayer createGXYLayer(ILcdModel aModel){
ILcdGXYLayer layer = delegate.createGXYLayer(aModel);
if (layer != null){
ILcdIcon icon = ...;
layer.setIcon(icon);
}
return layer;
}
}
}
}
}
createBaseFormat
in class ALcyFormatAddOn
protected final ALcyFormat createFormatWrapper(ALcyFormat aBaseFormat)
ALcyFormatAddOn
Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as asynchronous painting, mutable file behavior, safe guarding, etc.
Overriding this method of an existing add-on should be done with extreme care as add-ons typically rely on the wrappers that should be present (e.g. a safe guard).
createFormatWrapper
in class ALcyFormatAddOn
aBaseFormat
- the base format to wrapALcyFormatWrapper
protected TLcyFormatTool createFormatTool(ALcyFormat aFormat)
ALcyFormatAddOn
Creates a new format tool for the given format. It is used to plug all parts of the format (
e.g. ILcdGXYLayerFactory
, ILcdModelDecoder
, etc.) into
ILcyLucyEnv
.
createFormatTool
in class ALcyFormatAddOn
aFormat
- the format for which to create a toolTLcyFormatTool