public class TLcyLspMapAddOn extends ALcyPreferencesAddOn
This add-on is the Lightspeed counterpart of the TLcyMapAddOn
, and is structured
very similarly.
It provides:
TLcyLspMapBackEnd
: a class providing functionality to
create and dispose Lightspeed map components ILcyLspMapComponent
.TLcyLspMapComponentFactory
:
creates the Lightspeed map components. This allows all parts of the map component to be
modified.
This factory can be modified by overriding createGUIFactory(String)
, or by adapting the
configuration file.
Consult the Lucy Developer guide for more information.
TLcyLspMapManager
: the
map manager responsible for all Lightspeed map components. This
map manager will be registered to the Lucy back-end as service( see ILcyLucyEnv.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.
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();
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);
Constructor and Description |
---|
TLcyLspMapAddOn()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected ALcyGUIFactory<ILcyLspMapComponent> |
createGUIFactory(String aMapComponentType)
Returns a new
ALcyGUIFactory for a specific map component type. |
TLcyLspMapBackEnd |
getMapBackEnd()
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.
|
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
public void plugInto(ILcyLucyEnv aLucyEnv)
ALcyPreferencesAddOn
plugInto
in class ALcyPreferencesAddOn
aLucyEnv
- the Lucy environment to plug intoALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
public void unplugFrom(ILcyLucyEnv aLucyEnv)
ALcyPreferencesAddOn
unplugFrom
in class ALcyPreferencesAddOn
aLucyEnv
- the Lucy environmentALcyAddOn.plugInto(com.luciad.lucy.ILcyLucyEnv)
public final TLcyLspMapBackEnd getMapBackEnd()
Returns the back-end for Lightspeed maps.
TLcyLspMapBackEnd
objectprotected ALcyGUIFactory<ILcyLspMapComponent> createGUIFactory(String aMapComponentType)
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.
aMapComponentType
- The type of the map componentALcyGUIFactory
for a specific map component type. Must not be
null