Package org.geotools.map
Class MapBoundsEvent
Object
EventObject
MapBoundsEvent
- All Implemented Interfaces:
Serializable
Event object for MapContext area of interest and coordinate system changes.
- Author:
- wolf
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Area of interest changed, mask used byMapBoundsEvent.Type.BOUNDS
static final int
Coordinate system changed, mask used byMapBoundsEvent.Type.CRS
Fields inherited from class EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionMapBoundsEvent
(MapContent source, int type, ReferencedEnvelope oldAreaOfInterest, ReferencedEnvelope newAreaOfInterest) Creates a new instance of BoundsEventMapBoundsEvent
(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
Modifier and TypeMethodDescriptionSet of event types raised for this event.Get the new area of interestGet the new coordinate reference system.Get the old area of interestGet the previous coordinate reference system.int
getType()
Getter for property type.Methods inherited from class EventObject
getSource, toString
-
Field Details
-
AREA_OF_INTEREST_MASK
public static final int AREA_OF_INTEREST_MASKArea of interest changed, mask used byMapBoundsEvent.Type.BOUNDS
- See Also:
-
COORDINATE_SYSTEM_MASK
public static final int COORDINATE_SYSTEM_MASKCoordinate system changed, mask used byMapBoundsEvent.Type.CRS
- See Also:
-
-
Constructor Details
-
MapBoundsEvent
public MapBoundsEvent(MapContent source, int type, ReferencedEnvelope oldAreaOfInterest, ReferencedEnvelope newAreaOfInterest) Creates a new instance of BoundsEvent- Parameters:
source
- the map context reporting the changetype
- the type of change indicated by one or both of the bit masks AREA_OF_INTEREST_MASK and COORDINATE_SYSTEM_MASKoldAreaOfInterest
- the context's previous area of interestnewAreaOfInterest
- 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 changetype
- Type of event indicatingMapBoundsEvent.Type.BOUNDS
orMapBoundsEvent.Type.CRS
oldBounds
- the context's previous area of interestnewBounds
- 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 changetype
- EnumSet flagging one or both of the following AREA_OF_INTEREST_MASK and COORDINATE_SYSTEM_MASKoldBounds
- the context's previous area of interestnewBounds
- the context's new area of interest- Throws:
IllegalArgumentException
- if type is invalid
-
-
Method Details
-
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
Set of event types raised for this event. -
getOldCoordinateReferenceSystem
Get the previous coordinate reference system. This is a convenience method equivalent to getOldAreaOfInterest().getCoordinateReferenceSystem()- Returns:
- the previous CoordinateReferenceSystem object
-
getNewCoordinateReferenceSystem
Get the new coordinate reference system. This is a convenience method equivalent to getNewAreaOfInterest().getCoordinateReferenceSystem()- Returns:
- the new CoordinateReferenceSystem object
-
getOldAreaOfInterest
Get the old area of interest -
getNewAreaOfInterest
Get the new area of interest
-