| Package | com.yworks.graph.model |
| Interface | public interface INodeHierarchy extends flash.events.IEventDispatcher, ILookup |
| Implementors | DefaultNodeHierarchy |
| Property | Defined By | ||
|---|---|---|---|
| root : INode [read-only]
Gets the root node of the hierarchy. | INodeHierarchy | ||
| Method | Defined By | ||
|---|---|---|---|
Modifies the hierarchy by adding another child to the given parent. | INodeHierarchy | ||
Determines whether the given node is part of this hierarchy. | INodeHierarchy | ||
getChildCount(parent:INode):int
Returns the number of children for the given parent item. | INodeHierarchy | ||
Returns an iterable over the children of the provided item. | INodeHierarchy | ||
Returns the parent item of the item or root
if child is a top-level item. | INodeHierarchy | ||
Returns whether the given item is considered a leaf item. | INodeHierarchy | ||
![]() | lookup(type:Class):Object
Returns an instance that implements the given type or null. | ILookup | |
publishItemChanged(item:INode):void
Triggers the firing of an itemChanged event for the given node. | INodeHierarchy | ||
Removes the given item from its parent and this hierarchy. | INodeHierarchy | ||
Determines whether the given item should be considered a leaf. | INodeHierarchy | ||
Reparents a child item that already belongs to this hierarchy instance
to a new parent. | INodeHierarchy | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Event that will be triggered if an item has been added to the model. | INodeHierarchy | |||
| Event that will be triggered if an item has changed somehow in the model. | INodeHierarchy | |||
| Event that will be triggered if an item has been reparented in the model. | INodeHierarchy | |||
| Event that will be triggered if an item has been removed from the model. | INodeHierarchy | |||
| root | property |
root:INode [read-only] Gets the root node of the hierarchy.
public function get root():INodeSee also
| addChild | () | method |
public function addChild(parent:INode, child:INode):voidModifies the hierarchy by adding another child to the given parent.
child may not be part of the hierarchy prior to this call.
This triggers the itemAdded event.
Parameters
parent:INode — The parent to add the child to.
| |
child:INode — The child to add to the parent.
|
| contains | () | method |
public function contains(item:INode):BooleanDetermines whether the given node is part of this hierarchy.
Parameters
item:INode — The node to check
|
Boolean — Whether the node is contained in the hierarchy.
|
| getChildCount | () | method |
public function getChildCount(parent:INode):intReturns the number of children for the given parent item.
Parameters
parent:INode — The parent to get the number of child items for.
|
int — The number of children.
|
See also
| getChildren | () | method |
public function getChildren(item:INode):IterableReturns an iterable over the children of the provided item.
Parameters
item:INode — The item for which to return the children.
|
Iterable — All items that have item as their parent.
|
See also
| getParent | () | method |
public function getParent(child:INode):INode
Returns the parent item of the item or root
if child is a top-level item.
Parameters
child:INode — The item to retrieve the parent item for.
|
INode — The parent item in this hierarchy or root.
|
| isLeaf | () | method |
public function isLeaf(item:INode):BooleanReturns whether the given item is considered a leaf item.
Leaves may not have children. However, a non-leaf item does not necessarily need to have children.
Parameters
item:INode — The item to check.
|
Boolean — Whether the item is considered a leaf.
|
See also
| publishItemChanged | () | method |
public function publishItemChanged(item:INode):void
Triggers the firing of an itemChanged event for the given node.
Parameters
item:INode — The item that has changed.
|
| remove | () | method |
public function remove(child:INode):voidRemoves the given item from its parent and this hierarchy.
This will trigger the itemRemoved event.
Parameters
child:INode — The child to remove from this hierarchy.
|
| setLeaf | () | method |
public function setLeaf(item:INode, leaf:Boolean):voidDetermines whether the given item should be considered a leaf.
Leaves may not have children. However, a non-leaf item does not necessarily need to have children.
Parameters
item:INode — The item to set.
| |
leaf:Boolean — Whether to make the item a leaf.
|
See also
| setParent | () | method |
public function setParent(child:INode, parent:INode):voidReparents a child item that already belongs to this hierarchy instance to a new parent.
This will trigger the itemMoved event.
Note that child may not be an ancestor of parent.
Parameters
child:INode — The child to reparent.
| |
parent:INode — The new parent.
|
| ItemAdded | Event |
com.yworks.graph.model.NodeHierarchyEventcom.yworks.graph.model.NodeHierarchyEvent.ITEM_ADDEDEvent that will be triggered if an item has been added to the model.
Event that will be triggered if an item has been added to a hierarchy model.| ItemChanged | Event |
com.yworks.graph.model.NodeHierarchyEventcom.yworks.graph.model.NodeHierarchyEvent.ITEM_CHANGEDEvent that will be triggered if an item has changed somehow in the model.
This excludes structural changes.
Event that will be triggered if an item has changed somehow in a hierarchy model.| ItemMoved | Event |
com.yworks.graph.model.NodeHierarchyEventcom.yworks.graph.model.NodeHierarchyEvent.ITEM_MOVEDEvent that will be triggered if an item has been reparented in the model.
Event that will be triggered if an item has been reparented in a hierarchy model.| ItemRemoved | Event |
com.yworks.graph.model.NodeHierarchyEventcom.yworks.graph.model.NodeHierarchyEvent.ITEM_REMOVEDEvent that will be triggered if an item has been removed from the model.
Event that will be triggered if an item has been removed from a hierarchy model.