| Business Objects and Data Sources > Shelves and Cards > LEDs > Creating an LED with the API |
Creating an LED with the API |
INDEX
PREVIOUS
NEXT
|
This section shows how to create an LED using the API and how to add it to the data source.
When you create an LED with the API, you must provide its type, which can be set through the constructor or through the setAttributeValue method; the following sample shows how to create an LED of type Circular:
List objects = new ArrayList();
// create shelf identified as myShelf
IltShelf s1 = new IltShelf("myShelf");
s1.setSlotSizes(2,50,1,100);
objects.add(s1);
// create card
IltCard c1 = new IltCard(new IltOSIObjectState(), "card 1");
c1.setPosition(new IlpShelfItemPosition(0, 0, 1, 1));
objects.add(c1);
// create card item
IltLed l1 = new IltLed("myLed");
l1.setType(IltLed.Type.Circular);
l1.setPosition(new IlpRelativePoint(25,85));
objects.add(l1);
// add all objects to data source
datasource.addObjects(objects);
The result looks like this:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |