org.geotools.map.event
Class MapBoundsEvent

Object
  extended by EventObject
      extended by MapBoundsEvent
All Implemented Interfaces:
Serializable

public class MapBoundsEvent
extends EventObject

Event object for MapContext area of interest and coordinate system changes.

Author:
wolf
See Also:
Serialized Form

Nested Class Summary
static class MapBoundsEvent.Type
          Type of map bounds event
 
Field Summary
static int AREA_OF_INTEREST_MASK
          Area of interest changed, mask used by MapBoundsEvent.Type.BOUNDS
static int COORDINATE_SYSTEM_MASK
          Coordinate system changed, mask used by MapBoundsEvent.Type.CRS
 
Fields inherited from class EventObject
source
 
Constructor Summary
MapBoundsEvent(MapContext source, int type, ReferencedEnvelope oldAreaOfInterest, ReferencedEnvelope newAreaOfInterest)
          Creates a new instance of BoundsEvent
MapBoundsEvent(MapViewport source, EnumSet<MapBoundsEvent.Type> type, ReferencedEnvelope oldBounds, ReferencedEnvelope newBounds)
          Creates a new instance of BoundsEvent.
MapBoundsEvent(MapViewport source, MapBoundsEvent.Type type, ReferencedEnvelope oldBounds, ReferencedEnvelope newBounds)
          Creates a new instance of BoundsEvent.
 
Method Summary
 EnumSet<MapBoundsEvent.Type> getEventType()
          Set of event types raised for this event.
 ReferencedEnvelope getNewAreaOfInterest()
          Get the new area of interest
 CoordinateReferenceSystem getNewCoordinateReferenceSystem()
          Get the new coordinate reference system.
 ReferencedEnvelope getOldAreaOfInterest()
          Get the old area of interest
 CoordinateReferenceSystem getOldCoordinateReferenceSystem()
          Get the previous coordinate reference system.
 int getType()
          Getter for property type.
 
Methods inherited from class EventObject
getSource, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AREA_OF_INTEREST_MASK

public static final int AREA_OF_INTEREST_MASK
Area of interest changed, mask used by MapBoundsEvent.Type.BOUNDS

See Also:
Constant Field Values

COORDINATE_SYSTEM_MASK

public static final int COORDINATE_SYSTEM_MASK
Coordinate system changed, mask used by MapBoundsEvent.Type.CRS

See Also:
Constant Field Values
Constructor Detail

MapBoundsEvent

public MapBoundsEvent(MapContext source,
                      int type,
                      ReferencedEnvelope oldAreaOfInterest,
                      ReferencedEnvelope newAreaOfInterest)
Creates a new instance of BoundsEvent

Parameters:
source - the map context reporting the change
type - the type of change indicated by one or both of the bit masks AREA_OF_INTEREST_MASK and COORDINATE_SYSTEM_MASK
oldAreaOfInterest - the context's previous area of interest
newAreaOfInterest - the context's new area of interest
Throws:
IllegalArgumentException - if type is invalid

MapBoundsEvent

public MapBoundsEvent(MapViewport source,
                      MapBoundsEvent.Type type,
                      ReferencedEnvelope oldBounds,
                      ReferencedEnvelope newBounds)
Creates a new instance of BoundsEvent.

Example:

 new MapBoundsEvent(map, EnumSet.of(Type.BOUNDS), null, bounds)
 

Parameters:
source - map viewport reporting the change
type - Type of event indicating MapBoundsEvent.Type.BOUNDS or MapBoundsEvent.Type.CRS
oldAreaOfInterest - the context's previous area of interest
newAreaOfInterest - the context's new area of interest
Throws:
IllegalArgumentException - if type is invalid

MapBoundsEvent

public MapBoundsEvent(MapViewport source,
                      EnumSet<MapBoundsEvent.Type> type,
                      ReferencedEnvelope oldBounds,
                      ReferencedEnvelope newBounds)
Creates a new instance of BoundsEvent.

Example:

 new MapBoundsEvent(map, EnumSet.of(Type.BOUNDS), null, bounds)
 

Parameters:
source - map viewport reporting the change
type - EnumSet flagging one or both of the following AREA_OF_INTEREST_MASK and COORDINATE_SYSTEM_MASK
oldAreaOfInterest - the context's previous area of interest
newAreaOfInterest - the context's new area of interest
Throws:
IllegalArgumentException - if type is invalid
Method Detail

getType

public int getType()
Getter for property type. The type is a bitwise or of the masks defined above.

Returns:
Value of property type.

getEventType

public EnumSet<MapBoundsEvent.Type> getEventType()
Set of event types raised for this event.

Returns:

getOldCoordinateReferenceSystem

public CoordinateReferenceSystem getOldCoordinateReferenceSystem()
Get the previous coordinate reference system. This is a convenience method equivalent to getOldAreaOfInterest().getCoordinateReferenceSystem()

Returns:
the previous CoordinateReferenceSystem object

getNewCoordinateReferenceSystem

public CoordinateReferenceSystem getNewCoordinateReferenceSystem()
Get the new coordinate reference system. This is a convenience method equivalent to getNewAreaOfInterest().getCoordinateReferenceSystem()

Returns:
the new CoordinateReferenceSystem object

getOldAreaOfInterest

public ReferencedEnvelope getOldAreaOfInterest()
Get the old area of interest


getNewAreaOfInterest

public ReferencedEnvelope getNewAreaOfInterest()
Get the new area of interest



Copyright © 1996-2014 Geotools. All Rights Reserved.