Class TreeState


  • public class TreeState
    extends java.lang.Object
    The tree structure state of a work cell.

    The tree structure state gives access to the parent and child frames of a
    frame.

    Currently modification of the tree structure is not supported. (This
    implementation simply forwards to the non-public Tree data structure.)

    Tree structure states can be copied and assigned freely.
    • Constructor Detail

      • TreeState

        public TreeState​(long cPtr,
                         boolean cMemoryOwn)
      • TreeState

        public TreeState()
        Construct an empty TreeState
      • TreeState

        public TreeState​(StateSetupPtr setup)
        Construct an empty TreeState
      • TreeState

        public TreeState​(TreeState other)
        Copy constructor.
        Parameters:
        other - [in] other TreeState to copy.
    • Method Detail

      • getCPtr

        public static long getCPtr​(TreeState obj)
      • delete

        public void delete()
      • getParent

        public Frame getParent​(FrameCPtr frame)
        The parent frame of frame.

        If the frame has no parent, then NULL is returned.

        (We should query the modifiable part of the tree here, but that is
        not implemented yet.)

        Parameters:
        frame - [in] The frame for which to retrieve the parent.

        Returns:
        The parent of the frame or NULL if the frame has no parent.
      • getChildren

        public FrameVector getChildren​(FrameCPtr frame)
        The child frames of frame.

        (We should query the modifiable part of the tree here, but that is
        not implemented yet.)

        Note that we break const-correctness. We treat TreeState as an
        implementation detail upon which an iterator interface in Frame is
        then built.

        Parameters:
        frame - [in] The frame for which to retrieve the children.

        Returns:
        The children of the frame if any children exist, else NULL.
      • attachFrame

        public void attachFrame​(FramePtr frame,
                                FramePtr parent)
        Move a frame within the tree.

        The frame frame is detached from its parent and reattached to
        parent. The frames frame and parent must both belong to the
        same tree.

        We may want to later restrict this method so that only frames of
        certain types can be moved.

        Parameters:
        frame - [in] The frame to move.
        parent - [in] The frame to attach frame to.
      • getStateSetup

        public StateSetupPtr getStateSetup()
        gets the StateSetup used to create the TreeState
        Returns:
        the StateSetup