skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Using the GUI beans > The Altitude Visibility Chart bean
 
The Altitude Visibility Chart bean
Describes the Altitude Visibility Chart bean and how to use it.
*Overview
*Describes the Altitude Visibility Chart bean.
*Integrating the Altitude Visibility Chart bean into an Application
*Explains how to integrate the Altitude Visibility chart bean into your application.
Overview
The Altitude Visibility Chart bean is represented by the IlvAltitudeVisibilityChart class. This bean is used by the Line of Sight interactor. The Line of Sight interactor is a graphic object displayed in one of the layers of a view and represented by the IlvLineOfVisibility class, see Line of Sight interactor.
To create the Altitude Visibility Chart, you can either use the Line of Sight interactor, see Creating and Installing the Area of Sight interactor, or, for more precise control, write the lines of code given in this section.
The following figure shows an example of an Altitude Visibility Chart.
Altitude Visibility Chart
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps/samples/mapbuilder/index.html.
Integrating the Altitude Visibility Chart bean into an Application
To integrate the Altitude Visibility Chart bean into your application, you must first create the Line of Sight object in your program:
Setting the Line of Sight interactor parameters
*Set the points defining the Line of Sight polyline for which the altitudes will be displayed:
 
   IlvPoint[] points = new IlvPoint[] {
// Define your points as view coordinates here.
   };
 
// Transform the points into manager coordinates.
// You can also define your points directly in
// manager coordinates.
   for(int i = 0; i < points.length; i++)
      view.getTransformer().inverse(points[i]);
 
// Create the line of visibility
   IlvLineOfVisibility lineofvisibility = new
      IlvLineOfVisibility(manager,100,1000,points[0],points[2]);
Creating a data source and map layer
*To manage the Line of Sight in standard JViews Maps beans, you also need to create a data source and Map Layer, and link them with the manager properties.
 
IlvMapLayerTreeModel ltm =
  IlvMapLayerTreeProperty.GetMapLayerTreeModel(manager);
IlvMapDataSourceModel dsm =
  IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
IlvGraphicLayerDataSource dataSource=new IlvGraphicLayerDataSource();
dsm.insert(dataSource);
IlvMapLayer mapLayer = dataSource.getInsertionLayer();
mapLayer.setAllowingMoveObjects(true);
mapLayer.setStyle(new IlvLineOfVisibilityStyle());
ltm.addChild(null, mapLayer);
Adding the Line of Sight to the data source
*Add the Line of Sight object to the data source so that it can be managed by the data source, for example, to change the representation when the coordinate system changes.
 
dataSource.add(lineofvisibility);
Creating an Altitude Visibility chart
*Create the Altitude Visibility chart from a Line of Sight:
 
IlvAltitudeVisibilityChart avc = new
  IlvAltitudeVisibilityChart(manager,lineofvisibility);
Recomputing the Altitude Visibility chart
*Recompute the chart when it has been resized:
 
avc.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
   avc.updateChart();
   }
});

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.