Class TLcyLspMapAddOn
This add-on is the Lightspeed counterpart of the TLcyMapAddOn
, and is structured
very similarly.
It provides:
- Lightspeed map back-end
TLcyLspMapBackEnd
: a class providing functionality to create and dispose Lightspeed map componentsILcyLspMapComponent
. - Lightspeed map component factory
TLcyLspMapComponentFactory
: creates the Lightspeed map components. This allows all parts of the map component to be modified. This factory can be modified by overridingcreateGUIFactory(String)
, or by adapting the configuration file. Consult the Lucy Developer guide for more information. - Lightspeed map manager
TLcyLspMapManager
: the map manager responsible for all Lightspeed map components. This map manager will be registered to the Lucy back-end as service( seeILcyLucyEnv.getService(Class)
).
It is possible to have multiple types of map component.
For each type of map component a separate factory is created (see createGUIFactory(String)
).
The configuration file of the add-on allows to have separate properties passed to each factory.
This mechanism is further illustrated in the missionmap sample.
Consult the Lucy developer guide for more information on how to customize Lightspeed maps.
Typical use-cases
Creating a new map
Creating a map and adding it the UI can be done through the back-end
ILcyLucyEnv lucy = ...;
TLcyLspMapAddOn mapAddOn = aLucyEnv.retrieveAddOnByClass(TLcyLspMapAddOn.class);
TLcyLspMapBackEnd mapBackEnd = mapAddOn.getMapBackEnd();
//This method will create the map, but also ensure that it is added to the UI, registered to the map manager, ...
ILcyLspMapComponent mapComponent = mapBackEnd.createMapComponent();
Removing a map
Removing a map is done by disposing the application pane containing the map:
ILcyLucyEnv lucy = ...;
ILcyGenericMapComponent map = ...;
//Request the manager of the UI panels in Lucy
TLcyApplicationPaneManager applicationPaneManager = lucy.getUserInterfaceManager().getApplicationPaneManager();
//Ask the manager to dispose the application pane of the map
//This will trigger all necessary clean-up code
applicationPaneManager.applyOnApplicationPane(map.getComponent(), ILcyApplicationPane::disposeApp);
An alternative is using the back-end
ILcyLucyEnv lucy = ...;
ILcyLspMapComponent map = ...;
TLcyLspMapAddOn mapAddOn = aLucyEnv.retrieveAddOnByClass(TLcyLspMapAddOn.class);
TLcyLspMapBackEnd mapBackEnd = mapAddOn.getMapBackEnd();
mapBackEnd.disposeMapComponent(map);
- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ALcyGUIFactory
<ILcyLspMapComponent> createGUIFactory
(String aMapComponentType) Returns a newALcyGUIFactory
for a specific map component type.final TLcyLspMapBackEnd
Returns the back-end for Lightspeed maps.void
plugInto
(ILcyLucyEnv aLucyEnv) Creates and plugs in the add-on's preferences tool.void
unplugFrom
(ILcyLucyEnv aLucyEnv) Unplugs the add-on's preferences tool.Methods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
Methods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Constructor Details
-
TLcyLspMapAddOn
public TLcyLspMapAddOn()Default constructor
-
-
Method Details
-
plugInto
Description copied from class:ALcyPreferencesAddOn
Creates and plugs in the add-on's preferences tool.- Overrides:
plugInto
in classALcyPreferencesAddOn
- Parameters:
aLucyEnv
- the Lucy environment to plug into- See Also:
-
unplugFrom
Description copied from class:ALcyPreferencesAddOn
Unplugs the add-on's preferences tool.- Overrides:
unplugFrom
in classALcyPreferencesAddOn
- Parameters:
aLucyEnv
- the Lucy environment- See Also:
-
getMapBackEnd
Returns the back-end for Lightspeed maps.
- Returns:
- a
TLcyLspMapBackEnd
object
-
createGUIFactory
Returns a new
ALcyGUIFactory
for a specific map component type. Override this method if you want to modify the map components.It is also possible to modify the returned GUI factory by altering the config file of the add-on. Consult the configuration file for more information on how to achieve this.
Typically you should not call this method yourself. If you want to create a new map component through the code, use the
TLcyLspMapBackEnd#createMapComponent(String)
method.The Lucy developer guide contains more information about customizing Lightspeed maps.
- Parameters:
aMapComponentType
- The type of the map component- Returns:
- a new
ALcyGUIFactory
for a specific map component type. Must not benull
-