Package | twaver.network.ui |
Class | public class BasicAttachment |
Inheritance | BasicAttachment ![]() ![]() |
Subclasses | AlarmAttachment, LabelAttachment, LinkHandlerAttachment |
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
Property | Defined By | ||
---|---|---|---|
![]() | attachmentSprite : Sprite | Attachment | |
![]() | attachmentSpriteTransform : 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 | ||
![]() | element : IElement [read-only]
Get element ui related element object. | Attachment | |
![]() | elementUI : 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 | ||
![]() | network : 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 | ||
![]() | showInAttachmentCanvas : 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 |
Method | Defined By | ||
---|---|---|---|
BasicAttachment(elementUI:ElementUI, showInAttachmentCanvas:Boolean = false)
Constructor of this attachment. | BasicAttachment | ||
![]() | 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 | ||
![]() | updateAlpha():void
Update attachment transparency. | Attachment | |
updateProperties():void [override]
Update element attachment properties. | BasicAttachment |
bounds | property |
bounds:Rectangle
[read-only] [override] Get attachment bounds.
public function get bounds():Rectangle
content | property |
content:DisplayObject
Get the display object content of this attachment.
public function get content():DisplayObject
public function set content(value:DisplayObject):void
contentHeight | property |
contentHeight:Number
[read-only] Get attachment content height. If content is null, return 20.
public function get contentHeight():Number
contentWidth | property |
contentWidth:Number
[read-only] Get attachment content width. If content is null, return 30.
public function get contentWidth():Number
contentXScale | property |
contentXScale:Number
[read-only] Get attachment x scale. Default value is 1.
public function get contentXScale():Number
contentYScale | property |
contentYScale:Number
[read-only] Get attachment y scale. Default value is 1.
public function get contentYScale():Number
cornerRadius | property |
cornerRadius:Number
[read-only] Get corner radius of the round rectangle shape. Default value is 8.
public function get cornerRadius():Number
direction | property |
direction:String
[read-only] Get attachment growing direction. This value can be:
Consts.ATTACHMENT_DIRECTION_RIGHT
.
public function get direction():String
fill | property |
fill:Boolean
[read-only] Whether this attachment need to fill. Default value is false.
public function get fill():Boolean
fillAlpha | property |
fillAlpha:Number
[read-only] Get attachment fill color transparency. Default value is 1, no transparency.
public function get fillAlpha():Number
fillColor | property |
fillColor:Number
[read-only] Get attachment fill color. Default color is black.
public function get fillColor():Number
gradient | property |
gradient:String
[read-only] Get attachment fill gradient pattern. Default value is null, no gradient.
This value can be:
public function get gradient():String
gradientAlpha | property |
gradientAlpha:Number
[read-only] Get attachment fill gradient color transparency. Default value is 1, no transparency.
public function get gradientAlpha():Number
gradientColor | property |
gradientColor:Number
[read-only] Get attachment fill gradient color. Default is white color.
public function get gradientColor():Number
outlineAlpha | property |
outlineAlpha:Number
[read-only] Get attachment outline color transparency. Default value is 1, no transparency.
public function get outlineAlpha():Number
outlineColor | property |
outlineColor:Number
[read-only] Get attachment outline color. Default color is black.
public function get outlineColor():Number
outlineWidth | property |
outlineWidth:Number
[read-only] Get attachment outline stroke width. Default value is -1, no outline.
public function get outlineWidth():Number
padding | property |
padding:Number
[read-only] Get padding blank space of this attachment. Default value is 0.
public function get padding():Number
paddingBottom | property |
paddingBottom:Number
[read-only] Get bottom padding blank space of this attachment. Default value is 0.
public function get paddingBottom():Number
paddingLeft | property |
paddingLeft:Number
[read-only] Get left padding blank space of this attachment. Default value is 0.
public function get paddingLeft():Number
paddingRight | property |
paddingRight:Number
[read-only] Get right padding blank space of this attachment. Default value is 0.
public function get paddingRight():Number
paddingTop | property |
paddingTop:Number
[read-only] Get top padding blank space of this attachment. Default value is 0.
public function get paddingTop():Number
pointerLength | property |
pointerLength:Number
[read-only] Get pointer length of this attachment shape, typically this is for alarm bubble attachment. Default value is 10.
public function get pointerLength():Number
pointerWidth | property |
pointerWidth:Number
[read-only] Get pointer length of this attachment shape, typically this is for alarm bubble attachment. Default value is 8.
public function get pointerWidth():Number
position | property |
position:String
[read-only] Get attachment based position of element body.
The value can be:
This default value is Consts.POSITION_TOPRIGHT_TOPRIGHT
.
public function get position():String
roundRect | property |
roundRect:Rectangle
[read-only] Get the round rectangle of this attachment.
public function get roundRect():Rectangle
xOffset | property |
xOffset:Number
[read-only] Get the extra x position offset of this attachment base on the attachment position. Default value is 0.
public function get xOffset():Number
yOffset | property |
yOffset:Number
[read-only] Get the extra y position offset of this attachment base on the attachment position. Default value is 0.
public function get yOffset():Number
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.
ParameterselementUI: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
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.