APIFactory
StatefullAPI
using a client configuration properties fileAPIFactory factory = APIFactory.getInstance(); StatefullAPI api = factory.newStatefullAPI(properties); api.parseDF(df);
extensions=myExtension.jar
api.parseDF(df); List<ARINCLayer> layers = api.getLayersList(df);
graphics=DefGraphics.xml ui=LookAndFeel.xml pictures=DefPictures.xml lf=JavaFX supplement=3 serverInputPort=8080 serverOutputPort=8081 serverInputSize=50000 serverOutputSize=200 server.autoVisible=true windowManager=windows server.windows=simpleWindow.xml server.computeLayerSize=false
api.setWidgetParameter(LAYER_ID, LABEL_ID_1, ARINC661.A661_VISIBLE, true); api.sendAll();
arinc661.client.api.ARINC661
interface. For example, the value of the A661_POS_X keyword is available by arinc661.client.api.ARINC661.A661_POS_X
.
api.connect();
api.disconnect();
api.setLayerRequest(LAYER_ID, ARINC661.A661_REQ_LAYER_VISIBLE, true);
api.setWidgetParameter(APPLI_ID, LAYER_ID, LABEL_ID_1, ARINC661.A661_POS_X, 5000); api.setWidgetParameter(LAYER_ID, LABEL_ID_1, ARINC661.A661_VISIBLE, true); api.setWidgetParameter(LAYER_ID, LABEL_ID_1, ARINC661.A661_STRING, "CANNIBAL CORPSE"); api.setWidgetParameter(LAYER_ID, LABEL_ID_1, ARINC661.A661_STYLE_SET, 12); api.sendAll();
api.addWidgetEventListener(LAYER_ID, PUSHBUTTON_ID, new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; System.out.println("Button Pressed"); } });To check the event ID, check the associated event ID. For example, to check if the cursor enters or exists the area of an A661_CURSOR_OVER widget:
api.addWidgetEventListener(LAYER_ID, CURSOROVER_ID, new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_ENTER) { System.out.println("Cursor Enter"); } else if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_EXIT) { System.out.println("Cursor Exit"); } });If the event has associated valeus, you can retrieve these values with the
getFirstValue()
or getValues()
methods on the WidgetEvent
class. For example, to get the PosX and PosY coordinates of the cursor relative to the A661_CURSOR_OVER widget:api.addWidgetEventListener(LAYER_ID, CURSOROVER_ID, new ARINCEventListener() { public void eventReceived(ARINCEvent evt) { WidgetEvent widgetEvt = (WidgetEvent) evt; if (widgetEvt.getEventID() == ARINC661.A661_EVT_CURSOR_ENTER) { long posX = (long)widgetEvt.getValues.get(0); long posY = (long)widgetEvt.getValues.get(1); System.out.println("Cursor Enter at " + posY + " and " + posY); } });
api.sendBuffer(<Channel ID>, <byte array>, >byte array length>);
sendAll()
method every 2 ms, but only perform the sending every 40 ms to the Server.
APIFactory factory = APIFactory.getInstance(); factory.setSilent(true); StatefullAPI api = factory.newStatefullAPI(properties);Parsing the Layers is still possible. For example:
List<ARINCLayer> layers = api.getLayersList(df);
Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence