Class GraphEdge

java.lang.Object
com.codename1.graph.GraphEdge

public class GraphEdge extends Object
A connection from one node to another, optionally from a port to a port.
  • Constructor Details

    • GraphEdge

      public GraphEdge(String id, String sourceId, String targetId)
      An edge between two nodes.
    • GraphEdge

      public GraphEdge(String id, String sourceId, String sourcePortId, String targetId, String targetPortId)
      An edge between two ports. Either port id may be null to attach to the node itself.
  • Method Details

    • getId

      public String getId()
      The id, unique within the model.
    • getSourceId

      public String getSourceId()
      The id of the node the edge leaves.
    • getSourcePortId

      public String getSourcePortId()
      The id of the output port the edge leaves, or null.
    • getTargetId

      public String getTargetId()
      The id of the node the edge enters.
    • getTargetPortId

      public String getTargetPortId()
      The id of the input port the edge enters, or null.
    • getLabel

      public String getLabel()
      The text painted at the middle of the edge, or null.
    • setLabel

      public void setLabel(String label)
      Sets the label.
    • isDirected

      public boolean isDirected()
      True, the default, when the edge is painted with an arrowhead.
    • setDirected

      public void setDirected(boolean directed)
      Paints the edge with or without an arrowhead.
    • getStyleKey

      public String getStyleKey()
      A key a renderer may map to a colour or a dash, or null.
    • setStyleKey

      public void setStyleKey(String styleKey)
      Sets the style key.
    • getUserData

      public Object getUserData()
      Anything the application keeps with the edge.
    • setUserData

      public void setUserData(Object userData)
      Sets the application's data.
    • getRoute

      public double[] getRoute()
      The bend points an arrangement routed the edge through, as x, y pairs in world units, or null for a direct line between its ends.
    • setRoute

      public void setRoute(double[] route)
      Sets the bend points; null removes them.
    • touches

      public boolean touches(String nodeId)
      True when the edge touches the node with this id.