| Business Objects and Data Sources > Shelves and Cards > Shelves > Creating a Shelf with the API |
Creating a Shelf with the API |
INDEX
PREVIOUS
NEXT
|
This section shows how to create a shelf using the API and how to add it to the data source.
All you have to do is create a shelf using the class IltShelf and add it to a data source, as shown below.
IltShelf s1 = new IltShelf(10,//Number of slots in the shelf 20,//Width of all the slots in the shelf 100,//Height of all the slots in the shelf 0);//Value of the first slot number IlpDataSource dataSource = new IltDefaultDataSource(); dataSource.addObject(s1);
The result looks like this:
The following code creates an empty 4x3 array shelf:
IltShelf s1 = new IltShelf(4,//Number of slots along the x axis 25,//Width of a slot on the x axis 3,//Number of slots along the y axis 30,//Width of a slot on the y axis 0);//Value of the first slot number s1.setAttributeValue(IltShelf.PositionAttribute, new IlpPoint(50, 50)); IlpDataSource dataSource = new IltDefaultDataSource(); dataSource.addObject(s1);
The result looks like this:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |