| 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.
Implementation public function get root():INode
See 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.
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.
Parametersitem: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.
Parametersparent: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.
Parametersitem: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.
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.
Parametersitem: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.
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.
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.
Parametersitem: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.
child:INode — The child to reparent.
|
|
parent:INode — The new parent.
|
| ItemAdded | event |
com.yworks.graph.model.NodeHierarchyEvent
Event that will be triggered if an item has been added to the model.
| ItemChanged | event |
com.yworks.graph.model.NodeHierarchyEvent
Event that will be triggered if an item has changed somehow in the model.
This excludes structural changes.
| ItemMoved | event |
com.yworks.graph.model.NodeHierarchyEvent
Event that will be triggered if an item has been reparented in the model.
| ItemRemoved | event |
com.yworks.graph.model.NodeHierarchyEvent
Event that will be triggered if an item has been removed from the model.