Class TLcyLspMapAddOn

public class TLcyLspMapAddOn extends ALcyPreferencesAddOn

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 components ILcyLspMapComponent.
  • 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 overriding createGUIFactory(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( 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.

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();

  • Constructor Details

    • TLcyLspMapAddOn

      public TLcyLspMapAddOn()
      Default constructor
  • Method Details