Home
Categories
Dictionary
Download
Project Details
Changes Log
Who We Are
FAQ
License

Client API for MapItems



Overview

There are two ways to manage a list of MapItems in the Client API:
  • By setting a list of MapItems in a ClientMapItemList, and synchronize the content of this list with the associated BufferOfItems
  • By directly setting the MapItems in the BufferOfItems
In the two cases, a BufferOfItems and BufferOfItemsInfo must be created for each ClientMapItemList:
      BufferOfItems<Integer, AbstractItem> buffer = new BufferOfItems<>();
      BufferOfItemsInfo info =
      new BufferOfItemsInfo("<a name for the BufferOfItems>", <the Appli ID>, <the Layer ID>, <the MapItemList ID>, buffer);

Setting the list in the ClientMapItemList

      // getting the ClientMapItemList
      MapItemListConstructor constructor = MapItemListConstructor.getInstance();
      ClientMapItemList mapItemList = constructor.getMapItemList(api, <the Appli ID>, <the Layer ID>, <the MapItemList ID>);

      // creating the MapItems (here for each mapItem)
      ClientMapItem mapItem = constructor.createMapItem(<map type>, <MapItem ARINC ID>);
      mapItem.addProperty(<MapItem property name>, 0.1);
      ...
      constructor.addMapItem(mapItemList, <MapItem index>, mapItem);

      // resolving the content of the ClientMapItemList with the azsociated BufferOfItems
      constructor.resolve(mapItemList, buffer);

      // set the BufferOfItems parameter for the MapItem widget
      api.setWidgetParameter(<the Appli ID>, <the Layer ID>, <the MapItemList ID>, ARINC661.A661_BUFFER_OF_MAPITEM, buffer);

      // send the message (can be done after other parameters have been set)
      api.sendAll();

Directly setting the list of BufferOfItems

      // getting the ClientMapItemList
      MapItemListConstructor constructor = MapItemListConstructor.getInstance();

      // creating the MapItems (here for each mapItem)
      ItemMap mapItem = constructor.addMapItem(buffer, <MapItem index>, <map type>, <MapItem ARINC ID>);
      mapItem.addProperty(<MapItem property name>, 0.1);
      ...
      // set the BufferOfItems parameter for the MapItem widget
      api.setWidgetParameter(<the Appli ID>, <the Layer ID>, <the MapItemList ID>, ARINC661.A661_BUFFER_OF_MAPITEM, buffer);

      // send the message (can be done after other parameters have been set)
      api.sendAll();

Example for a HorizontalMap

Here we add a A661_SYMBOL_GENERIC MapItem with the index 1 in the buffer, and we set the "SymbolType", "X" and "Y" properties for this MapItem:
      ItemMap mapItem = constructor.addMapItem(buffer, 1, XMLMapItem.TYPE_HORIZ, "A661_SYMBOL_GENERIC);
      mapItem.addProperty("X", 0.1);
      mapItem.addProperty("Y", 0.1);
      mapItem.addProperty("SymbolType", 1);

See also


Categories: client | dev | user

Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence