Packagetwaver.network.ui
Classpublic class BasicAttachment
InheritanceBasicAttachment Inheritance Attachment Inheritance mx.core.UIComponent
Subclasses AlarmAttachment, LabelAttachment, LinkHandlerAttachment

This is a simple implementation of network element attachment. This implementation support graphical attachment or display a DisplayObject in the attachment. Most of other TWaver Flex attachments are extended from this class, such as LinkHandlerAttachment, AlarmAttachment, and LabelAttachment.

Extends subclasses from this class to create customized attachments



Public Properties
 PropertyDefined By
 InheritedattachmentSprite : Sprite
Attachment
 InheritedattachmentSpriteTransform : Transform
Attachment
  bounds : Rectangle
[override] [read-only] Get attachment bounds.
BasicAttachment
  content : DisplayObject
Get the display object content of this attachment.
BasicAttachment
  contentHeight : Number
[read-only] Get attachment content height.
BasicAttachment
  contentWidth : Number
[read-only] Get attachment content width.
BasicAttachment
  contentXScale : Number
[read-only] Get attachment x scale.
BasicAttachment
  contentYScale : Number
[read-only] Get attachment y scale.
BasicAttachment
  cornerRadius : Number
[read-only] Get corner radius of the round rectangle shape.
BasicAttachment
  direction : String
[read-only] Get attachment growing direction.
BasicAttachment
 Inheritedelement : IElement
[read-only] Get element ui related element object.
Attachment
 InheritedelementUI : ElementUI
[read-only] Get connected element ui.
Attachment
  fill : Boolean
[read-only] Whether this attachment need to fill.
BasicAttachment
  fillAlpha : Number
[read-only] Get attachment fill color transparency.
BasicAttachment
  fillColor : Number
[read-only] Get attachment fill color.
BasicAttachment
  gradient : String
[read-only] Get attachment fill gradient pattern.
BasicAttachment
  gradientAlpha : Number
[read-only] Get attachment fill gradient color transparency.
BasicAttachment
  gradientColor : Number
[read-only] Get attachment fill gradient color.
BasicAttachment
 Inheritednetwork : Network
[read-only] Get network component this attachment display on.
Attachment
  outlineAlpha : Number
[read-only] Get attachment outline color transparency.
BasicAttachment
  outlineColor : Number
[read-only] Get attachment outline color.
BasicAttachment
  outlineWidth : Number
[read-only] Get attachment outline stroke width.
BasicAttachment
  padding : Number
[read-only] Get padding blank space of this attachment.
BasicAttachment
  paddingBottom : Number
[read-only] Get bottom padding blank space of this attachment.
BasicAttachment
  paddingLeft : Number
[read-only] Get left padding blank space of this attachment.
BasicAttachment
  paddingRight : Number
[read-only] Get right padding blank space of this attachment.
BasicAttachment
  paddingTop : Number
[read-only] Get top padding blank space of this attachment.
BasicAttachment
  pointerLength : Number
[read-only] Get pointer length of this attachment shape, typically this is for alarm bubble attachment.
BasicAttachment
  pointerWidth : Number
[read-only] Get pointer length of this attachment shape, typically this is for alarm bubble attachment.
BasicAttachment
  position : String
[read-only] Get attachment based position of element body.
BasicAttachment
  roundRect : Rectangle
[read-only] Get the round rectangle of this attachment.
BasicAttachment
 InheritedshowInAttachmentCanvas : Boolean
[read-only] Get value whether show this attachment a the separate attachment canvas in network.
Attachment
  xOffset : Number
[read-only] Get the extra x position offset of this attachment base on the attachment position.
BasicAttachment
  yOffset : Number
[read-only] Get the extra y position offset of this attachment base on the attachment position.
BasicAttachment
Public Methods
 MethodDefined By
  
BasicAttachment(elementUI:ElementUI, showInAttachmentCanvas:Boolean = false)
Constructor of this attachment.
BasicAttachment
 Inherited
dispose():void
Call this to dispose all resources used by this attachment.
Attachment
  
draw(graphics:Graphics):void
[override] Draw attachment content.
BasicAttachment
  
setMatrix(matrix:Matrix):void
[override] Set attachment transform matrix.
BasicAttachment
 Inherited
Update attachment transparency.
Attachment
  
[override] Update element attachment properties.
BasicAttachment
Protected Methods
 MethodDefined By
 Inherited
Create filters.
Attachment
 Inherited
measure():void
[override]
Attachment
Property Detail
boundsproperty
bounds:Rectangle  [read-only] [override]

Get attachment bounds.


Implementation
    public function get bounds():Rectangle
contentproperty 
content:DisplayObject

Get the display object content of this attachment.


Implementation
    public function get content():DisplayObject
    public function set content(value:DisplayObject):void
contentHeightproperty 
contentHeight:Number  [read-only]

Get attachment content height. If content is null, return 20.


Implementation
    public function get contentHeight():Number
contentWidthproperty 
contentWidth:Number  [read-only]

Get attachment content width. If content is null, return 30.


Implementation
    public function get contentWidth():Number
contentXScaleproperty 
contentXScale:Number  [read-only]

Get attachment x scale. Default value is 1.


Implementation
    public function get contentXScale():Number
contentYScaleproperty 
contentYScale:Number  [read-only]

Get attachment y scale. Default value is 1.


Implementation
    public function get contentYScale():Number
cornerRadiusproperty 
cornerRadius:Number  [read-only]

Get corner radius of the round rectangle shape. Default value is 8.


Implementation
    public function get cornerRadius():Number
directionproperty 
direction:String  [read-only]

Get attachment growing direction. This value can be:

Default value is Consts.ATTACHMENT_DIRECTION_RIGHT.


Implementation
    public function get direction():String
fillproperty 
fill:Boolean  [read-only]

Whether this attachment need to fill. Default value is false.


Implementation
    public function get fill():Boolean
fillAlphaproperty 
fillAlpha:Number  [read-only]

Get attachment fill color transparency. Default value is 1, no transparency.


Implementation
    public function get fillAlpha():Number
fillColorproperty 
fillColor:Number  [read-only]

Get attachment fill color. Default color is black.


Implementation
    public function get fillColor():Number
gradientproperty 
gradient:String  [read-only]

Get attachment fill gradient pattern. Default value is null, no gradient.

This value can be:


Implementation
    public function get gradient():String
gradientAlphaproperty 
gradientAlpha:Number  [read-only]

Get attachment fill gradient color transparency. Default value is 1, no transparency.


Implementation
    public function get gradientAlpha():Number
gradientColorproperty 
gradientColor:Number  [read-only]

Get attachment fill gradient color. Default is white color.


Implementation
    public function get gradientColor():Number
outlineAlphaproperty 
outlineAlpha:Number  [read-only]

Get attachment outline color transparency. Default value is 1, no transparency.


Implementation
    public function get outlineAlpha():Number
outlineColorproperty 
outlineColor:Number  [read-only]

Get attachment outline color. Default color is black.


Implementation
    public function get outlineColor():Number
outlineWidthproperty 
outlineWidth:Number  [read-only]

Get attachment outline stroke width. Default value is -1, no outline.


Implementation
    public function get outlineWidth():Number
paddingproperty 
padding:Number  [read-only]

Get padding blank space of this attachment. Default value is 0.


Implementation
    public function get padding():Number
paddingBottomproperty 
paddingBottom:Number  [read-only]

Get bottom padding blank space of this attachment. Default value is 0.


Implementation
    public function get paddingBottom():Number
paddingLeftproperty 
paddingLeft:Number  [read-only]

Get left padding blank space of this attachment. Default value is 0.


Implementation
    public function get paddingLeft():Number
paddingRightproperty 
paddingRight:Number  [read-only]

Get right padding blank space of this attachment. Default value is 0.


Implementation
    public function get paddingRight():Number
paddingTopproperty 
paddingTop:Number  [read-only]

Get top padding blank space of this attachment. Default value is 0.


Implementation
    public function get paddingTop():Number
pointerLengthproperty 
pointerLength:Number  [read-only]

Get pointer length of this attachment shape, typically this is for alarm bubble attachment. Default value is 10.


Implementation
    public function get pointerLength():Number
pointerWidthproperty 
pointerWidth:Number  [read-only]

Get pointer length of this attachment shape, typically this is for alarm bubble attachment. Default value is 8.


Implementation
    public function get pointerWidth():Number
positionproperty 
position:String  [read-only]

Get attachment based position of element body.

The value can be:

This default value is Consts.POSITION_TOPRIGHT_TOPRIGHT.


Implementation
    public function get position():String
roundRectproperty 
roundRect:Rectangle  [read-only]

Get the round rectangle of this attachment.


Implementation
    public function get roundRect():Rectangle
xOffsetproperty 
xOffset:Number  [read-only]

Get the extra x position offset of this attachment base on the attachment position. Default value is 0.


Implementation
    public function get xOffset():Number
yOffsetproperty 
yOffset:Number  [read-only]

Get the extra y position offset of this attachment base on the attachment position. Default value is 0.


Implementation
    public function get yOffset():Number
Constructor Detail
BasicAttachment()Constructor
public function BasicAttachment(elementUI:ElementUI, showInAttachmentCanvas:Boolean = false)

Constructor of this attachment. Create an attachment and attach it on the specified element ui.

Parameters
elementUI:ElementUI — the element ui to be attached.
 
showInAttachmentCanvas:Boolean (default = false) — whether show this attachment a the separate attachment canvas in network. See class Network to know more about the network internal canvas hierarchy. Because attachment canvas is in front of other canvas, so this attachment will not covered by other element body if set this value to true. Default value here is false.

See also

Method Detail
draw()method
override public function draw(graphics:Graphics):void

Draw attachment content. Subclass should overwrite this function to draw own attachment content.

Parameters

graphics:Graphics — the graphics attachment will draw on.

setMatrix()method 
override public function setMatrix(matrix:Matrix):void

Set attachment transform matrix.

Parameters

matrix:Matrix — attachment transform matrix.

updateProperties()method 
override public function updateProperties():void

Update element attachment properties. This will redraw attachment.