Package | twaver.network.ui |
Class | public class ElementUI |
Inheritance | ElementUI ![]() |
Subclasses | LinkUI, NodeUI |
UIComponent
and responsible for drawing element content on
network canvas. Every element has an element ui
class name so in runtime TWaver Flex will create an
element ui instance for this element to paint
content on network canvas dynamically.
In TWaver MVC framework, elements are model,
network and these ui classes are view. To visit
element ui instance, you can not get from element class
because element is just a plain class defines data
model. Also, an element can be displayed on many
networks in the same time so it will has many more
element ui instances for each network in the same time.
use network.getElementUI(element)
to get
element ui instance for an element. Call
network.invalidateElementUI(element)
to
invalidate the element ui for this element.
For example, element Node
use
NodeUI
as the element ui:
public class Node extends Element{ //... override public function get elementUIClass():Class{ return NodeUI; } }
See also
Property | Defined By | ||
---|---|---|---|
alarmAttachment : AlarmAttachment [read-only]
Get alarm attachment of this element ui. | ElementUI | ||
attachments : ICollection [read-only]
Get all attachments as a collection. | ElementUI | ||
bodyRect : Rectangle [read-only]
Get the element body rectangle. | ElementUI | ||
editAttachment : EditAttachment [read-only]
Get edit attachment. | ElementUI | ||
element : IElement [read-only]
Get the element of this element ui. | ElementUI | ||
hotSpot : Point
Get hotspot point of this element ui. | ElementUI | ||
iconsAttachment : IconsAttachment [read-only]
Get icon attachment. | ElementUI | ||
labelAttachment : LabelAttachment [read-only]
Get label attachment of this element ui. | ElementUI | ||
network : Network [read-only]
Get network component this element ui displayed on. | ElementUI | ||
unionBounds : Rectangle [read-only]
Get the rectangle covers all graphical elements,
including element body and all attachments. | ElementUI | ||
visible : Boolean [override] [write-only]
| ElementUI |
Property | Defined By | ||
---|---|---|---|
bodyComponent : UIComponent | ElementUI | ||
innerColor : Object [read-only]
Get element inner color. | ElementUI | ||
outerColor : Object [read-only]
Get element outline color. | ElementUI |
Method | Defined By | ||
---|---|---|---|
Create an element ui for specified element on this network. | ElementUI | ||
checkAttachments():void
Check all attachments installed on this element ui. | ElementUI | ||
dispose():void
Dispose all resources used by this element ui. | ElementUI | ||
handlePropertyChange(e:PropertyChangeEvent):void
Called when any element property changed. | ElementUI | ||
Called when selection changed. | ElementUI | ||
hitsTest(point:Point, tolerance:int):Object | ElementUI | ||
invalidate(checkAttachments:Boolean):void
Invalidate element ui. | ElementUI | ||
updateProperties():void
Update all properties from network and element,
redraw this element ui. | ElementUI |
Method | Defined By | ||
---|---|---|---|
addAttachment(attachment:Attachment):void
Add attachment into this element ui. | ElementUI | ||
checkAlarmAttachment():void
Check, update and display alarm attachment. | ElementUI | ||
checkEditAttachment():void
Check, update and display edit attachment. | ElementUI | ||
checkIconsAttachment():void
Check, update and display icon attachment. | ElementUI | ||
checkLabelAttachment():void
Check, update and display label attachment. | ElementUI | ||
commitProperties():void [override]
| ElementUI | ||
createBodyFilters():Array
Create element body effect filters of this element ui. | ElementUI | ||
createBodyRect():Rectangle
Create body bound rectangle. | ElementUI | ||
createFilters():Array
Create element effect filters of this element ui. | ElementUI | ||
drawBody(g:Graphics):void
Draw element body. | ElementUI | ||
getDyeColor(styleProp:String):Number
Get dye color of the specified style property. | ElementUI | ||
isEditable():Boolean
Check whether this element is editable now. | ElementUI | ||
measure():void [override]
| ElementUI | ||
removeAttachment(attachment:Attachment):void
Remove specified attachment from this element ui. | ElementUI | ||
updateMeasure():void
Update element measure. | ElementUI |
alarmAttachment | property |
alarmAttachment:AlarmAttachment
[read-only] Get alarm attachment of this element ui.
public function get alarmAttachment():AlarmAttachment
attachments | property |
attachments:ICollection
[read-only] Get all attachments as a collection.
public function get attachments():ICollection
bodyComponent | property |
protected var bodyComponent:UIComponent
bodyRect | property |
bodyRect:Rectangle
[read-only] Get the element body rectangle.
public function get bodyRect():Rectangle
editAttachment | property |
editAttachment:EditAttachment
[read-only] Get edit attachment. Edit attachment shows small editing indicators on this element ui used to resizing, moving control point etc.
public function get editAttachment():EditAttachment
element | property |
element:IElement
[read-only] Get the element of this element ui.
public function get element():IElement
hotSpot | property |
hotSpot:Point
Get hotspot point of this element ui.
public function get hotSpot():Point
public function set hotSpot(value:Point):void
iconsAttachment | property |
iconsAttachment:IconsAttachment
[read-only] Get icon attachment. Icon attachment display all small icons attached on this element ui.
public function get iconsAttachment():IconsAttachment
innerColor | property |
innerColor:Object
[read-only] Get element inner color.
protected function get innerColor():Object
labelAttachment | property |
labelAttachment:LabelAttachment
[read-only] Get label attachment of this element ui.
public function get labelAttachment():LabelAttachment
network | property |
network:Network
[read-only] Get network component this element ui displayed on.
public function get network():Network
outerColor | property |
outerColor:Object
[read-only] Get element outline color.
protected function get outerColor():Object
unionBounds | property |
unionBounds:Rectangle
[read-only] Get the rectangle covers all graphical elements, including element body and all attachments.
public function get unionBounds():Rectangle
visible | property |
visible:Boolean
[write-only] [override]
public function set visible(value:Boolean):void
ElementUI | () | Constructor |
public function ElementUI(network:Network, element:IElement)
Create an element ui for specified element on this network.
Parametersnetwork:Network — the network component this element ui displayed on.
| |
element:IElement — the element this element ui works for.
|
addAttachment | () | method |
protected function addAttachment(attachment:Attachment):void
Add attachment into this element ui.
Parameters
attachment:Attachment — attachment to be added.
|
checkAlarmAttachment | () | method |
protected function checkAlarmAttachment():void
Check, update and display alarm attachment.
checkAttachments | () | method |
public function checkAttachments():void
Check all attachments installed on this element ui.
checkEditAttachment | () | method |
protected function checkEditAttachment():void
Check, update and display edit attachment.
checkIconsAttachment | () | method |
protected function checkIconsAttachment():void
Check, update and display icon attachment.
checkLabelAttachment | () | method |
protected function checkLabelAttachment():void
Check, update and display label attachment.
commitProperties | () | method |
override protected final function commitProperties():void
createBodyFilters | () | method |
protected function createBodyFilters():Array
Create element body effect filters of this element ui.
ReturnsArray — element body effect filters of this element ui.
|
createBodyRect | () | method |
protected function createBodyRect():Rectangle
Create body bound rectangle.
ReturnsRectangle — body bound rectangle.
|
createFilters | () | method |
protected function createFilters():Array
Create element effect filters of this element ui.
ReturnsArray — element effect filters of this element ui.
|
dispose | () | method |
public function dispose():void
Dispose all resources used by this element ui.
drawBody | () | method |
protected function drawBody(g:Graphics):void
Draw element body.
Parameters
g:Graphics — the graphic draw body on.
|
getDyeColor | () | method |
protected function getDyeColor(styleProp:String):Number
Get dye color of the specified style property.
Parameters
styleProp:String — style property name of the color you want to get.
|
Number — dye color of this style property.
|
handlePropertyChange | () | method |
public function handlePropertyChange(e:PropertyChangeEvent):void
Called when any element property changed.
Parameters
e:PropertyChangeEvent — element property change event.
|
handleSelectionChange | () | method |
public function handleSelectionChange(e:SelectionChangeEvent):void
Called when selection changed.
Parameters
e:SelectionChangeEvent — selection changed event.
|
hitsTest | () | method |
public function hitsTest(point:Point, tolerance:int):Object
Parameters
point:Point | |
tolerance:int |
Object |
invalidate | () | method |
public function invalidate(checkAttachments:Boolean):void
Invalidate element ui.
Parameters
checkAttachments:Boolean — whether need to recheck
all attachements.
|
isEditable | () | method |
protected function isEditable():Boolean
Check whether this element is editable now.
ReturnsBoolean — whether this element is editable now.
|
measure | () | method |
override protected final function measure():void
removeAttachment | () | method |
protected function removeAttachment(attachment:Attachment):void
Remove specified attachment from this element ui.
Parameters
attachment:Attachment — the attachment to be removed.
|
updateMeasure | () | method |
protected function updateMeasure():void
Update element measure.
updateProperties | () | method |
public function updateProperties():void
Update all properties from network and element, redraw this element ui.