Class TLcyLspGridAddOn
This add-on adds a lon-lat grid layer to every Lightspeed map.
The configuration options allow to add such a layer automatically to every new map. Manually adding a grid layer is possible using the action in the menu bar.
The layers will be encoded in the workspace. This add-on adds the grid to newly created Lightspeed maps, but when loading a map from a workspace the layers are only added if they were saved in the workspace.
- Since:
- 2012.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ALcyLspFormatReturns a new data format for this add-on.protected final ALcyLspFormatcreateFormatWrapper(ALcyLspFormat aBaseFormat) Returns a new data format wrapper for this add-on.final ILcdActiongetAddGridActionForMap(ILcyGenericMapComponent<?, ?> aMapComponent) Returns theILcdActionwhich can be used to add a lon-lat grid on the specified map.voidplugInto(ILcyLucyEnv aLucyEnv) Creates and plugs in the add-on's format and preferences tool.Methods inherited from class com.luciad.lucy.addons.lightspeed.ALcyLspFormatAddOn
createFormatTool, getFormat, unplugFromMethods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefixMethods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Constructor Details
-
TLcyLspGridAddOn
public TLcyLspGridAddOn()Default constructor
-
-
Method Details
-
plugInto
Description copied from class:ALcyLspFormatAddOnCreates and plugs in the add-on's format and preferences tool.- Overrides:
plugIntoin classALcyLspFormatAddOn- Parameters:
aLucyEnv- the Lucy environment to plug into- See Also:
-
createBaseFormat
Description copied from class:ALcyLspFormatAddOnReturns 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 ALcyLspFormat createBaseFormat() { return new ALcyLspFormatWrapper(super.createBaseFormat()){ @Override protected ILspLayerFactory createLayerFactory(){ final ILspLayerFactory delegate = super.createLayerFactory(); return new ILspLayerFactory(){ @Override public boolean canCreateLayers(ILcdModel aModel){ return delegate.canCreateLayers(aModel); } @Override public Collection<ILspLayer> createLayers(ILcdModel aModel){ Collection<ILspLayer> layers = delegate.createLayers(aModel); for(ILspLayer layer : layers){ ILcdIcon icon = ...; layer.setIcon(icon) } return layers; } } } } }- Specified by:
createBaseFormatin classALcyLspFormatAddOn- Returns:
- a new format for this add-on
-
createFormatWrapper
Description copied from class:ALcyLspFormatAddOnReturns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as 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).
- Specified by:
createFormatWrapperin classALcyLspFormatAddOn- Parameters:
aBaseFormat- the base format to wrap- Returns:
- a new format for this add-on
- See Also:
-
getAddGridActionForMap
Returns the
ILcdActionwhich can be used to add a lon-lat grid on the specified map.- Parameters:
aMapComponent- The map component- Returns:
- the
ILcdActionwhich can be used to add a lon-lat grid onaMapComponent, ornullwhen no such action is available (for example when the map has already been closed).
-