Class AigLink


public class AigLink extends DirectedEdge<AigNode>
Representation of a link/edge in a graph. Implements and handles all options relevant for the aig-graph-component
Author:
Lars Bengel
See Also:
  • Constructor Details

    • AigLink

      public AigLink(AigNode source, AigNode target)
      Initializes a new link for the given two nodes
      Parameters:
      source - some node
      target - some node
    • AigLink

      public AigLink(AigNode source, AigNode target, String label)
      Initializes a new link for the given two nodes with the label
      Parameters:
      source - some node
      target - some node
      label - some link label
  • Method Details

    • toJson

      public String toJson(boolean deletable, boolean labelEditable)
      Converts the link to a JSON-String while overriding the options with the given values
      Parameters:
      deletable - whether the link should be deletable
      labelEditable - whether the link label should be editable
      Returns:
      JSON-String representation of this link
    • toJson

      public String toJson()
      Converts the link to a JSON-String
      Returns:
      JSON-String representation of this link
    • isDeletable

      public boolean isDeletable()
      Returns whether the element is deletable.
      Returns:
      true if the element can be deleted; false otherwise.
    • setDeletable

      public void setDeletable(boolean deletable)
      Sets whether the element is deletable.
      Parameters:
      deletable - true to allow deletion of the element; false to prevent it.
    • isLabelEditable

      public boolean isLabelEditable()
      Returns whether the label of the element is editable.
      Returns:
      true if the label can be edited; false otherwise.
    • setLabelEditable

      public void setLabelEditable(boolean labelEditable)
      Sets whether the label of the element is editable.
      Parameters:
      labelEditable - true to make the label editable; false to make it read-only.
    • getColor

      public String getColor()
      Returns the color associated with the element.
      Returns:
      a String representing the color (e.g., a hex code like "#FF0000").
    • setColor

      public void setColor(String color)
      Sets the color associated with the element.
      Parameters:
      color - a String representing the color (e.g., a hex code like "#00FF00").
    • toString

      public String toString()
      Overrides:
      toString in class DirectedEdge<AigNode>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Edge<AigNode>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Edge<AigNode>