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

Client API for MapItems


    1  Overview
    2  Setting the list in the ClientMapItemList
    3  Directly setting the list of BufferOfItems
       3.1  Example for a HorizontalMap
    4  See also

Overview

There are two ways to manage a list of MapItems in the Client API: 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


Category: dev Category: client Category: user

Copyright 2016 Dassault Aviation. All Rights Reserved. Documentation and source under the GPL v2 licence

Project Web Hosted by SourceForge.net Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved About - Legal - Help