Package arcmap :: Module mapcontroller :: Class MapListener
[hide private]
[frames] | no frames]

Class MapListener

source code

Known Subclasses:

Base class for anything that wants to be notified about state changes in the map

Instance Methods [hide private]
 
__init__(self, controller) source code
MapController
getController(self)
Returns: the controller that this is a listener for
source code
 
listenSetVisibilty(self, index, visible) source code
 
listenResize(self, width, height, xoffset, yoffset)
Brief Description
source code
 
listenAddLayer(self, layerName) source code
 
listenAddTile(self, source, x, y, z) source code
 
listenRemoveTile(self, x, y, z) source code
 
listenRemoveLayer(self, index)
Notify the listener that a layer has been removed
source code
 
listenSwapLayers(self, index1, index2)
Notify listener that two layers have changed places
source code
 
listenSelectLayer(self, index)
Update the listener to a change in layer selection
source code
 
listenModified(self, modified)
Notify the listener if the map has unsaved changes or not
source code
 
listenFileClosed(self)
Called when the map being edited is closed.
source code
 
listenFileOpened(self)
Called when a map is opened or created.
source code
 
listenSetSelection(self, index, brush, x1, y1, x2, y2) source code
 
listenAddTileSet(self, fileName) source code
 
listenUndoRedo(self)
Update due to an undo action or a redo action
source code
 
listenAddShape(self, shape)
Notify the listener that a shape was added
source code
 
listenRemoveShape(self, shape)
Notify the listener that a shape was removed
source code
Method Details [hide private]

__init__(self, controller)
(Constructor)

source code 
Parameters:
  • controller (MapController) - The controller that this will listen to

getController(self)

source code 
Returns: MapController
the controller that this is a listener for

listenSetVisibilty(self, index, visible)

source code 
Parameters:
  • index (int) - the index of the layer to set visible/invisible
  • visible (bool) - True if the layer should be visible, False otherwise

listenResize(self, width, height, xoffset, yoffset)

source code 

Brief Description

Parameters:
  • width (int) - The new width in tiles
  • height (int) - The new height in tiles
  • xoffset (int) - The number of tiles that the existing map contents should be shifted right
  • yoffset (int) - The number of tiles that the existing map contents should be shifted down

listenAddLayer(self, layerName)

source code 
Parameters:
  • layerName (string) - name of the new layer

listenAddTile(self, source, x, y, z)

source code 
Parameters:
  • source (cairo.ImageSurface) - source surface for drawing
  • x (int) - x-coordinate in tiles
  • y (int) - y-coordinate in tiles
  • z (int) - layer index of the tile to delete

listenRemoveTile(self, x, y, z)

source code 
Parameters:
  • x (int) - x-coordinate of tile to delete
  • y (int) - y-coordinate of tile to delete
  • z (int) - layer index of the tile to delete

listenRemoveLayer(self, index)

source code 

Notify the listener that a layer has been removed

Parameters:
  • index (int) - the index of the removed layer

listenSwapLayers(self, index1, index2)

source code 

Notify listener that two layers have changed places

Parameters:
  • index1 (int) - index of first layer
  • index2 (int) - index of second layer

listenSelectLayer(self, index)

source code 

Update the listener to a change in layer selection

Parameters:
  • index (int) - index of the layer that was selected

listenModified(self, modified)

source code 

Notify the listener if the map has unsaved changes or not

Parameters:
  • modified (bool) - Whether or not the map is changed

listenFileClosed(self)

source code 

Called when the map being edited is closed. Used to make buttons insensitive, free resources, etc.

listenFileOpened(self)

source code 

Called when a map is opened or created. Used to make buttons sensitive, or whatever else.

listenSetSelection(self, index, brush, x1, y1, x2, y2)

source code 
Parameters:
  • index (int) - index of the image
  • brush (cairo.ImageSurface) - pixel data to use
  • x1 (int) - left coordinate of selection in tiles
  • y1 (int) - top coordinate of selection in tiles
  • x2 (int) - right coordinate of selection in tiles
  • y2 (int) - bottom coordinate of selection in tiles

listenAddTileSet(self, fileName)

source code 
Parameters:
  • fileName (string) - name of the file that was

listenAddShape(self, shape)

source code 

Notify the listener that a shape was added

Parameters:
  • shape (shapes.Shape) - the shape added

listenRemoveShape(self, shape)

source code 

Notify the listener that a shape was removed

Parameters:
  • shape (shapes.Shape) - the shape added