Packagecom.asterisq.constellation.renderers
Classpublic class BasicNodeRenderer
InheritanceBasicNodeRenderer Inheritance NodeRenderer Inheritance mx.core.UIComponent
ImplementsIDraggableNodeRenderer, ISelectableNodeRenderer, ITweenableNodeRenderer
SubclassesDefaultNodeRenderer

A basic node renderer. Has no display but implements a hit area, dragging, selecting and tweening.

The hit area is added automatically in createChildren(). Subclasses need to ensure that DisplayObjects at higher depths don't block mouse events from reaching the hit area. To do this, use the following code:

setChildIndex(hitArea_sp, numChildren-1);

To change the way the node renderer responds to user interaction, override the event handler methods.



Public Properties
 PropertyDefined by
 Inheritedacceleration : Point
The acceleration of this node renderer.
NodeRenderer
  animationDuration : Number
[read-only] The total length of the animation, in milliseconds.
BasicNodeRenderer
  animationInitialPosition : Point
The position of the node renderer when the animation begins.
BasicNodeRenderer
  animationStartTime : Number
The timestamp marking the beginning of the animation, in milliseconds.
BasicNodeRenderer
  animationTargetPosition : Point
The position of the node renderer when the animation is finished.
BasicNodeRenderer
 Inheritedconstellation : IConstellation
The constellation instance displaying this node renderer.
NodeRenderer
  dragCenter : Point
Indicates the position of the "grip point" of the mouse during dragging.
BasicNodeRenderer
 InheritededgeRenderers : Array
A list of edge renderers connecting this node renderer.
NodeRenderer
  isDragging : Boolean
Indicates whether this node renderer is currently being dragged.
BasicNodeRenderer
 InheritedneighborNodeRenderers : Array
A list of neighbor renderers.
NodeRenderer
 Inheritednode : LinkedNode
The node being rendered.
NodeRenderer
 InheritednumEdgeRenderers : uint
The number of edge renderers connecting this node renderer.
NodeRenderer
 Inheritedposition : Point
The position of this node renderer.
NodeRenderer
  selected : Boolean
Indicates whether this node renderer is selected.
BasicNodeRenderer
 Inheritedvelocity : Point
The velocity of this node renderer.
NodeRenderer
Protected Properties
 PropertyDefined by
  hitArea_sp : Sprite
The mouse hit area.
BasicNodeRenderer
Public Methods
 MethodDefined by
  
Creates a new node renderer.
BasicNodeRenderer
 Inherited
Validates this node renderer's position.
NodeRenderer
Protected Methods
 MethodDefined by
  
clickHandler(evt:MouseEvent):void
Called when a click event is received from the hit area.
BasicNodeRenderer
 Inherited
Called when the node's data changes.
NodeRenderer
  
doubleClickHandler(evt:MouseEvent):void
Called when a double click event is received from the hit area.
BasicNodeRenderer
  
mouseDownHandler(evt:MouseEvent):void
Called when a mouse down event is received from the hit area.
BasicNodeRenderer
  
mouseOutHandler(evt:MouseEvent):void
Called when a mouse out event is received from the hit area.
BasicNodeRenderer
  
mouseOverHandler(evt:MouseEvent):void
Called when a mouse over event is received from the hit area.
BasicNodeRenderer
  
mouseUpHandler(evt:MouseEvent):void
Called when a mouse up event is received from the hit area.
BasicNodeRenderer
  
stageMouseUpHandler(evt:MouseEvent):void
Called when a mouse up event is received from the stage object.
BasicNodeRenderer
Property detail
animationDurationproperty
animationDuration:Number  [read-only]

The total length of the animation, in milliseconds.

Implementation
    public function get animationDuration():Number
animationInitialPositionproperty 
animationInitialPosition:Point  [read-write]

The position of the node renderer when the animation begins.

Implementation
    public function get animationInitialPosition():Point
    public function set animationInitialPosition(value:Point):void
animationStartTimeproperty 
animationStartTime:Number  [read-write]

The timestamp marking the beginning of the animation, in milliseconds.

Implementation
    public function get animationStartTime():Number
    public function set animationStartTime(value:Number):void
animationTargetPositionproperty 
animationTargetPosition:Point  [read-write]

The position of the node renderer when the animation is finished.

Implementation
    public function get animationTargetPosition():Point
    public function set animationTargetPosition(value:Point):void
dragCenterproperty 
dragCenter:Point  [read-write]

Indicates the position of the "grip point" of the mouse during dragging. This value is relative to this node renderer instance.

Implementation
    public function get dragCenter():Point
    public function set dragCenter(value:Point):void
hitArea_spproperty 
protected var hitArea_sp:Sprite

The mouse hit area. Override the updateDisplayList() and use the hit area's graphics property to set the shape of the hit area.

isDraggingproperty 
isDragging:Boolean  [read-write]

Indicates whether this node renderer is currently being dragged.

Implementation
    public function get isDragging():Boolean
    public function set isDragging(value:Boolean):void
selectedproperty 
selected:Boolean  [read-write]

Indicates whether this node renderer is selected.

Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
Constructor detail
BasicNodeRenderer()constructor
public function BasicNodeRenderer()

Creates a new node renderer.

Method detail
clickHandler()method
protected function clickHandler(evt:MouseEvent):void

Called when a click event is received from the hit area. The event is redispatched if the mouse was held down for less than 300 milliseconds and the node position changed less than 5px.

Parameters
evt:MouseEvent
doubleClickHandler()method 
protected function doubleClickHandler(evt:MouseEvent):void

Called when a double click event is received from the hit area. The event is redispatched.

Parameters
evt:MouseEvent
mouseDownHandler()method 
protected function mouseDownHandler(evt:MouseEvent):void

Called when a mouse down event is received from the hit area. Dragging starts and the event is redispatched.

Parameters
evt:MouseEvent
mouseOutHandler()method 
protected function mouseOutHandler(evt:MouseEvent):void

Called when a mouse out event is received from the hit area. The event is redispatched if the node is not being dragged.

Parameters
evt:MouseEvent
mouseOverHandler()method 
protected function mouseOverHandler(evt:MouseEvent):void

Called when a mouse over event is received from the hit area. The event is redispatched if the node is not being dragged.

Parameters
evt:MouseEvent
mouseUpHandler()method 
protected function mouseUpHandler(evt:MouseEvent):void

Called when a mouse up event is received from the hit area. The event is redispatched.

Parameters
evt:MouseEvent
stageMouseUpHandler()method 
protected function stageMouseUpHandler(evt:MouseEvent):void

Called when a mouse up event is received from the stage object. Dragging stops.

Parameters
evt:MouseEvent