Packagenet.systemeD.potlatch2
Classpublic class EditController
InheritanceEditController Inheritance flash.events.EventDispatcher
ImplementsMapController

Controller for the main map editing window itself. The logic that responds to mouse and keyboard events is all buried in various ControllerState classes.



Public Properties
 PropertyDefined by
  clipboards : Object
EditController
  cursorsEnabled : Boolean = true
EditController
  map : Map
[read-only] Accesses map object.
EditController
  pen : Class
EditController
  pen_o : Class
EditController
  pen_plus : Class
EditController
  pen_so : Class
EditController
  pen_x : Class
EditController
  state : ControllerState
The current ControllerState
EditController
  tagViewer : TagViewer
EditController
Public Methods
 MethodDefined by
  
EditController(map:Map, tagViewer:TagViewer, toolbox:Toolbox)
Constructor function: needs the map information, a panel to edit tags with, and the toolbox to manipulate ways with.
EditController
  
entityMouseEvent(event:MouseEvent, entity:Entity):void
EditController
  
Given what is currently selected (or not), find the matching ControllerState.
EditController
  
keyDown(key:Number):Boolean
Is the given key currently pressed?
EditController
  
setActive():void
EditController
  
setCursor(cursor:Class):void
Set a mouse pointer.
EditController
  
setState(newState:ControllerState):void
Exit the current state and switch to a new one.
EditController
  
updateSelectionUI(layer:MapPaint = null):void
Updates the various user interfaces that change when the selection changes.
EditController
  
EditController
Property detail
clipboardsproperty
public var clipboards:Object
cursorsEnabledproperty 
public var cursorsEnabled:Boolean = true
mapproperty 
map:Map  [read-only]

Accesses map object.

Implementation
    public function get map():Map
penproperty 
public var pen:Class
pen_oproperty 
public var pen_o:Class
pen_plusproperty 
public var pen_plus:Class
pen_soproperty 
public var pen_so:Class
pen_xproperty 
public var pen_x:Class
stateproperty 
public var state:ControllerState

The current ControllerState

tagViewerproperty 
public var tagViewer:TagViewer
Constructor detail
EditController()constructor
public function EditController(map:Map, tagViewer:TagViewer, toolbox:Toolbox)

Constructor function: needs the map information, a panel to edit tags with, and the toolbox to manipulate ways with.

Parameters
map:Map
 
tagViewer:TagViewer
 
toolbox:Toolbox
Method detail
entityMouseEvent()method
public function entityMouseEvent(event:MouseEvent, entity:Entity):voidParameters
event:MouseEvent
 
entity:Entity
findStateForSelection()method 
public function findStateForSelection(sel:Array):ControllerState

Given what is currently selected (or not), find the matching ControllerState.

Parameters
sel:Array

Returns
ControllerState
keyDown()method 
public function keyDown(key:Number):Boolean

Is the given key currently pressed?

Parameters
key:Number

Returns
Boolean
setActive()method 
public function setActive():void
setCursor()method 
public function setCursor(cursor:Class):void

Set a mouse pointer.

Parameters
cursor:Class
setState()method 
public function setState(newState:ControllerState):void

Exit the current state and switch to a new one.

Parameters
newState:ControllerState — The ControllerState to switch to.
updateSelectionUI()method 
public function updateSelectionUI(layer:MapPaint = null):void

Updates the various user interfaces that change when the selection changes. Currently this is the TagViewer and the Toolbox

Parameters
layer:MapPaint (default = null) — Optionally pass the layer of the currently selected entity, eg for BugLayers
updateSelectionUIWithoutTagChange()method 
public function updateSelectionUIWithoutTagChange():void