skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Map Defense GUI interactors > Gradient interactor
 
Gradient interactor
Describes the Gradient interactor.
*Overview
*Explains the use of the IlvMakeGradientInteractor class to display color-coded gradients within a selected rectangle of terrain.
*Creating and Installing the Gradient interactor
*Provides code for creating the Gradient interactor.
*Using the Gradient interactor
*Describes the functioning of the Gradient interactor and the style parameters that can be used.
Overview
The IlvMakeGradientInteractor allows the user to display in a manager view color coded gradients within a selected rectangle of terrain.
To use this interactor, the user selects the area for which gradients are to be computed and defines the initial style and parameters to use for the computation. A new area, colored according to the gradient, is then added to the map.
The following figure shows an example of a gradient computation
Gradient computation
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
Creating and Installing the Gradient interactor
To create this interactor, use the following line of code:
 
IlvMakeGradientInteractor interactor=new IlvMakeGradientInteractor();
You can then install this interactor as described in the Using the GUI beans section in Programming with JViews Maps.
Using the Gradient interactor
When the interactor is used, it creates an IlvTiledRasterDataSource. This data source is based on an IlvComputedRasterReader that computes a single image from the altitude data. The computation of gradient values is made through the implementation of IlvImageComputation by the interactor.
At the same time, the interactor creates an IlvMapLayer to display this new graphic object and adds it to the map layer tree under a Terrain Analysis group. the user can use the style of that layer, an IlvGradientRasterStyle, to customize the appearance of that particular gradient area in the map layer tree. This is done by changing the following parameters:
*The Boundsattribute. Describes the area of interest for which the gradient computations are made.
*The Color Modelattribute. Describes the color of different slope values within the area gradient bounds.
*The Precision attribute. An algorithm samples the map altitude data according to the value of the precision attribute, for example, every 100 meters. It then constructs the gradients from this table of altitudes.

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