// Create a frame. JFrame frame = new JFrame("JTGO equipment sample"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
IlpEquipment equipment = new IlpEquipment(sampleConfigurationFile, context); frame.getContentPane().add(equipment);
// Creates the data source IltDefaultDataSource dataSource = new IltDefaultDataSource(context); // Set data source for the equipment component equipment.setDataSource(dataSource);
equipment.xml
, that contains the equipment nodes and links.
dataSource.parse("equipment.xml");
<addObject id="1004035002697 60"> <class> ilog.tgo.model.IltShelf </class> ... </addObject>
// Creates an empty shelf using API IlpObject obj = new IltShelf(3, 40, 30, 0); // Add object to data source dataSource.addObject(obj); // Set its position to 200, 50 in the view obj.setAttributeValue(IltShelf.PositionAttribute, new IlpPoint(200, 50));