Class Edge

  • All Implemented Interfaces:
    org.eclipse.gef.common.attributes.IAttributeStore

    public class Edge
    extends java.lang.Object
    implements org.eclipse.gef.common.attributes.IAttributeStore
    An Edge represents a (directed) connection between two Nodes in a Graph.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Edge.Builder
      The Edge.Builder can be used to construct an Edge little by little.
    • Field Summary

      • Fields inherited from interface org.eclipse.gef.common.attributes.IAttributeStore

        ATTRIBUTES_PROPERTY
    • Constructor Summary

      Constructors 
      Constructor Description
      Edge​(java.util.Map<java.lang.String,​java.lang.Object> attributes, Node source, Node target)
      Constructs a new Edge which connects the given source Node with the given target Node.
      Edge​(Node source, Node target)
      Constructs a new Edge which connects the given source Node with the given target Node.
    • Constructor Detail

      • Edge

        public Edge​(java.util.Map<java.lang.String,​java.lang.Object> attributes,
                    Node source,
                    Node target)
        Constructs a new Edge which connects the given source Node with the given target Node. The given attributesProperty are copied into the attributesProperty map of this Edge .
        Parameters:
        attributes - A Map containing the attributesProperty which are copied into the attributesProperty map of this Edge.
        source - The source Node for this Edge.
        target - The target Node for this Edge.
      • Edge

        public Edge​(Node source,
                    Node target)
        Constructs a new Edge which connects the given source Node with the given target Node.
        Parameters:
        source - The source Node for this Edge.
        target - The target Node for this Edge.
    • Method Detail

      • attributesProperty

        public javafx.beans.property.ReadOnlyMapProperty<java.lang.String,​java.lang.Object> attributesProperty()
        Specified by:
        attributesProperty in interface org.eclipse.gef.common.attributes.IAttributeStore
      • getAttributes

        public javafx.collections.ObservableMap<java.lang.String,​java.lang.Object> getAttributes()
        Specified by:
        getAttributes in interface org.eclipse.gef.common.attributes.IAttributeStore
      • getGraph

        public Graph getGraph()
        Returns the Graph to which this Edge belongs.
        Returns:
        The Graph to which this Edge belongs.
      • getSource

        public Node getSource()
        Returns the source Node of this Edge.
        Returns:
        The source Node of this Edge.
      • getTarget

        public Node getTarget()
        Returns the target Node of this Edge.
        Returns:
        The target Node of this Edge.
      • setSource

        public void setSource​(Node source)
        Sets the source Node of this Edge to the given value.
        Parameters:
        source - The new source Node for this Edge.
      • setTarget

        public void setTarget​(Node target)
        Sets the target Node of this Edge to the given value.
        Parameters:
        target - The new target Node for this Edge.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object