Packagecom.kapit.visualizer.renderer
Classpublic class GenericLink
InheritanceGenericLink Inheritance GenericObject Inheritance mx.core.UIComponent
ImplementsIGenericItem

GenericLink is a visual type that represents a link between two IGenericItem. Given a source, a target, a valid link Path controlPoints and a rendering type linkType (Straight, Curved,Straight orthogonal...), the GenericLink will be automatically rendered. Links can refer to direct links (solid lines) or to logical links (dashed). The last designation occurs when collapsing elements that are linked to exterior elements. This IGeneircItem can be fully customized using any Style Object containing the following references and having the following example structure:
  var linkStyle:Object =
    {
    thickness:1,
    color:0x000000,
    alpha:0.6,
    pixelHinting:false,
    scaleMode:"normal",
    caps:"none",
    joints:null,
    miterLimit:3,
    renderingPolicy:"solid",
    dashed:false,
    onLength:5,
    offLength:5,
    useClipping:false,
    arrowPolicy:"none",
    arrowWidth:7,
    arrowHeight:5,
    arrowRadius:5,
    arrowSourceType:"circle",
    arrowTargetType:"standard"
    }
  

See also

linkStyle
linkType
controlPoints


Public Properties
 PropertyDefined by
 InheritedallowCollapseExpand : Boolean
Indicator if the Visualizer element should have an Expand/Collapse behaviour.
GenericObject
 InheritedbuttonPlacement : String
Expand Collapse Button Placement.
GenericObject
  CENTER_ANCHORING : uint = 1
[static] Center anchoring flag (edition mode only).
GenericLink
 InheritedclickFilters : Array
GenericObject
 InheritedcollapseButtonClass : Class
Collapse Icon shown when the node is expanded.
GenericObject
 InheritedCOLLAPSE_GROUP : uint = 3
[static] "Group children are collapsed" Flag.
GenericObject
 InheritedcollapseParent : GenericObject
Parent of the Visualizer element if there is any.
GenericObject
 InheritedCOLLAPSE_SPRITE : uint = 0
[static] "Sprite children are collapsed" Flag.
GenericObject
 InheritedcollpaseOverButtonClass : Class
Collapse Icon shown when the node is expanded and the Expand/Collapse Button is rolled over.
GenericObject
 InheritedconnectedElements : Dictionary
GenericObject
 InheritedconsiderClick : Boolean
Indicator if Click events should be listened
GenericObject
 InheritedconsiderDoubleClick : Boolean
Indicator if Double Click events should be listened
GenericObject
 InheritedconsiderRollOut : Boolean
Indicator if Roll Out events should be listened
GenericObject
 InheritedconsiderRollOver : Boolean
Indicator if Roll Over events should be listened
GenericObject
  controlPoints : Array
Link control points (link path) used to renderer the link.
GenericLink
  CURVED_POLYLINE : uint = 2
[static] Curved polyline drawing flag (implies more than 2 control points).
GenericLink
 Inheriteddata : Object
GenericObject
 Inheriteddecorator : Sprite
Visualizer element decorator (Image, TextField, animation....)
GenericObject
  DEFAULT_ANCHORING : uint
[static] Default anchoring method flag (edition mode only): Manual anchoring.
GenericLink
  DEFAULT_LINK_TYPE : uint
[static] Default link drawing type: Straight line type.
GenericLink
 InheritedexpandButtonClass : Class
Expand Icon shown when the node is collapsed.
GenericObject
 InheritedexpandCollapseElements : Array
Visualizer element collapse/expand children.
GenericObject
 InheritedEXPAND_GROUP : uint = 4
[static] "Group children are expanded" Flag.
GenericObject
 InheritedexpandOverButtonClass : Class
Expand Icon shown when the node is collapsed and the Expand/Collapse Button is rolled over.
GenericObject
 InheritedEXPAND_SPRITE : uint = 1
[static] "Sprite children are expanded" Flag.
GenericObject
 InheritedhighlightFilters : Array
GenericObject
 InheritedidleFilers : Array
GenericObject
 InheritedIDLE_GROUP : uint = 5
[static] "Group with no Expand/Collapse functionality" Flag..
GenericObject
 InheritedIDLE_SPRITE : uint = 2
[static] "Sprite with no Expand/Collapse functionality" Flag.
GenericObject
  isClicked : Boolean
Indicator if the link was clicked or highlighted after clicking one of its extremities.
GenericLink
  isDirected : Boolean
[read-only] Indicator if the link is directed.
GenericLink
  isHighlighted : Boolean
Indicator if the link is highlighted.
GenericLink
  isLoop : Boolean
[read-only]
GenericLink
 InheritedisSelected : Boolean
Indicator if Visualizer element is selected.
GenericObject
 InheritedkDataItem : KDataItem
GenericObject
 InheritedLINK : uint = 6
[static] Link Flag.
GenericObject
  linkClickStyle : Object
Link Style Object on Connections Click status.
GenericLink
  linkClickStyleFunction : Function
Link style at click function.
GenericLink
  linkHighlightStyle : Object
Link Style Object on Highlight status.
GenericLink
  linkHighlightStyleFunction : Function
Link style at roll over function.
GenericLink
 Inheritedlinks : Array
Links to which a GenericSprite or a GenericGroup is connected.
GenericObject
  linkStyle : Object
Link style object.
GenericLink
  linkStyleFunction : Function
Link style function.
GenericLink
  linkType : uint
Link drawing type.
GenericLink
 Inheritedlock : Boolean
GenericObject
  loopSpacing : uint = 3
Calculates the path points according to the following link parameters:
  • source Object
  • target Object
  • link drawing type
GenericLink
 Inheritedmanager : IManager
Visualizer element manager.
GenericObject
  MANUAL_ANCHORING : uint = 0
[static] Manual anchoring flag (edition mode only).
GenericLink
  MIDDLE_SIDE_ANCHORING : uint = 2
[static] Middle side anchoring flag (edition mode only).
GenericLink
  ORTHOGONAL_CURVED_POLYLINE : uint = 4
[static] Othogonal curved line drawing flag (implies more than 2 control points with n0 angle difference between).
GenericLink
  ORTHOGONAL_STRAIGHT_POLYLINE : uint = 3
[static] Othogonal straight line drawing flag (implies more than 2 control points with n0 angle difference between).
GenericLink
  scaleX : Number
[write-only]
GenericLink
  scaleY : Number
[write-only]
GenericLink
 InheritedshowExpandCollapseButton : Boolean
GenericObject
  source : GenericObject
Link source object.
GenericLink
  STRAIGHT_LINE : uint = 0
[static] Straight line drawing flag
GenericLink
  STRAIGHT_POLYLINE : uint = 1
[static] Straight polyline drawing flag (implies more than 2 control points).
GenericLink
  target : GenericObject
Link target object
GenericLink
 Inheritedtype : uint
Visualizer element type indicating behavioural state.
GenericObject
 InheritedUID : String
Visualizer element Unique ID.
GenericObject
 Inheritedview : GenericView
Viewer to which the Visualizer element belongs
GenericObject
Protected Properties
 PropertyDefined by
 Inherited_decoratorLayer : UIComponent
GenericObject
 Inherited_expandButton : Button
GenericObject
Public Methods
 MethodDefined by
  
GenericLink(view:GenericView)
Constructor.
GenericLink
  
calculatePath():Array
GenericLink
  
draw():void
GenericLink
  
Returns the other link extremity given one valid extremity.
GenericLink
  
initLink(container:DisplayObjectContainer, linkManager:IManager, sourceObject:GenericObject, targetObject:GenericObject, content:Object, uid:String = null, isDirected:Boolean = false, linkStyle:Object = null, anchoringMethod:uint = 0):void
nitializes the link parameters, render it graphically and adds it to its container.
GenericLink
 Inherited
initListeners(considerCLICK:Boolean = true, considerDoubleCLICK:Boolean = true, considerRollOUT:Boolean = true, considerRollOVER:Boolean = true, allowCollapseEXPAND:Boolean = true):void
nitialises and registers Visualizer element listeners.
GenericObject
  
Places a decorator (label, image, text...) at a given place in the link.
GenericLink
 Inherited
setPlacement(rectangle:Rectangle, updateReferences:Boolean = false):void
Sets the Visualizer element spatial parameters and updates its environment (links, decorators...).
GenericObject
 Inherited
GenericObject
 Inherited
updateLinks():void
GenericObject
Protected Methods
 MethodDefined by
 Inherited
GenericObject
  
getArrowCoordinates(atTarget:Boolean, atSource:Boolean = false, generateRectangleCoordinates:Boolean = false):Array
GenericLink
 Inherited
handleClickEvent(event:Event):void
Handles click event if considered.
GenericObject
 Inherited
handleDoubleClickEvent(event:Event):void
Handles double click event if considered.
GenericObject
 Inherited
handleRollOutEvent(event:Event):void
Handles roll out event if considered.
GenericObject
 Inherited
handleRollOverEvent(event:Event):void
Handles roll over event if considered.
GenericObject
  
paint():void
Renderers the link visually according to the following link parameters:
  • Path or Control points
  • Link Style
  • Link drawing type
GenericLink
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
GenericLink
Public Constants
 ConstantDefined by
 InheritedBUTTON_AT_BOTTOM_LEFT : String = "bottomLeft"
[static] xpand/Collapse Button placed at the bottom-left.
GenericObject
 InheritedBUTTON_AT_BOTTOM_RIGHT : String = "bottomRight"
[static] xpand/Collapse Button placed at the bottom-right.
GenericObject
 InheritedBUTTON_AT_MID_BOTTOM : String = "midBottom"
[static] xpand/Collapse Button placed at the bottom and X centered.
GenericObject
 InheritedBUTTON_AT_MID_LEFT : String = "midLeft"
[static] xpand/Collapse Button placed at the left and Y centered.
GenericObject
 InheritedBUTTON_AT_MID_RIGHT : String = "midRight"
[static] xpand/Collapse Button placed at the right and Y centered.
GenericObject
 InheritedBUTTON_AT_MID_TOP : String = "midTOP"
[static] xpand/Collapse Button placed at the top and X centered.
GenericObject
 InheritedBUTTON_AT_TOP_LEFT : String = "topLeft"
[static] xpand/Collapse Button placed at the top-left.
GenericObject
 InheritedBUTTON_AT_TOP_Right : String = "topRight"
[static] xpand/Collapse Button placed at the top-right.
GenericObject
  DEFAULT_HIGHLIGHT_LINK_STYLE : Object
[static]
GenericLink
  DEFAULT_IDLE_LINK_STYLE : Object
[static] Default link style (black color, low thickness and not dashed).
GenericLink
  DEFAULT_LINK_CLICK_STYLE : Object
[static]
GenericLink
  LINK_ARROW_AT_TARGET : String = "single"
[static] Indicator if the arrows should be on target only.
GenericLink
  LINK_ARROW_AT_TARGET_AND_SOURCE : String = "double"
[static] Indicator if the arrows should be on both target and source.
GenericLink
  LINK_ARROW_CIRCLE_TYPE : String = "circle"
[static] Indicator if the arrow shape should be circular .
GenericLink
  LINK_ARROW_NONE : String = "none"
[static] Indicator if the link shouldn't be directed.
GenericLink
  LINK_ARROW_RECTANGLE_TYPE : String = "rectangle"
[static] Indicator if the arrow shape should be rectangular.
GenericLink
  LINK_ARROW_STANDARD_TYPE : String = "standard"
[static] Indicator if the arrow shape should be the common arrow shape.
GenericLink
  LINK_DASH_RENDERING : String = "dash"
[static] Indicator if the link should be dashed.
GenericLink
  LINK_DECORATOR_AT_CENTER_PLACEMENT : String = "center"
[static] Indicator if link decorator should be placed at center node.
GenericLink
  LINK_DECORATOR_AT_SOURCE_PLACEMENT : String = "source"
[static] Indicator if link decorator should be placed at source node.
GenericLink
  LINK_DECORATOR_AT_TARGET_PLACEMENT : String = "target"
[static] Indicator if link decorator should be placed at target node.
GenericLink
  LINK_SOLID_RENDERING : String = "solid"
[static] Indicator if the link should be solid.
GenericLink
Property detail
CENTER_ANCHORINGproperty
public static var CENTER_ANCHORING:uint = 1

Center anchoring flag (edition mode only).

controlPointsproperty 
controlPoints:Array  [read-write]

Link control points (link path) used to renderer the link. Basically, these control points must be modified according to the link drawing type. In fact, straight line drawing requires only two control points (source and target anchor points), differently to the other link drawing types that require at least three path points.

Implementation
    public function get controlPoints():Array
    public function set controlPoints(value:Array):void
CURVED_POLYLINEproperty 
public static var CURVED_POLYLINE:uint = 2

Curved polyline drawing flag (implies more than 2 control points).

DEFAULT_ANCHORINGproperty 
public static var DEFAULT_ANCHORING:uint

Default anchoring method flag (edition mode only): Manual anchoring.

DEFAULT_LINK_TYPEproperty 
public static var DEFAULT_LINK_TYPE:uint

Default link drawing type: Straight line type.

isClickedproperty 
isClicked:Boolean  [read-write]

Indicator if the link was clicked or highlighted after clicking one of its extremities.

Implementation
    public function get isClicked():Boolean
    public function set isClicked(value:Boolean):void
isDirectedproperty 
isDirected:Boolean  [read-only]

Indicator if the link is directed.

Implementation
    public function get isDirected():Boolean
isHighlightedproperty 
isHighlighted:Boolean  [read-write]

Indicator if the link is highlighted.

Implementation
    public function get isHighlighted():Boolean
    public function set isHighlighted(value:Boolean):void
isLoopproperty 
isLoop:Boolean  [read-only]Implementation
    public function get isLoop():Boolean
linkClickStyleproperty 
linkClickStyle:Object  [read-write]

Link Style Object on Connections Click status. Its structure is similar to the linkStyle property

Implementation
    public function get linkClickStyle():Object
    public function set linkClickStyle(value:Object):void
linkClickStyleFunctionproperty 
linkClickStyleFunction:Function  [read-write]

Link style at click function. This function uses the source node data and the target node data, as well as a reference to this GenericLink instance, in order to return a Link Style Object. private function linkStyleRollOverFunction(link:GenericLink,sourceData:Object, targetData:Object):Object { if(sourceData.name.chartAt(0)='a') return {thickness:1, color:0x000000, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} else return {thickness:4, color:0x00EDA0, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} }

Implementation
    public function get linkClickStyleFunction():Function
    public function set linkClickStyleFunction(value:Function):void
linkHighlightStyleproperty 
linkHighlightStyle:Object  [read-write]

Link Style Object on Highlight status. Its structure is similar to the linkStyle property.

Implementation
    public function get linkHighlightStyle():Object
    public function set linkHighlightStyle(value:Object):void
linkHighlightStyleFunctionproperty 
linkHighlightStyleFunction:Function  [read-write]

Link style at roll over function. This function uses the source node data and the target node data, as well as a reference to this GenericLink instance, in order to return a Link Style Object. private function linkStyleRollOverFunction(link:GenericLink,sourceData:Object, targetData:Object):Object { if(sourceData.name.chartAt(0)='a') return {thickness:1, color:0x000000, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} else return {thickness:4, color:0x00EDA0, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} }

Implementation
    public function get linkHighlightStyleFunction():Function
    public function set linkHighlightStyleFunction(value:Function):void
linkStyleproperty 
linkStyle:Object  [read-write]

Link style object. It contains all the link style parameters that will be used to render the link. The default link style is black colored, with thickness equal to one and not dashed. To modify the link style, the style object must have the following structure: var newStyle:Object = {thickness:1, color:0x000000, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5}

Implementation
    public function get linkStyle():Object
    public function set linkStyle(value:Object):void
linkStyleFunctionproperty 
linkStyleFunction:Function  [read-write]

Link style function. This function uses the source node data and the target node data, as well as a reference to this GenericLink instance, in order to return a Link Style Object. private function linkStyleFunction(link:GenericLink,sourceData:Object, targetData:Object):Object { if(sourceData.name.chartAt(0)='a') return {thickness:1, color:0x000000, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} else return {thickness:4, color:0x00EDA0, alpha:0.6, pixelHinting:false, scaleMode:"normal", caps:"none", joints:null, miterLimit:3, dashed:false, onLength:5, offLength:5} }

Implementation
    public function get linkStyleFunction():Function
    public function set linkStyleFunction(value:Function):void
linkTypeproperty 
linkType:uint  [read-write]

Link drawing type. To draw a link, several drawing types are handled. Modifying this attribute with the appropriate flag, generates the following link drawings:

Implementation
    public function get linkType():uint
    public function set linkType(value:uint):void
loopSpacingproperty 
public var loopSpacing:uint = 3

Calculates the path points according to the following link parameters:

MANUAL_ANCHORINGproperty 
public static var MANUAL_ANCHORING:uint = 0

Manual anchoring flag (edition mode only).

MIDDLE_SIDE_ANCHORINGproperty 
public static var MIDDLE_SIDE_ANCHORING:uint = 2

Middle side anchoring flag (edition mode only). Link anchors will be placed on the middle of each sprite side.

ORTHOGONAL_CURVED_POLYLINEproperty 
public static var ORTHOGONAL_CURVED_POLYLINE:uint = 4

Othogonal curved line drawing flag (implies more than 2 control points with n0 angle difference between).

ORTHOGONAL_STRAIGHT_POLYLINEproperty 
public static var ORTHOGONAL_STRAIGHT_POLYLINE:uint = 3

Othogonal straight line drawing flag (implies more than 2 control points with n0 angle difference between).

scaleXproperty 
scaleX:Number  [write-only]Implementation
    public function set scaleX(value:Number):void
scaleYproperty 
scaleY:Number  [write-only]Implementation
    public function set scaleY(value:Number):void
sourceproperty 
source:GenericObject  [read-write]

Link source object.

Implementation
    public function get source():GenericObject
    public function set source(value:GenericObject):void
STRAIGHT_LINEproperty 
public static var STRAIGHT_LINE:uint = 0

Straight line drawing flag

STRAIGHT_POLYLINEproperty 
public static var STRAIGHT_POLYLINE:uint = 1

Straight polyline drawing flag (implies more than 2 control points).

targetproperty 
target:GenericObject  [read-write]

Link target object

Implementation
    public function get target():GenericObject
    public function set target(value:GenericObject):void
Constructor detail
GenericLink()constructor
public function GenericLink(view:GenericView)

Constructor.

Parameters
view:GenericView — View to which this link belongs.
Method detail
calculatePath()method
public function calculatePath():Array

Returns
Array
draw()method 
public function draw():void
getArrowCoordinates()method 
protected function getArrowCoordinates(atTarget:Boolean, atSource:Boolean = false, generateRectangleCoordinates:Boolean = false):ArrayParameters
atTarget:Boolean
 
atSource:Boolean (default = false)
 
generateRectangleCoordinates:Boolean (default = false)

Returns
Array
getOtherSprite()method 
public function getOtherSprite(sprite:GenericObject):GenericObject

Returns the other link extremity given one valid extremity.

Parameters
sprite:GenericObject — Link extremity.

Returns
GenericObject — Link extremity.
initLink()method 
public function initLink(container:DisplayObjectContainer, linkManager:IManager, sourceObject:GenericObject, targetObject:GenericObject, content:Object, uid:String = null, isDirected:Boolean = false, linkStyle:Object = null, anchoringMethod:uint = 0):void

nitializes the link parameters, render it graphically and adds it to its container.

Parameters
container:DisplayObjectContainer — Container to which this link belongs.
 
linkManager:IManager — Link manager that controls dispatched events and link behaviour (controller).
 
sourceObject:GenericObject — link source object.
 
targetObject:GenericObject — link target object.
 
content:Object — Unique Identifier of the link. If null, a link UID will be assigned by RendererFactory.
 
uid:String (default = null) — Indicates if the link isDirected or not (not yet handled).
 
isDirected:Boolean (default = false) — link Style Parameters.
 
linkStyle:Object (default = null) — Anchoring method (not yet handled).
 
anchoringMethod:uint (default = 0)
paint()method 
protected function paint():void

Renderers the link visually according to the following link parameters:

placeDecorator()method 
public function placeDecorator():void

Places a decorator (label, image, text...) at a given place in the link.

updateDisplayList()method 
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Parameters
unscaledWidth:Number
 
unscaledHeight:Number
Constant detail
DEFAULT_HIGHLIGHT_LINK_STYLEconstant
public static const DEFAULT_HIGHLIGHT_LINK_STYLE:Object
DEFAULT_IDLE_LINK_STYLEconstant 
public static const DEFAULT_IDLE_LINK_STYLE:Object

Default link style (black color, low thickness and not dashed).

DEFAULT_LINK_CLICK_STYLEconstant 
public static const DEFAULT_LINK_CLICK_STYLE:Object
LINK_ARROW_AT_TARGETconstant 
public static const LINK_ARROW_AT_TARGET:String = "single"

Indicator if the arrows should be on target only.

LINK_ARROW_AT_TARGET_AND_SOURCEconstant 
public static const LINK_ARROW_AT_TARGET_AND_SOURCE:String = "double"

Indicator if the arrows should be on both target and source.

LINK_ARROW_CIRCLE_TYPEconstant 
public static const LINK_ARROW_CIRCLE_TYPE:String = "circle"

Indicator if the arrow shape should be circular .

LINK_ARROW_NONEconstant 
public static const LINK_ARROW_NONE:String = "none"

Indicator if the link shouldn't be directed.

LINK_ARROW_RECTANGLE_TYPEconstant 
public static const LINK_ARROW_RECTANGLE_TYPE:String = "rectangle"

Indicator if the arrow shape should be rectangular.

LINK_ARROW_STANDARD_TYPEconstant 
public static const LINK_ARROW_STANDARD_TYPE:String = "standard"

Indicator if the arrow shape should be the common arrow shape.

LINK_DASH_RENDERINGconstant 
public static const LINK_DASH_RENDERING:String = "dash"

Indicator if the link should be dashed.

LINK_DECORATOR_AT_CENTER_PLACEMENTconstant 
public static const LINK_DECORATOR_AT_CENTER_PLACEMENT:String = "center"

Indicator if link decorator should be placed at center node.

LINK_DECORATOR_AT_SOURCE_PLACEMENTconstant 
public static const LINK_DECORATOR_AT_SOURCE_PLACEMENT:String = "source"

Indicator if link decorator should be placed at source node.

LINK_DECORATOR_AT_TARGET_PLACEMENTconstant 
public static const LINK_DECORATOR_AT_TARGET_PLACEMENT:String = "target"

Indicator if link decorator should be placed at target node.

LINK_SOLID_RENDERINGconstant 
public static const LINK_SOLID_RENDERING:String = "solid"

Indicator if the link should be solid.