Class DefaultEdge

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, Edge, GraphCell

    public class DefaultEdge
    extends DefaultGraphCell
    implements Edge
    A simple implementation for an edge.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object source
      Source and target of the edge.
      protected java.lang.Object target
      Source and target of the edge.
      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

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

      Constructors 
      Constructor Description
      DefaultEdge()
      Constructs an empty edge.
      DefaultEdge​(java.lang.Object userObject)
      Constructs an edge that holds a reference to the specified user object.
      DefaultEdge​(java.lang.Object userObject, AttributeMap storageMap)
      Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Create a clone of the cell.
      java.lang.Object getSource()
      Returns the source of the edge.
      java.lang.Object getTarget()
      Returns the target of the edge.
      void setSource​(java.lang.Object port)
      Sets the source of the edge.
      void setTarget​(java.lang.Object port)
      Returns the target of edge.
      • Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

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

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • source

        protected java.lang.Object source
        Source and target of the edge.
      • target

        protected java.lang.Object target
        Source and target of the edge.
    • Constructor Detail

      • DefaultEdge

        public DefaultEdge()
        Constructs an empty edge.
      • DefaultEdge

        public DefaultEdge​(java.lang.Object userObject)
        Constructs an edge that holds a reference to the specified user object.
        Parameters:
        userObject - reference to the user object
      • DefaultEdge

        public DefaultEdge​(java.lang.Object userObject,
                           AttributeMap storageMap)
        Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.
        Parameters:
        userObject - reference to the user object
    • Method Detail

      • getSource

        public java.lang.Object getSource()
        Returns the source of the edge.
        Specified by:
        getSource in interface Edge
      • getTarget

        public java.lang.Object getTarget()
        Returns the target of the edge.
        Specified by:
        getTarget in interface Edge
      • setSource

        public void setSource​(java.lang.Object port)
        Sets the source of the edge.
        Specified by:
        setSource in interface Edge
      • setTarget

        public void setTarget​(java.lang.Object port)
        Returns the target of edge.
        Specified by:
        setTarget in interface Edge
      • clone

        public java.lang.Object clone()
        Create a clone of the cell. The cloning of the user object is deferred to the cloneUserObject() method. The source and target references are set to null.
        Overrides:
        clone in class DefaultGraphCell
        Returns:
        Object a clone of this object.