ilog.views.maps
Class IlvAreasOfInterestProperty

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

public class IlvAreasOfInterestProperty
extends IlvNamedProperty

IlvAreasOfInterestProperty defines a named property used to store the areas of interest in an IlvManager instance that contain cartographic data.

The following code example shows how to use IlvAreasOfInterestProperty:

   // Create a area for all that is visible in the view.
  IlvAreaOfInterest world=IlvJAreaOfInterestPanel.createLocationFromView(view,64,false);
  world.setName("World");
  // Create an area for the bounds of Europe.
  IlvRect rectangle=
     new IlvRect((float)Math.toRadians(-15),(float)Math.toRadians(35),
                 (float)Math.toRadians(45),(float)Math.toRadians(25));
  IlvAreaOfInterest europe=new IlvAreaOfInterest("Europe",rectangle,0,null);
  // Update the preview image.
  IlvJAreaOfInterestPanel.refreshPreview(view,europe,64);
  // Retrieve or create the areas of interest known to the manager.
  IlvAreaOfInterestVector areas=IlvAreasOfInterestProperty.GetAreasOfInterest(view.getManager());
  // Add the areas to be managed by Beans and/or serialized.
  areas.addElement(world);
  areas.addElement(europe);
  // Zoom to Europe.
  europe.zoomTo(view);
 

Since:
JViews 7.5
See Also:
Serialized Form

Field Summary
static String NAME
          The name of the property.
 
Constructor Summary
IlvAreasOfInterestProperty(IlvAreaOfInterestVector ap)
          Creates a new IlvAreasOfInterestProperty object with the specified areas of interest.
IlvAreasOfInterestProperty(IlvAreasOfInterestProperty source)
          Creates a new IlvAreasOfInterestProperty object by copying an existing one.
IlvAreasOfInterestProperty(IlvInputStream stream)
          Creates a new IlvAreasOfInterestProperty object from an IlvInputStream.
 
Method Summary
 IlvNamedProperty copy()
          Copies the property.
 IlvAreaOfInterestVector getAreasOfInterest()
          Returns the areas of interest for this property.
static IlvAreaOfInterestVector GetAreasOfInterest(IlvManager manager)
          Returns the areas of interest of a given manager.
 boolean isPersistent()
          Tests if this property can be saved.
 void write(IlvOutputStream stream)
          Writes this 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

IlvAreasOfInterestProperty

public IlvAreasOfInterestProperty(IlvAreaOfInterestVector ap)
Creates a new IlvAreasOfInterestProperty object with the specified areas of interest.

Parameters:
ap - The areas of interest.

IlvAreasOfInterestProperty

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

Parameters:
source - The source property to be copied.

IlvAreasOfInterestProperty

public IlvAreasOfInterestProperty(IlvInputStream stream)
                           throws IlvReadFileException
Creates a new IlvAreasOfInterestProperty object 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 this 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 IlvAreasOfInterestProperty instance.

isPersistent

public boolean isPersistent()
Tests if this property can be saved.

Specified by:
isPersistent in class IlvNamedProperty
Returns:
This implementation always returns true.

getAreasOfInterest

public IlvAreaOfInterestVector getAreasOfInterest()
Returns the areas of interest for this property.

Returns:
The areas of interest for this property.

GetAreasOfInterest

public static IlvAreaOfInterestVector GetAreasOfInterest(IlvManager manager)
Returns the areas of interest of a given manager.

This method tries to find the areas of interest of the manager in the following way:

  1. If an IlvAreasOfInterestProperty instance is attached to the manager, the areas of interest in the property are returned.
  2. If no areas of interest property is attached, a new IlvAreaOfInterestVector is created, stored in the properties of manager and returned.

Parameters:
manager - The manager whose areas of interest you want to retrieve.
Returns:
The areas of interest for manager.


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