Class InterfaceTreeNode

java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
mgui.interfaces.trees.InterfaceTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, InterfaceObjectListener, PopupMenuObject
Direct Known Subclasses:
AttributeTreeNode, DataFieldTreeNode, InterfaceNetworkTreeNode, InterfaceNeuroTreeNode, ShapeModel3DTreeNode, ShapeTreeNode, TaskTreeNode

public class InterfaceTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.lang.Cloneable, InterfaceObjectListener, PopupMenuObject
Base class for tree nodes representing ModelGUI objects (instances of InterfaceObject).
Author:
Andrew Ried
See Also:
Serialized Form
  • Field Details

    • listeners

      protected java.util.ArrayList<TreeListener> listeners
    • isDestroyed

      public boolean isDestroyed
    • isSelectable

      public boolean isSelectable
    • isMouseOverSelect

      public boolean isMouseOverSelect
    • parent_tree

      protected javax.swing.JTree parent_tree
  • Constructor Details

    • InterfaceTreeNode

      public InterfaceTreeNode()
    • InterfaceTreeNode

      public InterfaceTreeNode​(InterfaceObject thisObj)
    • InterfaceTreeNode

      public InterfaceTreeNode​(InterfaceObject thisObj, javax.swing.JTree parent)
    • InterfaceTreeNode

      public InterfaceTreeNode​(java.lang.String nodeStr)
  • Method Details

    • getChildren

      public java.util.ArrayList<javax.swing.tree.TreeNode> getChildren()
    • setParentTree

      public void setParentTree​(javax.swing.JTree tree)
    • getParentTree

      public javax.swing.JTree getParentTree()
    • insertChild

      public void insertChild​(InterfaceTreeNode node, int pos)
    • moveChild

      public void moveChild​(InterfaceTreeNode node, int pos)
    • addChild

      public void addChild​(InterfaceTreeNode node)
      Adds a child to an InterfaceTreeNode and sets its listeners. Use instead of add to ensure proper tree behaviour for InterfaceObjects.
      Parameters:
      node -
    • removeChild

      public void removeChild​(InterfaceTreeNode node)
    • destroyAllChildren

      public void destroyAllChildren()
    • isSelectable

      public boolean isSelectable()
    • setSelectable

      public void setSelectable​(boolean s)
    • containsObject

      public boolean containsObject​(java.lang.Object o)
    • setUserObject

      public void setUserObject​(InterfaceObject thisObj)
    • isDestroyed

      public boolean isDestroyed()
    • destroy

      public void destroy()
    • destroy

      public void destroy​(boolean fire)
    • init

      public void init()
    • objectChanged

      public void objectChanged()
    • objectChanged

      public void objectChanged​(InterfaceObject object)
      Specified by:
      objectChanged in interface InterfaceObjectListener
    • clone

      public java.lang.Object clone()
      Overrides:
      clone in class javax.swing.tree.DefaultMutableTreeNode
    • addListener

      public void addListener​(TreeListener l)
    • removeListener

      public void removeListener​(TreeListener l)
    • fireTreeListeners

      protected void fireTreeListeners​(TreeEvent e)
    • setPopupMenu

      public void setPopupMenu​(InterfacePopupMenu menu)
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu()
      Description copied from interface: PopupMenuObject
      Produces and returns a popup menu for this object.
      Specified by:
      getPopupMenu in interface PopupMenuObject
      Returns:
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu​(java.util.List<java.lang.Object> selection)
      Description copied from interface: PopupMenuObject
      Produces and returns a popup menu for this object. Allows an associated list of objects to be passed as an argument.
      Specified by:
      getPopupMenu in interface PopupMenuObject
      Returns:
    • handlePopupEvent

      public void handlePopupEvent​(java.awt.event.ActionEvent e)
      Description copied from interface: PopupMenuObject
      Handles an event on this object's popup menu.
      Specified by:
      handlePopupEvent in interface PopupMenuObject
    • handleMouseEvent

      public void handleMouseEvent​(java.awt.event.MouseEvent e, InterfaceTree tree)
    • showPopupMenu

      public void showPopupMenu​(java.awt.event.MouseEvent e)
      Description copied from interface: PopupMenuObject
      Shows a popup menu at the point of the given MouseEvent.
      Specified by:
      showPopupMenu in interface PopupMenuObject