ilog.views.maps
Class IlvAltitudeProviderProperty

java.lang.Object
  extended by ilog.views.IlvNamedProperty
      extended by ilog.views.maps.IlvAltitudeProviderProperty
All Implemented Interfaces:
IlvPersistentObject, Serializable

public class IlvAltitudeProviderProperty
extends IlvNamedProperty

This class defines a named property used to store the altitude provider in an IlvManager containing cartographic data.

Since:
JViews 7.5
See Also:
Using {@link #GetAltitudeProvider(IlvManager)} will return the altitude provider class attached to the manager. If no specific provider has been set by the application, the above method will return a {@link ilog.views.maps.IlvDefaultAltitudeProvider} created and set the first time it is called for that manager. For example, the code below displays the altitude at the point latLonRad if the provider is able to compute it:
 // Retrieve the provider for the manager
 IlvAltitudeProvider elevationProvider = IlvAltitudeProviderProperty.GetAltitudeProvider(manager);
 // retrieve the altitude for one point
 double altitude = p.getAltitude(view.getManager(), latlonRad.x, latLonRad.y, 0);
 if(!Double.IsNaN(altitude)) {
   // use display preferences to format output altitude
   IlvDisplayPreferences pref = IlvDisplayPreferencesProperty.GetDisplayPreferences(view.getManager());
   System.out.println("Altitude is " + pref.formatAltitude(alt));
 } else {
   System.out.println("No altitude known");
 }
 
, Serialized Form

Field Summary
static String NAME
          The name of the property.
 
Constructor Summary
IlvAltitudeProviderProperty(IlvAltitudeProvider ap)
          Creates a new IlvAltitudeProviderProperty object with the specified altitude provider.
IlvAltitudeProviderProperty(IlvAltitudeProviderProperty source)
          Creates a new IlvAltitudeProviderProperty by copying an existing one.
IlvAltitudeProviderProperty(IlvInputStream stream)
          Creates a new IlvAltitudeProviderProperty from an IlvInputStream.
 
Method Summary
 IlvNamedProperty copy()
          Copies the property.
 IlvAltitudeProvider getAltitudeProvider()
          Returns the altitude provider of this property.
static IlvAltitudeProvider GetAltitudeProvider(IlvManager manager)
          Returns the altitude provider of a manager.
 boolean isPersistent()
          Returns true if the property can be saved.
 void write(IlvOutputStream stream)
          Writes the property to an IlvOutputStream.
 
Methods inherited from class ilog.views.IlvNamedProperty
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
The name of the property.

See Also:
Constant Field Values
Constructor Detail

IlvAltitudeProviderProperty

public IlvAltitudeProviderProperty(IlvAltitudeProvider ap)
Creates a new IlvAltitudeProviderProperty object with the specified altitude provider.

Parameters:
ap - The altitude provider.

IlvAltitudeProviderProperty

public IlvAltitudeProviderProperty(IlvAltitudeProviderProperty source)
Creates a new IlvAltitudeProviderProperty by copying an existing one.

Parameters:
source - The source property to be copied.

IlvAltitudeProviderProperty

public IlvAltitudeProviderProperty(IlvInputStream stream)
                            throws IlvReadFileException
Creates a new IlvAltitudeProviderProperty from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if an error occurs while reading.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the property to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvNamedProperty
Parameters:
stream - The output stream.
Throws:
IOException - if an I/O exception occurs.

copy

public IlvNamedProperty copy()
Copies the property.

Specified by:
copy in class IlvNamedProperty
Returns:
A new IlvAltitudeProviderProperty.

isPersistent

public boolean isPersistent()
Returns true if the property can be saved.

Specified by:
isPersistent in class IlvNamedProperty
Returns:
true.

getAltitudeProvider

public IlvAltitudeProvider getAltitudeProvider()
Returns the altitude provider of this property.

Returns:
The altitude provider of this property.

GetAltitudeProvider

public static IlvAltitudeProvider GetAltitudeProvider(IlvManager manager)
Returns the altitude provider of a manager. This method tries to determine the altitude provider of the manager using the following order: If an IlvAltitudeProviderProperty is attached to the manager, the altitude provider of the property is returned. Otherwise, a new IlvDefaultAltitudeProvider is returned.

Parameters:
manager - The manager.
Returns:
The altitude provider of this manager or a new one just created.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.