Packagenet.systemeD.halcyon
Classpublic class EntityUI
SubclassesMarkerUI, NodeUI, WayUI

Parent class of representations of map Entities, with properties about how they should be drawn.



Public Properties
 PropertyDefined by
  interactive : Boolean = true
Does object respond to clicks?
EntityUI
  paint : MapPaint
Reference to parent MapPaint
EntityUI
  purgable : Boolean = true
Can it be deleted when offscreen?
EntityUI
Protected Properties
 PropertyDefined by
  clearLimit : uint = 0
Sprite to clear back to
EntityUI
  entity : Entity
The entity represented by this class.
EntityUI
  hitzone : Sprite
Hitzone for the sprite - must be set by subclass-specific code.
EntityUI
  layer : Number = 0
Map layer
EntityUI
  listenSprite : Sprite
The clickable sprite that will receive events.
EntityUI
  redrawDue : Boolean = false
Redraw called while suspended?
EntityUI
  sprites : Array
Instances in display list
EntityUI
  stateClasses : Object
Special context-sensitive classes such as :hover.
EntityUI
  styleList : StyleList
Current StyleList for this entity.
EntityUI
  suspended : Boolean = false
Is drawing suspended?
EntityUI
Public Methods
 MethodDefined by
  
EntityUI(entity:Entity, paint:MapPaint)
Constructor function, adds a bunch of event listeners.
EntityUI
  
applyStateClasses(tags:Object):Object
applies the state classes (eg :hover, :area) for this entityUI to the given list of 'real' tags.
EntityUI
  
doRedraw():Boolean
Actually do the redraw.
EntityUI
  
EntityUI
  
EntityUI
  
redraw():Boolean
Request redraw
EntityUI
  
EntityUI
  
Remove all sprites associated with this entity, and clear hitzone.
EntityUI
  
Resume redrawing.
EntityUI
  
setHighlight(settings:Object):void
EntityUI
  
setStateClass(stateType:String, isOn:*):Boolean
Sets a state class (eg :hover, :dupe) for this entityUI.
EntityUI
  
Temporarily suspend redrawing of object.
EntityUI
  
toString():String
EntityUI
  
EntityUI
Protected Methods
 MethodDefined by
  
addToLayer(s:DisplayObject, spritetype:uint, sublayer:int = -1):void
Add object (stroke/fill/roadname) to layer sprite
EntityUI
  
EntityUI
  
mouseEvent(event:MouseEvent):void
EntityUI
  
offsetSprites(x:Number, y:Number):void
EntityUI
  
EntityUI
  
EntityUI
  
EntityUI
  
Remove the default event listeners.
EntityUI
  
EntityUI
  
EntityUI
  
EntityUI
  
tagChanged(event:TagEvent):void
EntityUI
Public Constants
 ConstantDefined by
  DEFAULT_TEXTFIELD_PARAMS : Object
[static]
EntityUI
Protected Constants
 ConstantDefined by
  CASINGSPRITE : uint = 1
EntityUI
  FILLSPRITE : uint = 0
EntityUI
  NAMESPRITE : uint = 3
EntityUI
  NODECLICKSPRITE : uint = 1
EntityUI
  STROKESPRITE : uint = 2
EntityUI
  WAYCLICKSPRITE : uint = 0
EntityUI
Property detail
clearLimitproperty
protected var clearLimit:uint = 0

Sprite to clear back to

entityproperty 
protected var entity:Entity

The entity represented by this class.

hitzoneproperty 
protected var hitzone:Sprite

Hitzone for the sprite - must be set by subclass-specific code.

interactiveproperty 
public var interactive:Boolean = true

Does object respond to clicks?

layerproperty 
protected var layer:Number = 0

Map layer

listenSpriteproperty 
protected var listenSprite:Sprite

The clickable sprite that will receive events.

paintproperty 
public var paint:MapPaint

Reference to parent MapPaint

purgableproperty 
public var purgable:Boolean = true

Can it be deleted when offscreen?

redrawDueproperty 
protected var redrawDue:Boolean = false

Redraw called while suspended?

spritesproperty 
protected var sprites:Array

Instances in display list

stateClassesproperty 
protected var stateClasses:Object

Special context-sensitive classes such as :hover.

styleListproperty 
protected var styleList:StyleList

Current StyleList for this entity.

suspendedproperty 
protected var suspended:Boolean = false

Is drawing suspended?

Constructor detail
EntityUI()constructor
public function EntityUI(entity:Entity, paint:MapPaint)

Constructor function, adds a bunch of event listeners.

Parameters
entity:Entity
 
paint:MapPaint
Method detail
addToLayer()method
protected function addToLayer(s:DisplayObject, spritetype:uint, sublayer:int = -1):void

Add object (stroke/fill/roadname) to layer sprite

Parameters
s:DisplayObject
 
spritetype:uint
 
sublayer:int (default = -1)
applyStateClasses()method 
public function applyStateClasses(tags:Object):Object

applies the state classes (eg :hover, :area) for this entityUI to the given list of 'real' tags. This then gives you a modified list of tags used for styling the entityUI.

Parameters
tags:Object

Returns
Object
attachRelationListeners()method 
protected function attachRelationListeners():void
doRedraw()method 
public function doRedraw():Boolean

Actually do the redraw. To be overwritten.

Returns
Boolean
invalidateStyleList()method 
public function invalidateStyleList():void
mouseEvent()method 
protected function mouseEvent(event:MouseEvent):voidParameters
event:MouseEvent
offsetSprites()method 
protected function offsetSprites(x:Number, y:Number):voidParameters
x:Number
 
y:Number
protectSprites()method 
public function protectSprites():void
redraw()method 
public function redraw():Boolean

Request redraw

Returns
Boolean
relationAdded()method 
protected function relationAdded(event:RelationMemberEvent):voidParameters
event:RelationMemberEvent
relationRemoved()method 
protected function relationRemoved(event:RelationMemberEvent):voidParameters
event:RelationMemberEvent
relationTagChanged()method 
protected function relationTagChanged(event:TagEvent):voidParameters
event:TagEvent
removeGenericEventListeners()method 
protected function removeGenericEventListeners():void

Remove the default event listeners.

removeListenSprite()method 
public function removeListenSprite():void
removeRelationListeners()method 
protected function removeRelationListeners():void
removeSprites()method 
public function removeSprites():void

Remove all sprites associated with this entity, and clear hitzone.

resumeRedraw()method 
public function resumeRedraw(event:EntityEvent):void

Resume redrawing.

Parameters
event:EntityEvent
setHighlight()method 
public function setHighlight(settings:Object):voidParameters
settings:Object
setListenSprite()method 
protected function setListenSprite():void
setStateClass()method 
public function setStateClass(stateType:String, isOn:*):Boolean

Sets a state class (eg :hover, :dupe) for this entityUI. If the state class has changed it will invalidate the style list to force the style to be recalculated during redraw.

Parameters
stateType:String
 
isOn:*

Returns
Boolean
statusChanged()method 
protected function statusChanged(event:EntityEvent):voidParameters
event:EntityEvent
suspendRedraw()method 
public function suspendRedraw(event:EntityEvent):void

Temporarily suspend redrawing of object.

Parameters
event:EntityEvent
tagChanged()method 
protected function tagChanged(event:TagEvent):voidParameters
event:TagEvent
toString()method 
public function toString():String

Returns
String
unprotectSprites()method 
public function unprotectSprites():void
Constant detail
CASINGSPRITEconstant
protected const CASINGSPRITE:uint = 1
DEFAULT_TEXTFIELD_PARAMSconstant 
public static const DEFAULT_TEXTFIELD_PARAMS:Object
FILLSPRITEconstant 
protected const FILLSPRITE:uint = 0
NAMESPRITEconstant 
protected const NAMESPRITE:uint = 3
NODECLICKSPRITEconstant 
protected const NODECLICKSPRITE:uint = 1
STROKESPRITEconstant 
protected const STROKESPRITE:uint = 2
WAYCLICKSPRITEconstant 
protected const WAYCLICKSPRITE:uint = 0