Package org.tweetyproject.graphs.util
Class AigLink
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetColor()Returns the color associated with the element.inthashCode()booleanReturns whether the element is deletable.booleanReturns whether the label of the element is editable.voidSets the color associated with the element.voidsetDeletable(boolean deletable) Sets whether the element is deletable.voidsetLabelEditable(boolean labelEditable) Sets whether the label of the element is editable.toJson()Converts the link to a JSON-StringtoJson(boolean deletable, boolean labelEditable) Converts the link to a JSON-String while overriding the options with the given valuestoString()
-
Constructor Details
-
AigLink
Initializes a new link for the given two nodes- Parameters:
source- some nodetarget- some node
-
AigLink
Initializes a new link for the given two nodes with the label- Parameters:
source- some nodetarget- some nodelabel- some link label
-
-
Method Details
-
toJson
Converts the link to a JSON-String while overriding the options with the given values- Parameters:
deletable- whether the link should be deletablelabelEditable- whether the link label should be editable- Returns:
- JSON-String representation of this link
-
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:
trueif the element can be deleted;falseotherwise.
-
setDeletable
public void setDeletable(boolean deletable) Sets whether the element is deletable.- Parameters:
deletable-trueto allow deletion of the element;falseto prevent it.
-
isLabelEditable
public boolean isLabelEditable()Returns whether the label of the element is editable.- Returns:
trueif the label can be edited;falseotherwise.
-
setLabelEditable
public void setLabelEditable(boolean labelEditable) Sets whether the label of the element is editable.- Parameters:
labelEditable-trueto make the label editable;falseto make it read-only.
-
getColor
Returns the color associated with the element.- Returns:
- a
Stringrepresenting the color (e.g., a hex code like"#FF0000").
-
setColor
Sets the color associated with the element.- Parameters:
color- aStringrepresenting the color (e.g., a hex code like"#00FF00").
-
toString
- Overrides:
toStringin classDirectedEdge<AigNode>
-
equals
-
hashCode
public int hashCode()
-