Package | twaver.network |
Class | public class Network |
Inheritance | Network ![]() |
twaver.ElementBox
, which
provides all data for network component.
TWaver Flex provides a well-designed MVC framework. Network component is an important view of this MVC framework. The connected element box works as the model, provides the data source of network. All elements contained in the element box will be displayed on network canvas automatically when you add them into the connected element box.
To use network component, just create network component and add elements into the connected element box, specified the element properties like location, name etc. Normally you don't need to take care of the painting details of network. Instead, just use APIs and properties to control the data.
For example:
var network:Network = new Network(); var box:ElementBox = network.elementBox; //add more data into network. var node1:Node = new Node(); node1.location = new Point(100, 100); node1.name = "node 1"; box.add(node1); var node2:Node = new Node(); node2.location = new Point(300, 200); node2.name = "node 2"; box.add(node2); var link:Link = new Link(node1, node2); box.add(link);
Network component also provides more features for developers to control the default display and behaviours. It has a selection model to manage element selection; it has filters to control element visibilities, whether can be moved around, and whether editable; it provides top canvas and bottom canvas so you can paint extra contents on it; it provides background to display a bitmap image or vector image on the network background; it provides lots listeners to implements the interaction with mouse and keyboard, etc.
It's important to understand the internal UI hierarchy of network. Following shows the network internal canvas hierarchy:
network hierarchy: -> rootCanvas -> topCanvas -> attachmentCanvas -> layerCanvas -> layer n -> layer ... -> default layer -> bottomCanvas -> backgroundCanvas
To know more details about network component, check out TWaver Flex online demo and the demo source code.
Property | Defined By | ||
---|---|---|---|
alarmFillColorFunction : Function
Get alarm bubble fill color generator. | Network | ||
alarmLabelFunction : Function
Get element alarm bubble text content generator. | Network | ||
attachmentCanvas : Canvas [read-only]
Get attachment canvas of this network. | Network | ||
backgroundCanvas : Canvas [read-only]
Get the network background canvas. | Network | ||
backgroundUI : BackgroundUI [read-only]
Get the background UI instance. | Network | ||
bottomCanvas : Canvas [read-only]
Get bottom canvas of this network. | Network | ||
currentSubNetwork : ISubNetwork
Get current displaying subnetwork of this network. | Network | ||
doubleClickToEmptySubNetwork : Boolean
Get the boolean value whether drill down an empty subnetwork by double-clicking. | Network | ||
doubleClickToGroupExpand : Boolean
Get the boolean value whether expand or close group element
by double-clicking. | Network | ||
doubleClickToLinkBundle : Boolean
Get the boolean value whether expand or close link bundle
by double-clicking. | Network | ||
doubleClickToSubNetwork : Boolean
Whether double click to drill down a subnetwork. | Network | ||
doubleClickToUpSubNetwork : Boolean
Whether enable the behaviour that go upper layer subnetwork
topology by double-clicking. | Network | ||
editableFunction : Function
Get the editable filter of this network. | Network | ||
editLineAlpha : Number
Get the color transparency value of the link path
indicator line which is displayed on network
when creating a new link by mouse from a from/start
node and moving mouse to find the end/to node. | Network | ||
editLineColor : Number
The color of the link path indicator line which is displayed on network
when creating a new link by mouse from a from/start node and moving mouse
to find the end/to node. | Network | ||
editLineWidth : Number
Get the width value of the link path indicator line which is displayed on network
when creating a new link by mouse from a from/start node and moving mouse
to find the end/to node. | Network | ||
editPointFillAlpha : Number
Get fill color transparency of the edit indicator point. | Network | ||
editPointFillColor : Number
Get fill color of the edit indicator point. | Network | ||
editPointOutlineColor : Number
Get outline color of element edit indicator point. | Network | ||
editPointOutlineWidth : Number
Get outline stroke width of element edit indicator point. | Network | ||
editPointSize : Number
Get the edit indicator point size. | Network | ||
elementBox : ElementBox
Get network connecting element data box. | Network | ||
elementUIFunction : Function
The element UI generator. | Network | ||
hasEditInteractionHandler : Boolean
Check whether network interaction mode includes edit interaction handler. | Network | ||
hasMovableSelectedElements : Boolean [read-only]
Whether has movable selected elements. | Network | ||
iconsColorsFunction : Function
Get the generator used to give rendering color for each attached
icons for each element. | Network | ||
iconsNamesFunction : Function
Get the generator used to determine what attached icons should be
displayed for each element. | Network | ||
innerColorFunction : Function
Get the element inner rendering color generator. | Network | ||
interactionHandlers : ICollection
Get interaction handlers for network. | Network | ||
isEditingElement : Boolean
Check whether network now is editing an element. | Network | ||
isMovingElement : Boolean
Check whether now has an element is moving on network canvas. | Network | ||
isSelectingElement : Boolean
Get boolean value whether now network canvas is selecting elements. | Network | ||
keyboardRemoveEnabled : Boolean
Get value whether enable deleting element by press "del" key on keyboard. | Network | ||
keyboardSelectEnabled : Boolean
Get value whether enable selecting all elements by press "ctrl+a" on keyboard. | Network | ||
labelFunction : Function
Get label generator of this network. | Network | ||
layerCanvas : Canvas [read-only]
Get layer canvas of this network. | Network | ||
lazyMoveAnimate : Boolean
Whether enable animated effect when move elements lazily. | Network | ||
lazyMoveFill : Boolean
Get value whether element will be filled by special color when it
is lazy-moving on network. | Network | ||
lazyMoveFillAlpha : Number
Get transparent alpha value of element fill color
when element is lazy-moving on network. | Network | ||
lazyMoveFillColor : Number
Get element fill color when element is lazy-moving on network. | Network | ||
lazyMoveOutlineColor : Number
Get element outline color when element is lazy-moving on network. | Network | ||
lazyMoveOutlineWidth : Number
Set element outline stroke width when element is lazy-moving on network. | Network | ||
limitElementInPositiveLocation : Boolean
Return whether the elements can not be moved to negative location such as (-100,-100). | Network | ||
linkHandlerLabelFunction : Function
Get the generator used to determine what text content of link handler
should be displayed. | Network | ||
makeVisibleOnSelected : Boolean
Get the value that whether data should be scrolled to visible when it is selected. | Network | ||
maxZoom : Number
Get maximum zoom value. | Network | ||
minZoom : Number
Get the minimum zoom value. | Network | ||
movableFunction : Function
Get the movable filter of this network. | Network | ||
movableSelectedElements : ICollection [read-only]
Get all movable selected elements with a collection. | Network | ||
movableSelectedElementsRect : Rectangle [read-only]
Get the rectangle covers all selected movable elements. | Network | ||
noAgentLinkVisible : Boolean
Get value whether display links on network which has no from
node or to node. | Network | ||
outerColorFunction : Function
Get the element outline draw color generator. | Network | ||
removeElementUIOnInvisible : Boolean
Get value whether remove elementui from layer canvas when element is invisible. | Network | ||
resizeAnimate : Boolean
Get the boolean value that indicates whether animate the element resizing
when resizing an element by mouse draging on network under edit-lazy mode. | Network | ||
resizeLineColor : Number
Get element resizing bounds line color when resizing an element
by mouse draging on network under edit-lazy mode. | Network | ||
resizeLineWidth : Number
Get element resizing bounds line stroke width when resizing an element
by mouse draging on network under edit-lazy mode. | Network | ||
resizePointFillAlpha : Number
Transparency of fill color of the element resize point indicator. | Network | ||
resizePointFillColor : Number
Get fill color of the element resize point indicator. | Network | ||
resizePointOutlineColor : Number
Outline color of the element resize point indicator. | Network | ||
resizePointOutlineWidth : Number
Outline stroke width of the element resize point indicator. | Network | ||
rootCanvas : Canvas [read-only]
Get the root canvas. | Network | ||
selectColorFunction : Function
Get the element selected outline color generator. | Network | ||
selectFillAlpha : Number
Get transparent alpha value of the element fill color when it selected. | Network | ||
selectFillColor : Number
Get element fill color when it selected. | Network | ||
selectionModel : SelectionModel [read-only]
Get the selection model of this view. | Network | ||
selectionTolerance : int
Get tolerance value when using mouse click to select element on network canvas. | Network | ||
selectMode : String
Get the network selection mode. | Network | ||
selectOutlineColor : Number
Get the element selection outline color on network. | Network | ||
selectOutlineWidth : Number
Get element selection outline stroke width. | Network | ||
sendToTopOnSelected : Boolean
Get value whether element will be sent to top when element is selected. | Network | ||
shareSelectionModel : Boolean
Whether share selection model container of this view with other
views connecting to the same data box. | Network | ||
subNetworkAnimate : Boolean
Whether enable animated effect when drill down a subnetwork element. | Network | ||
toolTipFunction : Function
Get the tooltip content generator of this network. | Network | ||
topCanvas : Canvas [read-only]
Get top canvas of this network. | Network | ||
transparentSelectionEnable : Boolean
Get value whether select the node element by clicking the transparent
area of the node image. | Network | ||
visibleFunction : Function
Get the visible filter of this network. | Network | ||
zoom : Number
Get current zoom scale value. | Network |
Method | Defined By | ||
---|---|---|---|
Network(elementBox:ElementBox = null)
Network constructor. | Network | ||
addElementByInteraction(element:IElement):void
Add element to databox after interaction end. | Network | ||
addInteractionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add an interaction listener on this network canvas. | Network | ||
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener into this view. | Network | ||
addSelectionChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add data selection change listener into this view. | Network | ||
callLater2(method:Function, args:Array = null):void
TWaver call later function. | Network | ||
centerByLogicalPoint(x:Number, y:Number, animate:Boolean = false):void
Scroll network canvas to the specified location as view port center. | Network | ||
dispatchPropertyChangeEvent2(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch a property change event to all property change listeners. | Network | ||
exportAsBitmapData(logicalRect:Rectangle = null, zoom:Number = 1):BitmapData
Export the specified area of network canvas to a bitmap image. | Network | ||
forEachElementUI(callbackFunction:Function, layer:ILayer = null):void
Iterate element UI for element displays on this network. | Network | ||
getAlarmFillColor(element:IElement):Object
Get alarm bubble fill color for specified element. | Network | ||
getAlarmLabel(element:IElement):String
Get alarm bubble text content of specified element. | Network | ||
getElementByMouseEvent(e:MouseEvent, shouldBeSelectable:Boolean = true, tolerance:int = -1):IElement
Get element at the mouse event located position. | Network | ||
getElementsByDisplayObject(displayObject:DisplayObject, intersectMode:Boolean = true, accuracy:Number = 1):ICollection
Get elements by specified display object. | Network | ||
getElementsByLocalPoint(localPoint:Point, tolerance:int = -1):ICollection
Get elements at specified local position. | Network | ||
getElementsByLocalRectangle(localRect:Rectangle, intersectMode:Boolean = true, tolerance:int = -1):ICollection
Get all elements contains in specified rectangle. | Network | ||
getElementsByMouseEvent(e:MouseEvent, tolerance:int = -1):ICollection
Get elements at mouse events specified location. | Network | ||
Get specified element UI object. | Network | ||
getIconsColors(element:IElement):Array
Get rendering colors for all attached icons of the specified element. | Network | ||
getIconsNames(element:IElement):Array
Get all attached icon names of specified element. | Network | ||
getInnerColor(element:IElement):Object
Get inner rendering color for specified element. | Network | ||
Get label text content of specified element. | Network | ||
getLayerCanvasByElement(element:IElement):Canvas | Network | ||
getLinkHandlerLabel(link:Link):String
Get the handler label text content of specified link. | Network | ||
getLogicalPoint(e:MouseEvent):Point
Get logical point of specified mouse event location. | Network | ||
getOuterColor(element:IElement):Object
Get outline color of specified element. | Network | ||
getPosition(position:String, object:Object, tarRect:Size, xOffset:Number, yOffset:Number):Point | Network | ||
getScopeRect(scope:String):Rectangle
Get the specified scope rectangle. | Network | ||
getSelectColor(element:IElement):Number
Get select color for specified element. | Network | ||
getStageRectangle(localRect:Rectangle):Rectangle
Get global bounds rectangle on network root canvas for specified
local rectangle. | Network | ||
getToolTip(element:IElement):String
Get tooltip text for specified element. | Network | ||
hitsTestByMouseEvent(e:MouseEvent, tolerance:int = -1):Object
Determine which part of an Elmenet is under the mouse. | Network | ||
hitsTestByStagePoint(stagePoint:Point, tolerance:int = -1):Object
Determine which part of an Elmenet is under the specified stage location. | Network | ||
invalidateBackground(event:* = null):void | Network | ||
invalidateElementIndex():void | Network | ||
invalidateElementUI(element:IElement, checkAttachments:Boolean = true):void
Invalidate specified element UI. | Network | ||
invalidateElementUIs(checkAttachments:Boolean = true):void
Invalidate all element UIs. | Network | ||
invalidateElementVisibility():void
Call this to invalidate all element visibilities. | Network | ||
invalidateSelectedElementUIs(checkAttachments:Boolean = true):void
Invalidate all selected elements' UI area. | Network | ||
isEditable(element:IElement):Boolean
Check whether the specified element is editable on this
network canvas. | Network | ||
Check whether specified element is movable on network canvas. | Network | ||
isSelected(element:IElement):Boolean
Check whether specified element is selected on this network. | Network | ||
isValidMouseEvent(e:MouseEvent):Boolean
Check whether the mouse event is a valid mouse operation event on network canvas. | Network | ||
Whether specified element is visible. | Network | ||
makeVisible(element:IElement):void
Make specified element scroll-to-visible. | Network | ||
moveSelectedElements(xoffset:Number, yoffset:Number, animate:Boolean = false, finishFunction:Function = null):void
Move all selected elements from current locations to the
specified offsets. | Network | ||
removeInteractionListener(listener:Function):void
Remove the specified interaction listener from this network. | Network | ||
removePropertyChangeListener(listener:Function):void
Remove specified property change listener from this view. | Network | ||
Remove all selected data from view connected data box. | Network | ||
removeSelectionChangeListener(listener:Function):void
Remove data selection change listener from this view. | Network | ||
Select all visible data of this view. | Network | ||
Send specified element to canvas most front location. | Network | ||
setCreateLinkInteractionHandlers(linkClass:Class = null, callback:Function = null, linkType:String = null, isByControlPoint:Boolean = false, value:Number = -1, splitByPercent:Boolean = false):void
Call this to enable creating link interaction mode. | Network | ||
setCreateShapeLinkInteractionHandlers(shapeLinkClass:Class = null):void
Call this to enable creating shape link interaction mode. | Network | ||
setCreateShapeNodeInteractionHandlers(shapeNodeClass:Class = null):void
Call this to enalbe creating shape node interaction mode. | Network | ||
setCurrentSubNetwork(currentSubNetwork:ISubNetwork, animate:Boolean = false, finishFunction:Function = null):void
Set the subnetwork this network. | Network | ||
setDefaultInteractionHandlers(lazyMode:Boolean = false):void
Call this method to enable the default interaction handlers. | Network | ||
setEditInteractionHandlers(lazyMode:Boolean = false):void
Call this method to enable the edit interaction handlers. | Network | ||
setPanInteractionHandlers():void
Call this method to enable the pan interaction handlers
The pan interaction handler include
PanInteractionHandler. | Network | ||
setZoom(value:Number, animate:Boolean = false):void
Set zoom value to the specified value with animated affect. | Network | ||
upSubNetwork(animate:Boolean = false, finishFunction:Function = null):void
Call this method to go upper layer subnetwork topology. | Network | ||
zoomIn(animate:Boolean = false):void
Zoom in with animated effect. | Network | ||
zoomOut(animate:Boolean = false):void
Zoom out with animated effect. | Network | ||
zoomOverview(animate:Boolean = false):void
Zoom whole network canvas area to viewport bounds so all
network contents can be visible. | Network | ||
zoomReset(animate:Boolean = false):void
Reset zoom. | Network |
Method | Defined By | ||
---|---|---|---|
commitProperties():void [override]
| Network | ||
Called when element box changed. | Network | ||
handleElementBoxPropertyChange(e:PropertyChangeEvent):void
Called when property of element box has been changed. | Network | ||
handleElementPropertyChange(e:PropertyChangeEvent):void
Called when element property changed. | Network | ||
handleIndexChange(e:IndexChangeEvent):void
Called when element index has been changed. | Network | ||
Called when layer box is changed. | Network | ||
Called when layer hierarchy has been changed. | Network | ||
handleLayerPropertyChange(e:PropertyChangeEvent):void
Called when any layer property has been changed. | Network | ||
Called when element selection is changed. | Network | ||
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called on property change. | Network |
alarmFillColorFunction | property |
alarmFillColorFunction:Function
Get alarm bubble fill color generator. This generator determines what color will be used to fill alarm bubble. The default implementation will return the highest new alarm severity color.
public function get alarmFillColorFunction():Function
public function set alarmFillColorFunction(value:Function):void
alarmLabelFunction | property |
alarmLabelFunction:Function
Get element alarm bubble text content generator. This generator determines what text content will be displayed in the alarm buuble for each element. Default implementation will display number of highest severity. A "+" will be appended if has more new alarms with lower severities.
Read TWaver Flex Developer Guide for more details for alarm bubbles
public function get alarmLabelFunction():Function
public function set alarmLabelFunction(value:Function):void
attachmentCanvas | property |
attachmentCanvas:Canvas
[read-only]
Get attachment canvas of this network.
All attachments will be displayed on this canvas.
See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get attachmentCanvas():Canvas
backgroundCanvas | property |
backgroundCanvas:Canvas
[read-only]
Get the network background canvas.
Background canvas displays background bitmap or vector
image on it.
See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get backgroundCanvas():Canvas
backgroundUI | property |
backgroundUI:BackgroundUI
[read-only] Get the background UI instance. This UI instance responsible for network painting.
public function get backgroundUI():BackgroundUI
bottomCanvas | property |
bottomCanvas:Canvas
[read-only]
Get bottom canvas of this network.
Bottom can display some extra content of network
and will be displayed behind all elements.
See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get bottomCanvas():Canvas
currentSubNetwork | property |
currentSubNetwork:ISubNetwork
Get current displaying subnetwork of this network.
public function get currentSubNetwork():ISubNetwork
public function set currentSubNetwork(value:ISubNetwork):void
See also
doubleClickToEmptySubNetwork | property |
doubleClickToEmptySubNetwork:Boolean
Get the boolean value whether drill down an empty subnetwork by double-clicking. Default value is true.
public function get doubleClickToEmptySubNetwork():Boolean
public function set doubleClickToEmptySubNetwork(value:Boolean):void
doubleClickToGroupExpand | property |
doubleClickToGroupExpand:Boolean
Get the boolean value whether expand or close group element by double-clicking.
public function get doubleClickToGroupExpand():Boolean
public function set doubleClickToGroupExpand(value:Boolean):void
doubleClickToLinkBundle | property |
doubleClickToLinkBundle:Boolean
Get the boolean value whether expand or close link bundle by double-clicking.
public function get doubleClickToLinkBundle():Boolean
public function set doubleClickToLinkBundle(value:Boolean):void
doubleClickToSubNetwork | property |
doubleClickToSubNetwork:Boolean
Whether double click to drill down a subnetwork. Default value is true.
public function get doubleClickToSubNetwork():Boolean
public function set doubleClickToSubNetwork(value:Boolean):void
doubleClickToUpSubNetwork | property |
doubleClickToUpSubNetwork:Boolean
Whether enable the behaviour that go upper layer subnetwork topology by double-clicking. Default value is true.
public function get doubleClickToUpSubNetwork():Boolean
public function set doubleClickToUpSubNetwork(value:Boolean):void
See also
editableFunction | property |
editableFunction:Function
Get the editable filter of this network. This is used to determine which element on this network is editable. Editable element can be resized, moved, double-click to edit label, etc. Use this to enable/disable elements inline edit.
public function get editableFunction():Function
public function set editableFunction(value:Function):void
editLineAlpha | property |
editLineAlpha:Number
Get the color transparency value of the link path indicator line which is displayed on network when creating a new link by mouse from a from/start node and moving mouse to find the end/to node. Default value is 0.7
public function get editLineAlpha():Number
public function set editLineAlpha(value:Number):void
editLineColor | property |
editLineColor:Number
The color of the link path indicator line which is displayed on network when creating a new link by mouse from a from/start node and moving mouse to find the end/to node. Default value is 0x658DC1.
public function get editLineColor():Number
public function set editLineColor(value:Number):void
editLineWidth | property |
editLineWidth:Number
Get the width value of the link path indicator line which is displayed on network when creating a new link by mouse from a from/start node and moving mouse to find the end/to node. Default value is 2.
public function get editLineWidth():Number
public function set editLineWidth(value:Number):void
editPointFillAlpha | property |
editPointFillAlpha:Number
Get fill color transparency of the edit indicator point. Edit point is the small round points along the shape path displayed on ShapeNode or ShapeLink elements when they are editable on network component. You can move the edit points to change the path. Default value is 1, no transparency.
public function get editPointFillAlpha():Number
public function set editPointFillAlpha(value:Number):void
editPointFillColor | property |
editPointFillColor:Number
Get fill color of the edit indicator point. Default color is 0xFFFF00. Edit point is the small round points along the shape path displayed on ShapeNode or ShapeLink elements when they are editable on network component. You can move the edit points to change the path.
public function get editPointFillColor():Number
public function set editPointFillColor(value:Number):void
editPointOutlineColor | property |
editPointOutlineColor:Number
Get outline color of element edit indicator point. Edit point is the small round points along the shape path displayed on ShapeNode or ShapeLink elements when they are editable on network component. You can move the edit points to change the path. Default value is 0x000000.
public function get editPointOutlineColor():Number
public function set editPointOutlineColor(value:Number):void
editPointOutlineWidth | property |
editPointOutlineWidth:Number
Get outline stroke width of element edit indicator point. Edit point is the small round points along the shape path displayed on ShapeNode or ShapeLink elements when they are editable on network component. You can move the edit points to change the path. Default value is 1.
public function get editPointOutlineWidth():Number
public function set editPointOutlineWidth(value:Number):void
editPointSize | property |
editPointSize:Number
Get the edit indicator point size. Edit point is the small round points along the shape path displayed on ShapeNode or ShapeLink elements when they are editable on network component. You can move the edit points to change the path. The default size is 3.
public function get editPointSize():Number
public function set editPointSize(value:Number):void
elementBox | property |
elementBox:ElementBox
Get network connecting element data box.
public function get elementBox():ElementBox
public function set elementBox(value:ElementBox):void
elementUIFunction | property |
elementUIFunction:Function
The element UI generator. This generator determines what element UI
class should be used for each element. Default implementation
will use element.elementUIClass
to create element UI
dynamically.
public function get elementUIFunction():Function
public function set elementUIFunction(value:Function):void
hasEditInteractionHandler | property |
hasEditInteractionHandler:Boolean
Check whether network interaction mode includes edit interaction handler.
public function get hasEditInteractionHandler():Boolean
public function set hasEditInteractionHandler(value:Boolean):void
hasMovableSelectedElements | property |
hasMovableSelectedElements:Boolean
[read-only] Whether has movable selected elements.
public function get hasMovableSelectedElements():Boolean
iconsColorsFunction | property |
iconsColorsFunction:Function
Get the generator used to give rendering color for each attached
icons for each element. Default implementation will use
element.getStyle(Styles.ICONS_COLORS)
if has.
public function get iconsColorsFunction():Function
public function set iconsColorsFunction(value:Function):void
iconsNamesFunction | property |
iconsNamesFunction:Function
Get the generator used to determine what attached icons should be
displayed for each element. Default implementation will return
element.getStyle(Styles.ICONS_NAMES)
if it has.
public function get iconsNamesFunction():Function
public function set iconsNamesFunction(value:Function):void
innerColorFunction | property |
innerColorFunction:Function
Get the element inner rendering color generator. This generator determines what rendering color should be used for each element. The default implementation use the highest alarm severity color for the inner color.
public function get innerColorFunction():Function
public function set innerColorFunction(value:Function):void
interactionHandlers | property |
interactionHandlers:ICollection
Get interaction handlers for network. The interaction handlers
are a collection contains a set of instances of
IInteractionHandler
that controls the interactive
behavious. Use this method you can change the default interaction
model. For example, you can use this to turn on edit mode,
selection mode, fisheye mode, magnify mode etc.
This code shows you how to turn on fisheye interaction mode:
network.interactionHandlers = new Collection([ new SelectInteractionHandler(network), new EditInteractionHandler(network), new MoveInteractionHandler(network), new DefaultInteractionHandler(network), new MapFilterInteractionHandler(network), ]);
If this value is null, that means all interaction of network canvas are disable.
public function get interactionHandlers():ICollection
public function set interactionHandlers(value:ICollection):void
isEditingElement | property |
isEditingElement:Boolean
Check whether network now is editing an element.
public function get isEditingElement():Boolean
public function set isEditingElement(value:Boolean):void
isMovingElement | property |
isMovingElement:Boolean
Check whether now has an element is moving on network canvas.
public function get isMovingElement():Boolean
public function set isMovingElement(value:Boolean):void
isSelectingElement | property |
isSelectingElement:Boolean
Get boolean value whether now network canvas is selecting elements.
public function get isSelectingElement():Boolean
public function set isSelectingElement(value:Boolean):void
keyboardRemoveEnabled | property |
keyboardRemoveEnabled:Boolean
Get value whether enable deleting element by press "del" key on keyboard. Default value is true.
public function get keyboardRemoveEnabled():Boolean
public function set keyboardRemoveEnabled(value:Boolean):void
keyboardSelectEnabled | property |
keyboardSelectEnabled:Boolean
Get value whether enable selecting all elements by press "ctrl+a" on keyboard. Default value is true.
public function get keyboardSelectEnabled():Boolean
public function set keyboardSelectEnabled(value:Boolean):void
labelFunction | property |
labelFunction:Function
Get label generator of this network. This is used to
generate element label content. Default implementation
will return element.getStyle(Styles.NETWORK_LABEL)
if not null. Otherwise, element.name
will be returned.
public function get labelFunction():Function
public function set labelFunction(value:Function):void
layerCanvas | property |
layerCanvas:Canvas
[read-only]
Get layer canvas of this network. Layer canvas
contains each layer canvas and displays all elements
of that layer.
See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get layerCanvas():Canvas
lazyMoveAnimate | property |
lazyMoveAnimate:Boolean
Whether enable animated effect when move elements lazily.
public function get lazyMoveAnimate():Boolean
public function set lazyMoveAnimate(value:Boolean):void
lazyMoveFill | property |
lazyMoveFill:Boolean
Get value whether element will be filled by special color when it is lazy-moving on network. Default value is true.
public function get lazyMoveFill():Boolean
public function set lazyMoveFill(value:Boolean):void
lazyMoveFillAlpha | property |
lazyMoveFillAlpha:Number
Get transparent alpha value of element fill color when element is lazy-moving on network. Default value is 0.4.
public function get lazyMoveFillAlpha():Number
public function set lazyMoveFillAlpha(value:Number):void
lazyMoveFillColor | property |
lazyMoveFillColor:Number
Get element fill color when element is lazy-moving on network. Default value is 0xB8D3F0
public function get lazyMoveFillColor():Number
public function set lazyMoveFillColor(value:Number):void
lazyMoveOutlineColor | property |
lazyMoveOutlineColor:Number
Get element outline color when element is lazy-moving on network. Default value is 0x658DC1
public function get lazyMoveOutlineColor():Number
public function set lazyMoveOutlineColor(value:Number):void
lazyMoveOutlineWidth | property |
lazyMoveOutlineWidth:Number
Set element outline stroke width when element is lazy-moving on network. Default value is 1.
public function get lazyMoveOutlineWidth():Number
public function set lazyMoveOutlineWidth(value:Number):void
limitElementInPositiveLocation | property |
limitElementInPositiveLocation:Boolean
Return whether the elements can not be moved to negative location such as (-100,-100).
public function get limitElementInPositiveLocation():Boolean
public function set limitElementInPositiveLocation(value:Boolean):void
linkHandlerLabelFunction | property |
linkHandlerLabelFunction:Function
Get the generator used to determine what text content of link handler should be displayed. The default implementation will displays text like "+(5)" if 5 links are bundled.
public function get linkHandlerLabelFunction():Function
public function set linkHandlerLabelFunction(value:Function):void
makeVisibleOnSelected | property |
makeVisibleOnSelected:Boolean
Get the value that whether data should be scrolled to visible when it is selected.
public function get makeVisibleOnSelected():Boolean
public function set makeVisibleOnSelected(value:Boolean):void
maxZoom | property |
maxZoom:Number
Get maximum zoom value.
public function get maxZoom():Number
public function set maxZoom(value:Number):void
minZoom | property |
minZoom:Number
Get the minimum zoom value.
public function get minZoom():Number
public function set minZoom(value:Number):void
movableFunction | property |
movableFunction:Function
Get the movable filter of this network. This is used to determine which element on this network is movable by mouse drag-and-drop. Use this filter to fix some elements that you don't want to be moved around.
public function get movableFunction():Function
public function set movableFunction(value:Function):void
movableSelectedElements | property |
movableSelectedElements:ICollection
[read-only] Get all movable selected elements with a collection.
public function get movableSelectedElements():ICollection
movableSelectedElementsRect | property |
movableSelectedElementsRect:Rectangle
[read-only] Get the rectangle covers all selected movable elements.
public function get movableSelectedElementsRect():Rectangle
noAgentLinkVisible | property |
noAgentLinkVisible:Boolean
Get value whether display links on network which has no from node or to node. Default value is false.
public function get noAgentLinkVisible():Boolean
public function set noAgentLinkVisible(value:Boolean):void
outerColorFunction | property |
outerColorFunction:Function
Get the element outline draw color generator. This generator
determines what color should be used for each element outline.
The default implementation will return propagated alarm severity
color if has, then return element.getStyle(Styles.OUTER_COLOR)
if propagation is null.
public function get outerColorFunction():Function
public function set outerColorFunction(value:Function):void
removeElementUIOnInvisible | property |
removeElementUIOnInvisible:Boolean
Get value whether remove elementui from layer canvas when element is invisible. Default value is false.
public function get removeElementUIOnInvisible():Boolean
public function set removeElementUIOnInvisible(value:Boolean):void
resizeAnimate | property |
resizeAnimate:Boolean
Get the boolean value that indicates whether animate the element resizing when resizing an element by mouse draging on network under edit-lazy mode. Default value is true.
public function get resizeAnimate():Boolean
public function set resizeAnimate(value:Boolean):void
resizeLineColor | property |
resizeLineColor:Number
Get element resizing bounds line color when resizing an element by mouse draging on network under edit-lazy mode. The default value is 0x000000.
public function get resizeLineColor():Number
public function set resizeLineColor(value:Number):void
resizeLineWidth | property |
resizeLineWidth:Number
Get element resizing bounds line stroke width when resizing an element by mouse draging on network under edit-lazy mode. Default value is 1.
public function get resizeLineWidth():Number
public function set resizeLineWidth(value:Number):void
resizePointFillAlpha | property |
resizePointFillAlpha:Number
Transparency of fill color of the element resize point indicator. Resize point indicator is the small rectangle displayed in the four corner and four borders on the element if it is editable. You can drag-and-drop mouse to resize this element size. Default value is 1, no transparency.
public function get resizePointFillAlpha():Number
public function set resizePointFillAlpha(value:Number):void
resizePointFillColor | property |
resizePointFillColor:Number
Get fill color of the element resize point indicator. Resize point indicator is the small rectangle displayed in the four corner and four borders on the element if it is editable. You can drag-and-drop mouse to resize this element size. Default color is 0xFFFFFF.
public function get resizePointFillColor():Number
public function set resizePointFillColor(value:Number):void
resizePointOutlineColor | property |
resizePointOutlineColor:Number
Outline color of the element resize point indicator. Resize point indicator is the small rectangle displayed in the four corner and four borders on the element if it is editable. You can drag-and-drop mouse to resize this element size. Default value is 0x000000.
public function get resizePointOutlineColor():Number
public function set resizePointOutlineColor(value:Number):void
resizePointOutlineWidth | property |
resizePointOutlineWidth:Number
Outline stroke width of the element resize point indicator. Resize point indicator is the small rectangle displayed in the four corner and four borders on the element if it is editable. You can drag-and-drop mouse to resize this element size. Default value is 1.
public function get resizePointOutlineWidth():Number
public function set resizePointOutlineWidth(value:Number):void
rootCanvas | property |
rootCanvas:Canvas
[read-only]
Get the root canvas. Root canvas is the parent canvas of other canvases.
See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get rootCanvas():Canvas
selectColorFunction | property |
selectColorFunction:Function
Get the element selected outline color generator. This generator
determines what color should be used for selected element outline.
Default implementation will return element.getStyle(Styles.SELECT_COLOR)
or dark color if that style is null.
public function get selectColorFunction():Function
public function set selectColorFunction(value:Function):void
selectFillAlpha | property |
selectFillAlpha:Number
Get transparent alpha value of the element fill color when it selected. Default value is 0.4.
public function get selectFillAlpha():Number
public function set selectFillAlpha(value:Number):void
selectFillColor | property |
selectFillColor:Number
Get element fill color when it selected. Default value is 0xB8D3F0
public function get selectFillColor():Number
public function set selectFillColor(value:Number):void
selectionModel | property |
selectionModel:SelectionModel
[read-only] Get the selection model of this view.
public function get selectionModel():SelectionModel
See also
selectionTolerance | property |
selectionTolerance:int
Get tolerance value when using mouse click to select element on network canvas. Default value is 2.
public function get selectionTolerance():int
public function set selectionTolerance(value:int):void
selectMode | property |
selectMode:String
Get the network selection mode. It can be:
Consts.Consts.SELECT_MODE_MIX
.
public function get selectMode():String
public function set selectMode(value:String):void
selectOutlineColor | property |
selectOutlineColor:Number
Get the element selection outline color on network. Default value is 0x658DC1
public function get selectOutlineColor():Number
public function set selectOutlineColor(value:Number):void
selectOutlineWidth | property |
selectOutlineWidth:Number
Get element selection outline stroke width. Default value is 1.
public function get selectOutlineWidth():Number
public function set selectOutlineWidth(value:Number):void
sendToTopOnSelected | property |
sendToTopOnSelected:Boolean
Get value whether element will be sent to top when element is selected. Default value is true.
public function get sendToTopOnSelected():Boolean
public function set sendToTopOnSelected(value:Boolean):void
shareSelectionModel | property |
shareSelectionModel:Boolean
Whether share selection model container of this view with other views connecting to the same data box. If share, then this view will not maintain an own selection model container, instead, using the data box's selection model. If not, then this view will maintain an own selection model container, then every view has own selection model even they connecting a same data box.
public function get shareSelectionModel():Boolean
public function set shareSelectionModel(value:Boolean):void
subNetworkAnimate | property |
subNetworkAnimate:Boolean
Whether enable animated effect when drill down a subnetwork element. Default value is false.
public function get subNetworkAnimate():Boolean
public function set subNetworkAnimate(value:Boolean):void
toolTipFunction | property |
toolTipFunction:Function
Get the tooltip content generator of this network. This is used to
generate element tooltip text that displayed on network canvas.
The default implementation will return element.tooltip
.
public function get toolTipFunction():Function
public function set toolTipFunction(value:Function):void
topCanvas | property |
topCanvas:Canvas
[read-only]
Get top canvas of this network. See above asdoc of this Network
class to know more about internal hierarchy of network.
public function get topCanvas():Canvas
transparentSelectionEnable | property |
transparentSelectionEnable:Boolean
Get value whether select the node element by clicking the transparent area of the node image. Default value is false.
public function get transparentSelectionEnable():Boolean
public function set transparentSelectionEnable(value:Boolean):void
visibleFunction | property |
visibleFunction:Function
Get the visible filter of this network. This is used to determine which element should be visible on this network canvas. Use this visible filter to hide some elements dynamically.
public function get visibleFunction():Function
public function set visibleFunction(value:Function):void
zoom | property |
zoom:Number
Get current zoom scale value.
public function get zoom():Number
public function set zoom(value:Number):void
Network | () | Constructor |
public function Network(elementBox:ElementBox = null)
Network constructor. Create a network and connect it to the specified element box instance. This element box will be the data source of this network. If element box is null or not specified, then TWaver Flex will create one internally.
Also, you can change the connected element box later
by network.elementBox = new ElementBox();
.
elementBox:ElementBox (default = null ) — the element box instance connecting
to this network component.
|
addElementByInteraction | () | method |
public function addElementByInteraction(element:IElement):void
Add element to databox after interaction end. And the parent of this element will be set to currentSubNetwork if the old parent is null. Also this element will be selected, and a new InteractionEvent.CREATE_ELEMENT will be fired.
Parameters
element:IElement — the elment to add to databox.
|
addInteractionListener | () | method |
public function addInteractionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add an interaction listener on this network canvas.
Parameters
listener:Function — the interaction listener to be installed.
| |
priority:int (default = 0 ) — listening priority
| |
useWeakReference:Boolean (default = false ) — whether use weak reference for this listener.
|
addPropertyChangeListener | () | method |
public function addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener into this view. It will be notified when property changed.
Parameters
listener:Function — the listener to be installed.
| |
priority:int (default = 0 ) — the listening priority
| |
useWeakReference:Boolean (default = false ) — whether use weak feference
|
addSelectionChangeListener | () | method |
public function addSelectionChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add data selection change listener into this view. The listener will be notified when the selection of any data is changed.
Parameters
listener:Function — the listener to be added.
| |
priority:int (default = 0 ) — the listening priority
| |
useWeakReference:Boolean (default = false ) — whether use weak reference
|
callLater2 | () | method |
public function callLater2(method:Function, args:Array = null):void
TWaver call later function. Wait in queue and call the specified function later with specified arguments.
Parameters
method:Function — the method will be called later.
| |
args:Array (default = null ) — the arguments that will be used when method is called.
|
centerByLogicalPoint | () | method |
public function centerByLogicalPoint(x:Number, y:Number, animate:Boolean = false):void
Scroll network canvas to the specified location as view port center.
Parameters
x:Number — view port center x value.
| |
y:Number — view port center y value.
| |
animate:Boolean (default = false ) — true if use animation, false otherwise.
|
commitProperties | () | method |
override protected function commitProperties():void
dispatchPropertyChangeEvent2 | () | method |
public function dispatchPropertyChangeEvent2(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch a property change event to all property change listeners. The "2" in the end of this method name is to avoid override the default same method defined in Flex 3.
Parameters
property:String — the property name to be dispatched.
| |
oldValue:Object — old value before the change
| |
newValue:Object — new value after the change
|
Boolean — true if dispatched successfully, false otherwise.
|
exportAsBitmapData | () | method |
public function exportAsBitmapData(logicalRect:Rectangle = null, zoom:Number = 1):BitmapData
Export the specified area of network canvas to a bitmap image.
Parameters
logicalRect:Rectangle (default = null ) — logical bounds on network canvas that to be exported.
Null value will export whole canvas (scope view size).
| |
zoom:Number (default = 1 ) — the scale of network. Default value is 1.
|
BitmapData — exported bitmap data
|
forEachElementUI | () | method |
public function forEachElementUI(callbackFunction:Function, layer:ILayer = null):void
Iterate element UI for element displays on this network.
Parameters
callbackFunction:Function — the iterate call back function.
| |
layer:ILayer (default = null ) — the layer that to be iterated. Null will iterate
all layer elements.
|
getAlarmFillColor | () | method |
public function getAlarmFillColor(element:IElement):Object
Get alarm bubble fill color for specified element.
Parameters
element:IElement — an element.
|
Object — the alarm bubble fill color for specified element.
|
getAlarmLabel | () | method |
public function getAlarmLabel(element:IElement):String
Get alarm bubble text content of specified element.
Parameters
element:IElement — an element.
|
String — the alarm bubble text content of specified element.
|
getElementByMouseEvent | () | method |
public function getElementByMouseEvent(e:MouseEvent, shouldBeSelectable:Boolean = true, tolerance:int = -1):IElement
Get element at the mouse event located position.
Parameters
e:MouseEvent — mouse event.
| |
shouldBeSelectable:Boolean (default = true ) — whether element should be selected. Default
value is true.
| |
tolerance:int (default = -1 ) — the tolerance of the mouse point location for element selection.
|
IElement — element at mouse event located position.
|
getElementsByDisplayObject | () | method |
public function getElementsByDisplayObject(displayObject:DisplayObject, intersectMode:Boolean = true, accuracy:Number = 1):ICollection
Get elements by specified display object.
Parameters
displayObject:DisplayObject — a display object
| |
intersectMode:Boolean (default = true ) — whether use intersection mode. If true,
all elements intersect with display object will be selected.
| |
accuracy:Number (default = 1 ) — the accuracy used to determine whether element is hit by display object.
|
ICollection — all elements at display object located position.
|
getElementsByLocalPoint | () | method |
public function getElementsByLocalPoint(localPoint:Point, tolerance:int = -1):ICollection
Get elements at specified local position.
Parameters
localPoint:Point — the local position of network canvas.
| |
tolerance:int (default = -1 ) — location tolerance.
|
ICollection — all elements located in this position.
|
getElementsByLocalRectangle | () | method |
public function getElementsByLocalRectangle(localRect:Rectangle, intersectMode:Boolean = true, tolerance:int = -1):ICollection
Get all elements contains in specified rectangle.
Parameters
localRect:Rectangle — a local rectangle on canvas.
| |
intersectMode:Boolean (default = true ) — whether use intersection mode. If true, all
elements intersect to this rectangle will be selected.
| |
tolerance:int (default = -1 ) — location tolerance
|
ICollection — all elements contains in this rectangle.
|
getElementsByMouseEvent | () | method |
public function getElementsByMouseEvent(e:MouseEvent, tolerance:int = -1):ICollection
Get elements at mouse events specified location.
Parameters
e:MouseEvent — mouse event.
| |
tolerance:int (default = -1 ) — mouse pointer tolerance.
|
ICollection — all elements located at mouse event specified location.
|
getElementUI | () | method |
public function getElementUI(element:IElement):ElementUI
Get specified element UI object. Element UI is an object responsible for painting element body on network canvas.
Parameters
element:IElement — an element
|
ElementUI — the element UI of this element.
|
getIconsColors | () | method |
public function getIconsColors(element:IElement):Array
Get rendering colors for all attached icons of the specified element.
Parameters
element:IElement — an element
|
Array — all rendering colors for all attached icons of the specified element.
|
getIconsNames | () | method |
public function getIconsNames(element:IElement):Array
Get all attached icon names of specified element.
Parameters
element:IElement — an element to be checked.
|
Array — all attached icon names of specified element.
|
getInnerColor | () | method |
public function getInnerColor(element:IElement):Object
Get inner rendering color for specified element.
Parameters
element:IElement — an element.
|
Object — the inner rendering color for specified element.
|
getLabel | () | method |
public function getLabel(element:IElement):String
Get label text content of specified element.
Parameters
element:IElement — an element
|
String — the label text content of specified element.
|
getLayerCanvasByElement | () | method |
public function getLayerCanvasByElement(element:IElement):Canvas
Parameters
element:IElement |
Canvas |
getLinkHandlerLabel | () | method |
public function getLinkHandlerLabel(link:Link):String
Get the handler label text content of specified link.
Parameters
link:Link — a link to be checked.
|
String — the handler label text content of specified link.
|
getLogicalPoint | () | method |
public function getLogicalPoint(e:MouseEvent):Point
Get logical point of specified mouse event location. Logical point is the point considering network zoom scale.
Parameters
e:MouseEvent — a mouse event
|
Point — logical point of this mouse event location.
|
getOuterColor | () | method |
public function getOuterColor(element:IElement):Object
Get outline color of specified element.
Parameters
element:IElement — an element
|
Object — the outline color of specified element.
|
getPosition | () | method |
public function getPosition(position:String, object:Object, tarRect:Size, xOffset:Number, yOffset:Number):Point
Parameters
position:String | |
object:Object | |
tarRect:Size | |
xOffset:Number | |
yOffset:Number |
Point |
getScopeRect | () | method |
public function getScopeRect(scope:String):Rectangle
Get the specified scope rectangle. The scope parameter can be:
Parameters
scope:String — the scope name that scope will return. It can be:
|
Rectangle — scope bound of the specified scope name.
|
getSelectColor | () | method |
public function getSelectColor(element:IElement):Number
Get select color for specified element.
Parameters
element:IElement — an element
|
Number — the select color for specified element.
|
getStageRectangle | () | method |
public function getStageRectangle(localRect:Rectangle):Rectangle
Get global bounds rectangle on network root canvas for specified local rectangle.
Parameters
localRect:Rectangle — local rectangle on root canvas.
|
Rectangle — the global bounds rectangle on network root canvas.
|
getToolTip | () | method |
public function getToolTip(element:IElement):String
Get tooltip text for specified element.
Parameters
element:IElement — an element.
|
String — the tooltip text content of specified element.
|
handleElementBoxChange | () | method |
protected function handleElementBoxChange(e:DataBoxChangeEvent):void
Called when element box changed.
Parameters
e:DataBoxChangeEvent — the element box change event.
|
handleElementBoxPropertyChange | () | method |
protected function handleElementBoxPropertyChange(e:PropertyChangeEvent):void
Called when property of element box has been changed.
Parameters
e:PropertyChangeEvent — the property change event
|
handleElementPropertyChange | () | method |
protected function handleElementPropertyChange(e:PropertyChangeEvent):void
Called when element property changed.
Parameters
e:PropertyChangeEvent — the property change event
|
handleIndexChange | () | method |
protected function handleIndexChange(e:IndexChangeEvent):void
Called when element index has been changed. Element index determines the display order on network canvas.
Parameters
e:IndexChangeEvent — the element index change event.
|
handleLayerBoxChange | () | method |
protected function handleLayerBoxChange(e:DataBoxChangeEvent):void
Called when layer box is changed.
Parameters
e:DataBoxChangeEvent — the data box change event.
|
handleLayerHierarchyChange | () | method |
protected function handleLayerHierarchyChange(e:HierarchyChangeEvent):void
Called when layer hierarchy has been changed.
Parameters
e:HierarchyChangeEvent — the hierarchy change event.
|
handleLayerPropertyChange | () | method |
protected function handleLayerPropertyChange(e:PropertyChangeEvent):void
Called when any layer property has been changed.
Parameters
e:PropertyChangeEvent — the property change event
|
handleSelectionChange | () | method |
protected function handleSelectionChange(e:SelectionChangeEvent):void
Called when element selection is changed.
Parameters
e:SelectionChangeEvent — the selection change event.
|
hitsTestByMouseEvent | () | method |
public function hitsTestByMouseEvent(e:MouseEvent, tolerance:int = -1):Object
Determine which part of an Elmenet is under the mouse.
Parameters
e:MouseEvent — mouse event
| |
tolerance:int (default = -1 ) — the tolerance of the mouse point location for element selection
|
Object — the ui part of an element under the mouse. For example an attachment or the ui body of an element.
|
hitsTestByStagePoint | () | method |
public function hitsTestByStagePoint(stagePoint:Point, tolerance:int = -1):Object
Determine which part of an Elmenet is under the specified stage location.
Parameters
stagePoint:Point — the specified stage location
| |
tolerance:int (default = -1 ) — location tolerance
|
Object — the ui part of an element under the mouse. For example an attachment or the ui body of an element.
|
invalidateBackground | () | method |
public function invalidateBackground(event:* = null):void
Parameters
event:* (default = null )
|
invalidateElementIndex | () | method |
public function invalidateElementIndex():void
invalidateElementUI | () | method |
public function invalidateElementUI(element:IElement, checkAttachments:Boolean = true):void
Invalidate specified element UI. Call this to repaint the element area.
Parameters
element:IElement — an element to be invalidated.
| |
checkAttachments:Boolean (default = true ) — whether check the area of all attachments
attached on this element. Default value is true.
|
invalidateElementUIs | () | method |
public function invalidateElementUIs(checkAttachments:Boolean = true):void
Invalidate all element UIs. Call this to repaint all elements' area.
Parameters
checkAttachments:Boolean (default = true ) — whether repaint attachment area of the elements.
True will repaint, false otherwise. Default value is true.
|
invalidateElementVisibility | () | method |
public function invalidateElementVisibility():void
Call this to invalidate all element visibilities.
invalidateSelectedElementUIs | () | method |
public function invalidateSelectedElementUIs(checkAttachments:Boolean = true):void
Invalidate all selected elements' UI area. Call this to repain all selected elements' painting.
Parameters
checkAttachments:Boolean (default = true ) — true of repaint all attachments area, false otherwise.
|
isEditable | () | method |
public function isEditable(element:IElement):Boolean
Check whether the specified element is editable on this network canvas. The editable element can be resized, double-click to edit label etc. This is affected by editable filter of this network.
Parameters
element:IElement — an element to be checked.
|
Boolean — true if element is editable, false otherwise.
|
isMovable | () | method |
public function isMovable(element:IElement):Boolean
Check whether specified element is movable on network canvas. This is affected by installed movable filters.
Parameters
element:IElement — an element to be checked.
|
Boolean — true if movable, false otherwise.
|
isSelected | () | method |
public function isSelected(element:IElement):Boolean
Check whether specified element is selected on this network.
Please note that this property is not only determined by
element.selected
because network may has it's own
selection model. So this means even an element.selected is false
still may be selected in this network component.
Parameters
element:IElement — the element to be checked.
|
Boolean — true if this element is selected in this network,
false otherwise.
|
isValidMouseEvent | () | method |
public function isValidMouseEvent(e:MouseEvent):Boolean
Check whether the mouse event is a valid mouse operation event on network canvas. The mouse event occured on canvas scroll bars are considered invalid mouse event and should be ignored by network canvas.
Parameters
e:MouseEvent — a mouse event.
|
Boolean — true if this mouse event is a valid mouse event, false otherwise.
|
isVisible | () | method |
public function isVisible(element:IElement):Boolean
Whether specified element is visible. Please note element
visibility is not only decided by element.visible
property. It is also affected by the visibl filters. Use this
method to check whether element should be displayed on this
network.
Parameters
element:IElement — an element.
|
Boolean — true if visible, false invisible.
|
makeVisible | () | method |
public function makeVisible(element:IElement):void
Make specified element scroll-to-visible.
Parameters
element:IElement — the element need to visible
|
moveSelectedElements | () | method |
public function moveSelectedElements(xoffset:Number, yoffset:Number, animate:Boolean = false, finishFunction:Function = null):void
Move all selected elements from current locations to the specified offsets.
Parameters
xoffset:Number — move offset in x axis
| |
yoffset:Number — move offset in y axis
| |
animate:Boolean (default = false ) — whether move elements with animated effect. Default value is false.
| |
finishFunction:Function (default = null ) — a function will be called when the movement finished.
|
onPropertyChanged | () | method |
protected function onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called on property change.
Parameters
property:String — the property name which is changed.
| |
oldValue:Object — old value before change
| |
newValue:Object — new value after change.
|
removeInteractionListener | () | method |
public function removeInteractionListener(listener:Function):void
Remove the specified interaction listener from this network.
Parameters
listener:Function — the listener to be removed from this network.
|
removePropertyChangeListener | () | method |
public function removePropertyChangeListener(listener:Function):void
Remove specified property change listener from this view.
Parameters
listener:Function — the listener to be removed.
|
removeSelection | () | method |
public function removeSelection():ICollection
Remove all selected data from view connected data box.
ReturnsICollection — the all removed data as a collection.
|
removeSelectionChangeListener | () | method |
public function removeSelectionChangeListener(listener:Function):void
Remove data selection change listener from this view.
Parameters
listener:Function — the selection change listener to be removed.
|
selectAll | () | method |
public function selectAll():ICollection
Select all visible data of this view.
ReturnsICollection — a collection contains all selected data.
|
sendToTop | () | method |
public function sendToTop(element:IElement):void
Send specified element to canvas most front location.
Parameters
element:IElement — the element to be sent.
|
setCreateLinkInteractionHandlers | () | method |
public function setCreateLinkInteractionHandlers(linkClass:Class = null, callback:Function = null, linkType:String = null, isByControlPoint:Boolean = false, value:Number = -1, splitByPercent:Boolean = false):void
Call this to enable creating link interaction mode.
Parameters
linkClass:Class (default = null ) — the link class to be created in this interaction mode.
| |
callback:Function (default = null ) — a function that will be called when the link creation are finished.
| |
linkType:String (default = null ) — link type value of this new created link instance.
| |
isByControlPoint:Boolean (default = false ) — whether use orthogonal control point for this link.
Default value is false.
| |
value:Number (default = -1 ) — link extend value. This is like: link.setStyle(Styles.LINK_EXTEND, value)
| |
splitByPercent:Boolean (default = false ) — link split value by percent. This is like:
link.setStyle(Styles.LINK_SPLIT_BY_PERCENT,splitByPercent)
|
See also
setCreateShapeLinkInteractionHandlers | () | method |
public function setCreateShapeLinkInteractionHandlers(shapeLinkClass:Class = null):void
Call this to enable creating shape link interaction mode.
This interaction mode includes these handlers:
CreateShapeLinkInteractionHandler
and
DefaultInteractionHandler
.
Parameters
shapeLinkClass:Class (default = null ) — the shape link class to be created in this interaction mode.
Default value is null.
|
setCreateShapeNodeInteractionHandlers | () | method |
public function setCreateShapeNodeInteractionHandlers(shapeNodeClass:Class = null):void
Call this to enalbe creating shape node interaction mode.
This interaction mode includes these handlers:
CreateShapeNodeInteractionHandler
and
DefaultInteractionHandler
.
Parameters
shapeNodeClass:Class (default = null ) — the shape node class to be created in this interaction mode.
Default value is null.
|
setCurrentSubNetwork | () | method |
public function setCurrentSubNetwork(currentSubNetwork:ISubNetwork, animate:Boolean = false, finishFunction:Function = null):void
Set the subnetwork this network. Call this to drill-down network canvas into this specified subnetwork.
Parameters
currentSubNetwork:ISubNetwork — the subnetwork to drill-down.
| |
animate:Boolean (default = false ) — whether turn on animated effect for this drill-down.
Default value is false.
| |
finishFunction:Function (default = null ) — called when the drill-down is finished.
Default value is null.
|
setDefaultInteractionHandlers | () | method |
public function setDefaultInteractionHandlers(lazyMode:Boolean = false):void
Call this method to enable the default interaction handlers. The
default interaction handlers includes
SelectInteractionHandler
,
MoveInteractionHandler
and
DefaultInteractionHandler
.
Parameters
lazyMode:Boolean (default = false ) — whether turn lazy-move on for the
MoveInteractionHandler handler. Default
value is false.
|
setEditInteractionHandlers | () | method |
public function setEditInteractionHandlers(lazyMode:Boolean = false):void
Call this method to enable the edit interaction handlers.
The edit interaction handlers includes:
SelectInteractionHandler
,
EditInteractionHandler
,
MoveInteractionHandler
and
DefaultInteractionHandler
.
Parameters
lazyMode:Boolean (default = false ) — lazyMode whether turn lazy-move on for the
MoveInteractionHandler handler. Default
value is false.
|
setPanInteractionHandlers | () | method |
public function setPanInteractionHandlers():void
Call this method to enable the pan interaction handlers
The pan interaction handler include
PanInteractionHandler
.
setZoom | () | method |
public function setZoom(value:Number, animate:Boolean = false):void
Set zoom value to the specified value with animated affect.
Parameters
value:Number — the new zoom scale value.
| |
animate:Boolean (default = false ) — true means zoom animated, false otherwise. Default value is false.
|
upSubNetwork | () | method |
public function upSubNetwork(animate:Boolean = false, finishFunction:Function = null):void
Call this method to go upper layer subnetwork topology. By default, you can double click blank area on network canvas to do the same thing.
Parameters
animate:Boolean (default = false ) — whether turn on animated effect.
| |
finishFunction:Function (default = null ) — this function will be called after the animation.
You can do extra job in this function when change subnetwork finished.
Default value is null.
|
zoomIn | () | method |
public function zoomIn(animate:Boolean = false):void
Zoom in with animated effect.
Parameters
animate:Boolean (default = false ) — true with animated effect, false otherwise.
|
zoomOut | () | method |
public function zoomOut(animate:Boolean = false):void
Zoom out with animated effect.
Parameters
animate:Boolean (default = false ) — true with animated effect, false otherwise.
|
zoomOverview | () | method |
public function zoomOverview(animate:Boolean = false):void
Zoom whole network canvas area to viewport bounds so all network contents can be visible.
Parameters
animate:Boolean (default = false ) — true if with animated effect, false otherwise.
Default value is false.
|
zoomReset | () | method |
public function zoomReset(animate:Boolean = false):void
Reset zoom. This will set scale value to 1.
Parameters
animate:Boolean (default = false ) — true with animated effect, false otherwise.
|