net.refractions.udig.project
Interface IMap

All Superinterfaces:
IProjectElement

public interface IMap
extends IProjectElement

The part of the model that represents a map.

A Map consists of a ContextModel, a ViewportModel and a LayerManager

Responsibilities:

Since:
0.5
Author:
Jesse

Method Summary
 void addMapCompositionListener(IMapCompositionListener listener)
          Adds a IMapCompositionListener to this map.
 void addMapListener(IMapListener listener)
          Adds a MapListener to this map.
 void executeASyncWithoutUndo(MapCommand command)
          Executes a MapCommand asynchronously.
 void executeSyncWithoutUndo(MapCommand command)
          Executes a MapCommand synchronously.
 java.lang.String getAbstract()
          Returns the map's abstract
 double getAspectRatio(IProgressMonitor monitor)
          Returns the Aspect ratio of the map.
 IBlackboard getBlackboard()
          Returns a blackboard for the map.
 ReferencedEnvelope getBounds(IProgressMonitor monitor)
          Gets the Envelope that indicates the maximum bounding box of the map.
 IEditManager getEditManager()
          Returns the EditManager for the current map.
 URI getID()
          Returns a unique identifier for a map.
 LayerFactory getLayerFactory()
          Returns the layer factory used to create layers for this map.
 java.util.List<ILayer> getMapLayers()
          Returns the list of Layers in the map.
 IRenderManager getRenderManager()
          Returns the RenderManager for the current map.
 IViewportModel getViewportModel()
          Returns the Viewport model for this map.
 void removeMapCompositionListener(IMapCompositionListener listener)
          Removes a MapListener from this map.
 void removeMapListener(IMapListener listener)
          Removes a MapListener from this map.
 void sendCommandASync(MapCommand command)
          Executes a MapCommand asynchronously with the calling thread.
 void sendCommandSync(MapCommand command)
          Executes a MapCommand synchronously.
 
Methods inherited from interface net.refractions.udig.project.IProjectElement
getName, getProject
 

Method Detail

getLayerFactory

LayerFactory getLayerFactory()
Returns the layer factory used to create layers for this map.

Returns:
the layer factory used to create layers for this map.

getViewportModel

IViewportModel getViewportModel()
Returns the Viewport model for this map.

Returns:
the Viewport model for this map.

getAbstract

java.lang.String getAbstract()
Returns the map's abstract

Returns:
the map's abstract

getBounds

ReferencedEnvelope getBounds(IProgressMonitor monitor)
                             throws java.io.IOException
Gets the Envelope that indicates the maximum bounding box of the map.

The bounds returned are in Lat Long and each time the method is called a new object is returned. Therefore the object can be modified as desired without affecting the model.

Note: this is a constant for a given map. It is related to the size of the map data, and is not dependent on the viewport.

WARNING This may block.

Returns:
The Envelope in Lat Long that indicates the maximum bounding box of the map.
Throws:
java.io.IOException

getAspectRatio

double getAspectRatio(IProgressMonitor monitor)
Returns the Aspect ratio of the map. It is normally no the same as the aspect ratio of the viewport.

Returns:
The aspect ratio of the map.

getEditManager

IEditManager getEditManager()
Returns the EditManager for the current map.

Returns:
the EditManager for the current map.

getRenderManager

IRenderManager getRenderManager()
Returns the RenderManager for the current map.

Returns:
the RenderManager for the current map.

getMapLayers

java.util.List<ILayer> getMapLayers()
Returns the list of Layers in the map. The layers are in zorder. The layer at position 0 is that first layer rendered (The bottom layer in the image); This list is immutable.

Returns:
An immutable list containing all the Map's layers.

getBlackboard

IBlackboard getBlackboard()
Returns a blackboard for the map. The blackboard is used by various plugins in order to store data and collaborate.

Returns:
A blackboard used for collaboration among various plugins.

getID

URI getID()
Returns a unique identifier for a map. Shouldn't change between runs.

Returns:
a unique identifier for a map.

sendCommandSync

void sendCommandSync(MapCommand command)
Executes a MapCommand synchronously. This method blocks. All commands are ran in a single thread, this is required so that undo/redo makes sense.

Parameters:
command - the EditCommandto execute.

sendCommandASync

void sendCommandASync(MapCommand command)
Executes a MapCommand asynchronously with the calling thread. All commands are ran in a single thread, this is required so that undo/redo makes sense.

Parameters:
command - the EditCommandto execute.

executeSyncWithoutUndo

void executeSyncWithoutUndo(MapCommand command)
Executes a MapCommand synchronously. This method blocks.

Parameters:
command - the EditCommandto execute.

executeASyncWithoutUndo

void executeASyncWithoutUndo(MapCommand command)
Executes a MapCommand asynchronously.

Parameters:
command - the EditCommandto execute.

addMapListener

void addMapListener(IMapListener listener)
Adds a MapListener to this map. A given listener will only be added once. Events are only fired if the attributes of the Map class are change. For example name, ViewportModel, Bounds, etc...

Parameters:
listener - Listener to be added
See Also:
MapEvent.MapEventType

removeMapListener

void removeMapListener(IMapListener listener)
Removes a MapListener from this map.

Parameters:
listener - Listener to be removed

addMapCompositionListener

void addMapCompositionListener(IMapCompositionListener listener)
Adds a IMapCompositionListener to this map. A given listener will only be added once. Events are fired when the layers of the Map change: added, removed or reordered.

Parameters:
listener - Listener to be added
See Also:
MapEvent.MapEventType

removeMapCompositionListener

void removeMapCompositionListener(IMapCompositionListener listener)
Removes a MapListener from this map.

Parameters:
listener - Listener to be removed