Perforce JViews TGO Sample: Network Component - BTS
Description
This sample shows how to use BTS objects in the Perforce JViews TGO network component.
How to Use the Sample
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
network-bts.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Initializing a JTGO application
- Creating a data source
- Creating a network component and connecting it to the data source
- Creating a BTS with its antennas and its equipment
- Reading data from an XML file into a data source
- Adding the network to your Swing application
Detailed Description
This sample shows how to create BTS objects within a JTGO network component, by using either JTGO APIs or XML files. The specific code of this sample can be found in the doSample method of bts.Main. It contains the following steps:
- Initialize the application using the method ilog.tgo.IltSystem.Init.
You pass the name of a deployment descriptor file to this method. - Create a standard data source of class ilog.tgo.datasource.IltDefaultDataSource.
- Create an instance of ilog.tgo.model.IltBTS.
- Load the network configuration example with cascading style sheets that define the BTS representation.
- Create a BTS equipment of class ilog.tgo.model.IltNetworkElement with the type ilog.tgo.model.IltNetworkElement.Type.BTSEquipment
- Create antennas of class ilog.tgo.model.IltBTSAntenna.
- Set the parent/child relationship of the antennas and the BTS equipment by using the method ilog.cpl.datasource.IlpDefaultDataSource.setParent.
- Add all the objects to the data source by using the method ilog.cpl.datasource.IlpDefaultDataSource.addObject.
- Create a network component.
The network component is of class ilog.cpl.IlpNetwork, a JavaBean with a default constructor. - Attach the network component to the data source using the ilog.cpl.IlpNetwork.setDataSource method.
- Read a data file into the data source.
The data file network is read using the ilog.cpl.datasource.IlpDefaultDataSource.parse method. The file contains instances of some JTGO predefined classes: network elements, links, shelves, cards, ports and LEDs. - Add the network to your Swing application.
IlpNetwork
is a SwingJComponent
, which means that it can be added to your application like any other Swing component.
Installation Directory
The Network Component - BTS sample is installed here.
Classes Involved
-
ilog.tgo.IltSystem
The class that initializes a JViews TGO application.
-
ilog.cpl.datasource.IlpDefaultDataSource
The default datasource implementation.
-
ilog.cpl.IlpNetwork
The network component.
-
ilog.tgo.model.IltObject
The predefined business object implementation.
-
ilog.tgo.model.IltBTS
The base transceiver station business object.
-
ilog.tgo.model.IltBTSAntenna
The base transceiver station antenna business object.
-
ilog.tgo.model.IltNetworkElement
The network element business object.
Source Files
-
bts.Main
The entry point of the sample.