com.ur.urcap.api.domain.program.structure
public interface TreeNode
ProgramModel.getRootTreeNode(ProgramNodeContribution)
to obtain a root for the sub-tree, it is possible to add children.
For each call to addChild(ProgramNode)
, a new TreeNode
is returned, that can, in turn, act as a root for yet another sub-tree.Modifier and Type | Method and Description |
---|---|
TreeNode |
addChild(ProgramNode programNode)
Add a child to this TreeNode
|
List<TreeNode> |
getChildren() |
ProgramNode |
getProgramNode() |
TreeNode |
insertChildAfter(TreeNode existingChildNode,
ProgramNode programNode)
Inserts a child under this TreeNode directly after the existing selected child node.
|
TreeNode |
insertChildBefore(TreeNode existingChildNode,
ProgramNode programNode)
Inserts a child under this TreeNode directly before the existing selected child node.
|
boolean |
removeChild(TreeNode child)
Removes a child from the sub-tree.
|
TreeNode |
setChildSequenceLocked(boolean isChildSequenceLocked)
Means that the children can not be rearranged, deleted or have other nodes inserted into the child sequence by the end user.
|
TreeNode addChild(ProgramNode programNode) throws TreeStructureException
programNode
- the ProgramNode
constructed using the ProgramNodeFactory
TreeStructureException
- If it is not allowed to insert the ProgramNode
at this position a TreeStructureException
will be thrown.TreeNode insertChildBefore(TreeNode existingChildNode, ProgramNode programNode) throws TreeStructureException
existingChildNode
- existing TreeNode child of this TreeNodeprogramNode
- the ProgramNode
constructed using the ProgramNodeFactory
TreeStructureException
- If it is not allowed to insert the ProgramNode
at this position or if the selected child node is not a child of this TreeNode a TreeStructureException
will be thrown.TreeNode insertChildAfter(TreeNode existingChildNode, ProgramNode programNode) throws TreeStructureException
existingChildNode
- existing TreeNode child of this TreeNodeprogramNode
- the ProgramNode
constructed using the ProgramNodeFactory
TreeStructureException
- If it is not allowed to insert the ProgramNode
at this position or if the selected child node is not a child of this TreeNode a TreeStructureException
will be thrown.boolean removeChild(TreeNode child) throws TreeStructureException
child
- The TreeNode child to be removed.TreeStructureException
- If the removed child would leave the tree in an illegal state a TreeStructureException
will be thrown.List<TreeNode> getChildren()
ProgramNode getProgramNode()
ProgramNode
at this position in the sub-tree.
Can either be a built-in PolyScope program node (provided by Universal Robots) or a URCap program node.TreeNode setChildSequenceLocked(boolean isChildSequenceLocked)
isChildSequenceLocked
- If true then the immediate children under this TreeNode will be lockedCopyright © 2017. All rights reserved.