Class AbstractTree

All Implemented Interfaces:
FocusListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
Tree

@OpenApi public abstract class AbstractTree extends ExtendedPanel
The abstract tree used in MagicDraw browser. This class is used as wrapper for Swing JTree. To access actual Swing tree, use method getTree().
See Also:
  • Field Details

    • MAX_AUTO_EXPAND_DEPTH

      public static final int MAX_AUTO_EXPAND_DEPTH
      Max depth for auto expand in case we have very deep or recursive model structure
      See Also:
  • Constructor Details

    • AbstractTree

      public AbstractTree(JTree tree)
  • Method Details

    • getTree

      @OpenApi public final JTree getTree()
      Returns wrapped Swing JTree.
      Returns:
      wrapped tree.
    • setTree

      protected final void setTree(JTree tree)
    • getTreeModel

      @CheckForNull public DefaultTreeModel getTreeModel()
    • getRootNode

      @OpenApi public DefaultMutableTreeNode getRootNode()
      Returns root node of the tree.
      Returns:
      root node.
    • openPath

      public void openPath(TreePath path)
      Open node.
      Parameters:
      path - TreePath
    • openPath

      public void openPath(TreePath path, boolean select, boolean appendSelection, boolean requestFocus)
      Open node.
      Parameters:
      path - TreePath
      select - do we need to select?
      appendSelection - append to old selection or clear old selection
      requestFocus - do we need to request focus?
    • openPath

      public void openPath(TreePath path, boolean select, boolean appendSelection, boolean requestFocus, boolean scrollToVisible)
      Open node.
      Parameters:
      path - TreePath
      select - do we need to select?
      appendSelection - append to old selection or clear old selection
      requestFocus - do we need to request focus?
      scrollToVisible - do we need to scroll to visible?
    • open

      @OpenApi public void open()
      Activates or opens (if was closed) this tree in the UI.
    • close

      public void close()
      Closed this tree in the UI.
    • getCookies

      public CookieSet getCookies()
    • getScrollPane

      public JScrollPane getScrollPane()
      Returns:
      scroll pane of the tree
    • dispose

      public void dispose()
    • doubleClick

      protected void doubleClick(DefaultMutableTreeNode node, MouseEvent mouseEvent)
      called on mouse double click on nod.
      Parameters:
      node - node on which double click was called.
      mouseEvent - double click event
    • isAutoExpandMode

      public boolean isAutoExpandMode()
      Returns:
      auto expand mode. If true, nodes with single child are expanded recursively.
    • setAutoExpandMode

      public void setAutoExpandMode(boolean autoExpandMode)
      Sets auto expand mode. If auto expand, nodes with single child are expanded recursively
      Parameters:
      autoExpandMode - new mode value