| Package | com.kapit.visualizer.renderer |
| Class | public class GenericLink |
| Inheritance | GenericLink GenericObject mx.core.UIComponent |
| Implements | IGenericItem |
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
| Property | Defined by | ||
|---|---|---|---|
![]() | allowCollapseExpand : Boolean
Indicator if the Visualizer element should have an Expand/Collapse behaviour.
| GenericObject | |
![]() | buttonPlacement : String
Expand Collapse Button Placement.
| GenericObject | |
| CENTER_ANCHORING : uint = 1 [static]
Center anchoring flag (edition mode only).
| GenericLink | ||
![]() | clickFilters : Array | GenericObject | |
![]() | collapseButtonClass : Class
Collapse Icon shown when the node is expanded.
| GenericObject | |
![]() | COLLAPSE_GROUP : uint = 3 [static]
"Group children are collapsed" Flag.
| GenericObject | |
![]() | collapseParent : GenericObject
Parent of the Visualizer element if there is any.
| GenericObject | |
![]() | COLLAPSE_SPRITE : uint = 0 [static]
"Sprite children are collapsed" Flag.
| GenericObject | |
![]() | collpaseOverButtonClass : Class
Collapse Icon shown when the node is expanded and the Expand/Collapse Button is rolled over.
| GenericObject | |
![]() | connectedElements : Dictionary | GenericObject | |
![]() | considerClick : Boolean
Indicator if Click events should be listened
| GenericObject | |
![]() | considerDoubleClick : Boolean
Indicator if Double Click events should be listened
| GenericObject | |
![]() | considerRollOut : Boolean
Indicator if Roll Out events should be listened
| GenericObject | |
![]() | considerRollOver : 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 | ||
![]() | data : Object | GenericObject | |
![]() | decorator : 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 | ||
![]() | expandButtonClass : Class
Expand Icon shown when the node is collapsed.
| GenericObject | |
![]() | expandCollapseElements : Array
Visualizer element collapse/expand children.
| GenericObject | |
![]() | EXPAND_GROUP : uint = 4 [static]
"Group children are expanded" Flag.
| GenericObject | |
![]() | expandOverButtonClass : Class
Expand Icon shown when the node is collapsed and the Expand/Collapse Button is rolled over.
| GenericObject | |
![]() | EXPAND_SPRITE : uint = 1 [static]
"Sprite children are expanded" Flag.
| GenericObject | |
![]() | highlightFilters : Array | GenericObject | |
![]() | idleFilers : Array | GenericObject | |
![]() | IDLE_GROUP : uint = 5 [static]
"Group with no Expand/Collapse functionality" Flag..
| GenericObject | |
![]() | IDLE_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 | ||
![]() | isSelected : Boolean
Indicator if Visualizer element is selected.
| GenericObject | |
![]() | kDataItem : KDataItem | GenericObject | |
![]() | LINK : 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 | ||
![]() | links : 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 | ||
![]() | lock : Boolean | GenericObject | |
| loopSpacing : uint = 3
Calculates the path points according to the following link parameters:
| GenericLink | ||
![]() | manager : 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 | ||
![]() | showExpandCollapseButton : 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 | ||
![]() | type : uint
Visualizer element type indicating behavioural state.
| GenericObject | |
![]() | UID : String
Visualizer element Unique ID.
| GenericObject | |
![]() | view : GenericView
Viewer to which the Visualizer element belongs
| GenericObject | |
| Method | Defined 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 | ||
![]() |
initListeners(considerCLICK:Boolean = true, considerDoubleCLICK:Boolean = true, considerRollOUT:Boolean = true, considerRollOVER:Boolean = true, allowCollapseEXPAND:Boolean = true):void
nitialises and registers Visualizer element listeners.
| GenericObject | |
|
placeDecorator():void
Places a decorator (label, image, text...) at a given place in the link.
| GenericLink | ||
![]() |
setPlacement(rectangle:Rectangle, updateReferences:Boolean = false):void
Sets the Visualizer element spatial parameters and updates its environment (links, decorators...).
| GenericObject | |
![]() |
updateExpandButtonPlacement():void
| GenericObject | |
![]() |
updateLinks():void
| GenericObject | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
commitProperties():void
| GenericObject | |
|
getArrowCoordinates(atTarget:Boolean, atSource:Boolean = false, generateRectangleCoordinates:Boolean = false):Array
| GenericLink | ||
![]() |
handleClickEvent(event:Event):void
Handles click event if considered.
| GenericObject | |
![]() |
handleDoubleClickEvent(event:Event):void
Handles double click event if considered.
| GenericObject | |
![]() |
handleRollOutEvent(event:Event):void
Handles roll out event if considered.
| GenericObject | |
![]() |
handleRollOverEvent(event:Event):void
Handles roll over event if considered.
| GenericObject | |
|
paint():void
Renderers the link visually according to the following link parameters:
| GenericLink | ||
|
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
| GenericLink | ||
| Constant | Defined by | ||
|---|---|---|---|
![]() | BUTTON_AT_BOTTOM_LEFT : String = "bottomLeft" [static]
xpand/Collapse Button placed at the bottom-left.
| GenericObject | |
![]() | BUTTON_AT_BOTTOM_RIGHT : String = "bottomRight" [static]
xpand/Collapse Button placed at the bottom-right.
| GenericObject | |
![]() | BUTTON_AT_MID_BOTTOM : String = "midBottom" [static]
xpand/Collapse Button placed at the bottom and X centered.
| GenericObject | |
![]() | BUTTON_AT_MID_LEFT : String = "midLeft" [static]
xpand/Collapse Button placed at the left and Y centered.
| GenericObject | |
![]() | BUTTON_AT_MID_RIGHT : String = "midRight" [static]
xpand/Collapse Button placed at the right and Y centered.
| GenericObject | |
![]() | BUTTON_AT_MID_TOP : String = "midTOP" [static]
xpand/Collapse Button placed at the top and X centered.
| GenericObject | |
![]() | BUTTON_AT_TOP_LEFT : String = "topLeft" [static]
xpand/Collapse Button placed at the top-left.
| GenericObject | |
![]() | BUTTON_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 | ||
| CENTER_ANCHORING | property |
public static var CENTER_ANCHORING:uint = 1Center anchoring flag (edition mode only).
| controlPoints | property |
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_POLYLINE | property |
public static var CURVED_POLYLINE:uint = 2Curved polyline drawing flag (implies more than 2 control points).
| DEFAULT_ANCHORING | property |
public static var DEFAULT_ANCHORING:uintDefault anchoring method flag (edition mode only): Manual anchoring.
| DEFAULT_LINK_TYPE | property |
public static var DEFAULT_LINK_TYPE:uintDefault link drawing type: Straight line type.
| isClicked | property |
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
| isDirected | property |
isDirected:Boolean [read-only]Indicator if the link is directed.
Implementation public function get isDirected():Boolean
| isHighlighted | property |
isHighlighted:Boolean [read-write]Indicator if the link is highlighted.
Implementation public function get isHighlighted():Boolean
public function set isHighlighted(value:Boolean):void
| isLoop | property |
isLoop:Boolean [read-only]Implementation
public function get isLoop():Boolean
| linkClickStyle | property |
linkClickStyle:Object [read-write]
Link Style Object on Connections Click status. Its structure is similar to the linkStyle property
public function get linkClickStyle():Object
public function set linkClickStyle(value:Object):void
| linkClickStyleFunction | property |
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}
}
public function get linkClickStyleFunction():Function
public function set linkClickStyleFunction(value:Function):void
| linkHighlightStyle | property |
linkHighlightStyle:Object [read-write]
Link Style Object on Highlight status. Its structure is similar to the linkStyle property.
public function get linkHighlightStyle():Object
public function set linkHighlightStyle(value:Object):void
| linkHighlightStyleFunction | property |
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}
}
public function get linkHighlightStyleFunction():Function
public function set linkHighlightStyleFunction(value:Function):void
| linkStyle | property |
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}
public function get linkStyle():Object
public function set linkStyle(value:Object):void
| linkStyleFunction | property |
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}
}
public function get linkStyleFunction():Function
public function set linkStyleFunction(value:Function):void
| linkType | property |
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:
public function get linkType():uint
public function set linkType(value:uint):void
| loopSpacing | property |
public var loopSpacing:uint = 3Calculates the path points according to the following link parameters:
| MANUAL_ANCHORING | property |
public static var MANUAL_ANCHORING:uint = 0Manual anchoring flag (edition mode only).
| MIDDLE_SIDE_ANCHORING | property |
public static var MIDDLE_SIDE_ANCHORING:uint = 2Middle side anchoring flag (edition mode only). Link anchors will be placed on the middle of each sprite side.
| ORTHOGONAL_CURVED_POLYLINE | property |
public static var ORTHOGONAL_CURVED_POLYLINE:uint = 4Othogonal curved line drawing flag (implies more than 2 control points with n0 angle difference between).
| ORTHOGONAL_STRAIGHT_POLYLINE | property |
public static var ORTHOGONAL_STRAIGHT_POLYLINE:uint = 3Othogonal straight line drawing flag (implies more than 2 control points with n0 angle difference between).
| scaleX | property |
scaleX:Number [write-only]Implementation
public function set scaleX(value:Number):void
| scaleY | property |
scaleY:Number [write-only]Implementation
public function set scaleY(value:Number):void
| source | property |
source:GenericObject [read-write]Link source object.
Implementation public function get source():GenericObject
public function set source(value:GenericObject):void
| STRAIGHT_LINE | property |
public static var STRAIGHT_LINE:uint = 0Straight line drawing flag
| STRAIGHT_POLYLINE | property |
public static var STRAIGHT_POLYLINE:uint = 1Straight polyline drawing flag (implies more than 2 control points).
| target | property |
target:GenericObject [read-write]Link target object
Implementation public function get target():GenericObject
public function set target(value:GenericObject):void
| GenericLink | () | constructor |
public function GenericLink(view:GenericView)Constructor.
Parametersview:GenericView — View to which this link belongs.
|
| 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) |
Array |
| getOtherSprite | () | method |
public function getOtherSprite(sprite:GenericObject):GenericObjectReturns the other link extremity given one valid extremity.
Parameterssprite:GenericObject — Link extremity.
|
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):voidnitializes the link parameters, render it graphically and adds it to its container.
Parameterscontainer: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():voidRenderers the link visually according to the following link parameters:
| placeDecorator | () | method |
public function placeDecorator():voidPlaces a decorator (label, image, text...) at a given place in the link.
| updateDisplayList | () | method |
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
unscaledWidth:Number |
|
unscaledHeight:Number |
| DEFAULT_HIGHLIGHT_LINK_STYLE | constant |
public static const DEFAULT_HIGHLIGHT_LINK_STYLE:Object
| DEFAULT_IDLE_LINK_STYLE | constant |
public static const DEFAULT_IDLE_LINK_STYLE:ObjectDefault link style (black color, low thickness and not dashed).
| DEFAULT_LINK_CLICK_STYLE | constant |
public static const DEFAULT_LINK_CLICK_STYLE:Object
| LINK_ARROW_AT_TARGET | constant |
public static const LINK_ARROW_AT_TARGET:String = "single"Indicator if the arrows should be on target only.
| LINK_ARROW_AT_TARGET_AND_SOURCE | constant |
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_TYPE | constant |
public static const LINK_ARROW_CIRCLE_TYPE:String = "circle"Indicator if the arrow shape should be circular .
| LINK_ARROW_NONE | constant |
public static const LINK_ARROW_NONE:String = "none"Indicator if the link shouldn't be directed.
| LINK_ARROW_RECTANGLE_TYPE | constant |
public static const LINK_ARROW_RECTANGLE_TYPE:String = "rectangle"Indicator if the arrow shape should be rectangular.
| LINK_ARROW_STANDARD_TYPE | constant |
public static const LINK_ARROW_STANDARD_TYPE:String = "standard"Indicator if the arrow shape should be the common arrow shape.
| LINK_DASH_RENDERING | constant |
public static const LINK_DASH_RENDERING:String = "dash"Indicator if the link should be dashed.
| LINK_DECORATOR_AT_CENTER_PLACEMENT | constant |
public static const LINK_DECORATOR_AT_CENTER_PLACEMENT:String = "center"Indicator if link decorator should be placed at center node.
| LINK_DECORATOR_AT_SOURCE_PLACEMENT | constant |
public static const LINK_DECORATOR_AT_SOURCE_PLACEMENT:String = "source"Indicator if link decorator should be placed at source node.
| LINK_DECORATOR_AT_TARGET_PLACEMENT | constant |
public static const LINK_DECORATOR_AT_TARGET_PLACEMENT:String = "target"Indicator if link decorator should be placed at target node.
| LINK_SOLID_RENDERING | constant |
public static const LINK_SOLID_RENDERING:String = "solid"Indicator if the link should be solid.