Packagetwaver.network.ui
Classpublic class LinkUI
InheritanceLinkUI Inheritance ElementUI Inheritance mx.core.UIComponent
Subclasses ShapeLinkUI

This link ui used to draw link on network canvas. Every link displays on network as a line, polyline or a complex path. Many parameters of link can change the link appearance. You can create subclasses to change the default look for link.

See also

twaver.Link
NodeUI


Public Properties
 PropertyDefined By
 InheritedalarmAttachment : AlarmAttachment
[read-only] Get alarm attachment of this element ui.
ElementUI
  angle : Number
[read-only] Get the link angle.
LinkUI
 Inheritedattachments : ICollection
[read-only] Get all attachments as a collection.
ElementUI
 InheritedbodyRect : Rectangle
[read-only] Get the element body rectangle.
ElementUI
  controlPoint : Point
Get control point of this link ui.
LinkUI
 InheritededitAttachment : EditAttachment
[read-only] Get edit attachment.
ElementUI
 Inheritedelement : IElement
[read-only] Get the element of this element ui.
ElementUI
  fromPoint : Point
[read-only] Get the link from point.
LinkUI
 InheritedhotSpot : Point
Get hotspot point of this element ui.
ElementUI
 InheritediconsAttachment : IconsAttachment
[read-only] Get icon attachment.
ElementUI
 InheritedlabelAttachment : LabelAttachment
[read-only] Get label attachment of this element ui.
ElementUI
  lineLength : Number
[read-only] Get line segment count of this link.
LinkUI
  link : Link
[read-only] Get the connected link element.
LinkUI
  linkPoints : ICollection
[read-only] Get all control points of the link element.
LinkUI
 Inheritednetwork : Network
[read-only] Get network component this element ui displayed on.
ElementUI
  toPoint : Point
[read-only] Get the link from point.
LinkUI
 InheritedunionBounds : Rectangle
[read-only] Get the rectangle covers all graphical elements, including element body and all attachments.
ElementUI
 Inheritedvisible : Boolean
[override] [write-only]
ElementUI
Protected Properties
 PropertyDefined By
 InheritedbodyComponent : UIComponent
ElementUI
 InheritedinnerColor : Object
[read-only] Get element inner color.
ElementUI
 InheritedouterColor : Object
[read-only] Get element outline color.
ElementUI
Public Methods
 MethodDefined By
  
LinkUI(network:Network, link:Link)
Create link ui for specified link element.
LinkUI
  
Recalculate link control points and return points as a collection.
LinkUI
  
[override] Check all attachments installed on this element ui.
LinkUI
 Inherited
dispose():void
Dispose all resources used by this element ui.
ElementUI
  
getBundleGap(looped:Boolean = false):Number
Get the gap between bundled links.
LinkUI
  
getBundleOffset(fromPoint:Point, toPoint:Point):Number
Get the link bundle flexion point offset.
LinkUI
 Inherited
handlePropertyChange(e:PropertyChangeEvent):void
Called when any element property changed.
ElementUI
 Inherited
Called when selection changed.
ElementUI
 Inherited
hitsTest(point:Point, tolerance:int):Object
ElementUI
 Inherited
invalidate(checkAttachments:Boolean):void
Invalidate element ui.
ElementUI
 Inherited
Update all properties from network and element, redraw this element ui.
ElementUI
Protected Methods
 MethodDefined By
 Inherited
addAttachment(attachment:Attachment):void
Add attachment into this element ui.
ElementUI
 Inherited
Check, update and display alarm attachment.
ElementUI
 Inherited
Check, update and display edit attachment.
ElementUI
 Inherited
Check, update and display icon attachment.
ElementUI
 Inherited
Check, update and display label attachment.
ElementUI
  
Create link handler attachment for this link element.
LinkUI
 Inherited
[override]
ElementUI
 Inherited
Create element body effect filters of this element ui.
ElementUI
  
createBodyRect():Rectangle
[override] Create body bound rectangle.
LinkUI
 Inherited
Create element effect filters of this element ui.
ElementUI
  
drawBody(g:Graphics):void
[override] Draw element body.
LinkUI
 Inherited
getDyeColor(styleProp:String):Number
Get dye color of the specified style property.
ElementUI
  
isEditable():Boolean
[override] Check whether this element is editable now.
LinkUI
 Inherited
measure():void
[override]
ElementUI
 Inherited
removeAttachment(attachment:Attachment):void
Remove specified attachment from this element ui.
ElementUI
 Inherited
Update element measure.
ElementUI
Property Detail
angleproperty
angle:Number  [read-only]

Get the link angle.


Implementation
    public function get angle():Number
controlPointproperty 
controlPoint:Point

Get control point of this link ui.


Implementation
    public function get controlPoint():Point
    public function set controlPoint(value:Point):void
fromPointproperty 
fromPoint:Point  [read-only]

Get the link from point.


Implementation
    public function get fromPoint():Point
lineLengthproperty 
lineLength:Number  [read-only]

Get line segment count of this link.


Implementation
    public function get lineLength():Number
linkproperty 
link:Link  [read-only]

Get the connected link element.


Implementation
    public function get link():Link
linkPointsproperty 
linkPoints:ICollection  [read-only]

Get all control points of the link element.


Implementation
    public function get linkPoints():ICollection
toPointproperty 
toPoint:Point  [read-only]

Get the link from point.


Implementation
    public function get toPoint():Point
Constructor Detail
LinkUI()Constructor
public function LinkUI(network:Network, link:Link)

Create link ui for specified link element.

Parameters
network:Network — network component this link ui displayed on
 
link:Link — the link element of this link ui.
Method Detail
calculateLinkPoints()method
public function calculateLinkPoints():ICollection

Recalculate link control points and return points as a collection.

Returns
ICollection — the recalculated and recreated link control points.
checkAttachments()method 
override public function checkAttachments():void

Check all attachments installed on this element ui.

checkLinkHandlerAttachment()method 
protected function checkLinkHandlerAttachment():void

Create link handler attachment for this link element. Link handler is a small icon that indicate links are bundled together. You can double click the handler icon to expand or close the links.

createBodyRect()method 
override protected function createBodyRect():Rectangle

Create body bound rectangle.

Returns
Rectangle — body bound rectangle.
drawBody()method 
override protected function drawBody(g:Graphics):void

Draw element body.

Parameters

g:Graphics — the graphic draw body on.

getBundleGap()method 
public function getBundleGap(looped:Boolean = false):Number

Get the gap between bundled links.

Parameters

looped:Boolean (default = false) — whether link is looped link. Default value is false.

Returns
Number — the gap between bundled links.
getBundleOffset()method 
public function getBundleOffset(fromPoint:Point, toPoint:Point):Number

Get the link bundle flexion point offset.

Parameters

fromPoint:Point — from point of the link.
 
toPoint:Point — to point of the link

Returns
Number — the link bundle flexion point offset.
isEditable()method 
override protected function isEditable():Boolean

Check whether this element is editable now.

Returns
Boolean — whether this element is editable now.