Class ElementNode

  • All Implemented Interfaces:
    com.nomagic.magicdraw.grouping.GroupNode<ElementNode>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

    @OpenApi
    public class ElementNode
    extends javax.swing.tree.DefaultMutableTreeNode
    implements com.nomagic.magicdraw.grouping.GroupNode<ElementNode>, java.lang.Comparable
    Tree node which represents instance of an Element Note: children of the node often does NOT represent the owned elements of the model Element, tree model can be constructed by different criteria
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

        allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ElementNode> getChildren()  
      Element getElement()  
      ElementNode getParent()  
      boolean isExpanded()  
      boolean isInfinityNode()
      Nodes which represent recursive branches are marked as infinite nodes, meaning the rest of the infinite branch is cut off bellow this node
      boolean isReal()
      Tells if this node belongs to the model represented by the tree
      • Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

        breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.nomagic.magicdraw.grouping.GroupNode

        getChildCount, removeAllChildren
    • Method Detail

      • getElement

        @CheckForNull
        @OpenApi
        public Element getElement()
        Specified by:
        getElement in interface com.nomagic.magicdraw.grouping.GroupNode<ElementNode>
        Returns:
        model element represented by this node
      • getParent

        @OpenApi
        public ElementNode getParent()
        Specified by:
        getParent in interface javax.swing.tree.TreeNode
        Overrides:
        getParent in class javax.swing.tree.DefaultMutableTreeNode
      • getChildren

        @OpenApi
        public java.util.List<ElementNode> getChildren()
        Returns:
        direct children of this node
      • isReal

        @OpenApi
        public boolean isReal()
        Tells if this node belongs to the model represented by the tree
        Specified by:
        isReal in interface com.nomagic.magicdraw.grouping.GroupNode<ElementNode>
        Returns:
        true if this node truly belongs to the model represented by the tree
        false if this node is only a grouping node for viewing and collapsing purposes
      • isExpanded

        @OpenApi
        public boolean isExpanded()
        Returns:
        true if node is currently expanded, meaning child nodes are visible
      • isInfinityNode

        @OpenApi
        public boolean isInfinityNode()
        Nodes which represent recursive branches are marked as infinite nodes, meaning the rest of the infinite branch is cut off bellow this node
        Specified by:
        isInfinityNode in interface com.nomagic.magicdraw.grouping.GroupNode<ElementNode>
        Returns:
        true if the branch is infinitely recursive and is cut below this node.