Read in an XML file containing the
equipment objects, their positions, and their sizes.
equipmentDataSource.parse("equipment_template.xml");
The data source you have just created reads in the XML file by
parsing the data. The method used is
IltDefaultDataSource.
parse.
The data in the file describes items of
equipment with their IDs, classes, and attributes.
For example:
<addObject id="Shelf1">
<class>ilog.tgo.model.IltShelf</class>
<attribute name="name">Shelf1</attribute>
<attribute name="slotSizes"
javaClass="ilog.cpl.graphic.views.IlpSlotSizes">
<width>
<value>150</value>
<value>30</value>
<value>30</value>
<value>30</value>
<value>30</value>
<value>30</value>
</width>
<height>
<value>34</value>
<value>27</value>
<value>27</value>
<value>27</value>
</height>
</attribute>
<attribute name="position" javaClass="ilog.cpl.graphic.IlpPoint">
<x>22</x> <y>154</y>
</attribute>
</addObject>
This example uses the same static data
file to display the detailed equipment view for each network
element.
The template file does not contain the states of the objects.
These will be loaded in the next step. Creating the objects is
done separately from updating their state, because in a real
application the same template file would probably be used for
many instances of the same type of equipment. Therefore, this
file could not contain the state of individual objects. A
template could typically be generated by the back end or by
the
JViews TGO
equipment editor. See the tutorial in
<installdir>/tutorials/browser
for a more complete example.