Represents a particular state of the controller, such as "dragging a way" or "nothing selected". Key methods are
processKeyboardEvent and processMouseEvent which take some action, and return a new state for the controller.
This abstract class has some behaviour that applies in most states, and lots of 'null' behaviour.
protected var controller:EditController
firstSelected:Entity
[read-only]
Implementation
public function get firstSelected():Entity
public var layer:MapPaint
map:Map
[read-only]
Retrieves the map associated with the current EditController
Implementation
public function get map():Map
protected var previousState:ControllerState
selectCount:uint
[read-only]Implementation
public function get selectCount():uint
selectedNodes:Array
[read-only]Implementation
public function get selectedNodes():Array
selectedWay:Way
[read-only]
Implementation
public function get selectedWay():Way
selectedWays:Array
[read-only]Implementation
public function get selectedWays():Array
protected var _selection:Array
selection:Array
[read-write]Implementation
public function get selection():Array
public function set selection(value:Array):void
public function ControllerState()
public function addToSelection(items:Array):void
Parameters
public function enterState():void
This is called when the EditController sets this ControllerState as the active state.
Override this with whatever is needed, such as adding highlights to entities
public function exitState(newState:ControllerState):void
This is called by the EditController as the current controllerstate is exiting.
Override this with whatever cleanup is needed, such as removing highlights from entities
Parameters
protected function getMapPaint(d:DisplayObject):MapPaint
Find the MapPaint object that this DisplayObject belongs to.
Parameters
Returns
protected function getNodeIndex(way:Way, node:Node):uint
Parameters
Returns
public static function getTopLevelFocusEntity(entity:Entity):Entity
Gets the way that the selected node is part of, if that makes sense. If not, return the node, or the way, or nothing.
Parameters
Returns
public function hasAdjoiningWays():Boolean
Returns
public function hasSelectedAreas():Boolean
Returns
public function hasSelectedUnclosedWays():Boolean
Returns
public function hasSelectedWayNodesInAreas():Boolean
Determine whether or not any nodes are selected, and if so whether any of them belong to areas.
Returns
public function hasSelectedWays():Boolean
Returns
public function isSelectionState():Boolean
Returns
public function processKeyboardEvent(event:KeyboardEvent):ControllerState
When triggered by a keypress, perform an action on the given entity, then move to a new state.
Parameters
Returns
public function processMouseEvent(event:MouseEvent, entity:Entity):ControllerState
When triggered by a mouse action such as a click, perform an action on the given entity, then move to a new state.
Parameters
| event:MouseEvent |
|
| entity:Entity |
Returns
public function removeFromSelection(items:Array):void
Parameters
protected function repeatTags(object:Entity):void
Create a "repeat tags" action on the current entity, if possible.
Parameters
protected function revertHandler(event:CloseEvent):void
Parameters
protected function revertSelection():void
Revert all selected items to previously saved state, via a dialog box.
public function setController(controller:EditController):void
Parameters
public function setPreviousState(previousState:ControllerState):void
Parameters
protected function setSourceTag():void
Create an action to add "source= tag to current entity based on background imagery. This is a convenient shorthand for users.
protected function sharedKeyboardEvents(event:KeyboardEvent):ControllerState
Default behaviour for the current state that should be called if state-specific action has been taken care of or ruled out.
Parameters
Returns
protected function sharedMouseEvents(event:MouseEvent, entity:Entity):ControllerState
Default behaviour for the current state that should be called if state-specific action has been taken care of or ruled out.
Parameters
| event:MouseEvent |
|
| entity:Entity |
Returns
public function toggleSelection(item:Entity):Boolean
Parameters
Returns
public function toString():String
Represent the state in text for debugging.
Returns
Found an error? Help us fix it. http://wiki.openstreetmap.org/wiki/Potlatch2