Class AigNode
java.lang.Object
org.tweetyproject.graphs.util.AigNode
- All Implemented Interfaces:
Comparable<AigNode>,Node
Representation of a node 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 TypeMethodDescriptionintbooleangetColor()Returns the color associated with this node.intgetId()Returns the unique identifier of this node.getName()Returns the name of this node.intgetX()Returns the x-coordinate of this node.intgetY()Returns the Y-coordinate of this node.inthashCode()booleanChecks whether outgoing links are allowed for this node.booleanChecks whether this node is deletable.booleanReturns whether the X position of this node is fixed.booleanChecks whether the Y position of this node is fixed.booleanChecks whether the label of this node is editable.voidsetAllowOutgoingLinks(boolean allowOutgoingLinks) Sets whether this node is allowed to have outgoing links.voidSets the color of this node.voidsetDeletable(boolean deletable) Sets whether this node can be deleted.voidsetFixedPositionX(boolean fixedPositionX) Sets the X position of this node is.voidsetFixedPositionY(boolean fixedPositionY) Sets whether the Y position of this node is fixed.voidsetLabelEditable(boolean labelEditable) Sets whether the label of this node is editable.voidSets the name of this node.voidsetX(int x) Sets the x-coordinate of this node.voidsetY(int y) Sets the y-coordinate of this node.toJson()Converts the node to a JSON-StringtoJson(boolean deletable, boolean labelEditable, boolean fixedPositionX, boolean fixedPositionY) Converts the node to a JSON-String while overriding the options with the given valuestoString()
-
Constructor Details
-
AigNode
Initializes a new node with the given ID and label- Parameters:
id- unique identifier of this nodename- some node label
-
AigNode
Initializes a new node for the given ID and Node- Parameters:
id- unique identifier of this nodenode- some node
-
-
Method Details
-
toJson
public String toJson(boolean deletable, boolean labelEditable, boolean fixedPositionX, boolean fixedPositionY) Converts the node to a JSON-String while overriding the options with the given values- Parameters:
deletable- whether the node should be deletablelabelEditable- whether the node label should be editablefixedPositionX- whether the X position should be fixedfixedPositionY- whether the Y position should be fixed- Returns:
- JSON-String representation of this node
-
toJson
Converts the node to a JSON-String- Returns:
- JSON-String representation of this node
-
getId
public int getId()Returns the unique identifier of this node.- Returns:
- the id of this node
-
getName
-
setName
Sets the name of this node.- Parameters:
name- the new name to assign to this node
-
getX
public int getX()Returns the x-coordinate of this node.- Returns:
- the x-coordinate value
-
setX
public void setX(int x) Sets the x-coordinate of this node.- Parameters:
x- the new x-coordinate value to set
-
getY
public int getY()Returns the Y-coordinate of this node.- Returns:
- the Y-coordinate value.
-
setY
public void setY(int y) Sets the y-coordinate of this node.- Parameters:
y- the new y-coordinate value to set
-
getColor
Returns the color associated with this node.- Returns:
- the color of this node as a String
-
setColor
Sets the color of this node.- Parameters:
color- the new color to assign to this node
-
isDeletable
public boolean isDeletable()Checks whether this node is deletable.- Returns:
trueif the node can be deleted;falseotherwise.
-
setDeletable
public void setDeletable(boolean deletable) Sets whether this node can be deleted.- Parameters:
deletable-trueif the node should be deletable;falseotherwise
-
isLabelEditable
public boolean isLabelEditable()Checks whether the label of this node is editable.- Returns:
trueif the label can be edited;falseotherwise.
-
setLabelEditable
public void setLabelEditable(boolean labelEditable) Sets whether the label of this node is editable.- Parameters:
labelEditable- true if the label should be editable, false otherwise
-
isAllowOutgoingLinks
public boolean isAllowOutgoingLinks()Checks whether outgoing links are allowed for this node.- Returns:
trueif outgoing links are permitted;falseotherwise.
-
setAllowOutgoingLinks
public void setAllowOutgoingLinks(boolean allowOutgoingLinks) Sets whether this node is allowed to have outgoing links.- Parameters:
allowOutgoingLinks- true to allow outgoing links from this node, false otherwise
-
isFixedPositionX
public boolean isFixedPositionX()Returns whether the X position of this node is fixed.- Returns:
trueif the X position is fixed;falseotherwise.
-
setFixedPositionX
public void setFixedPositionX(boolean fixedPositionX) Sets the X position of this node is.- Parameters:
fixedPositionX- true if the X position should be fixed, false otherwise
-
isFixedPositionY
public boolean isFixedPositionY()Checks whether the Y position of this node is fixed.- Returns:
trueif the Y position is fixed;falseotherwise.
-
setFixedPositionY
public void setFixedPositionY(boolean fixedPositionY) Sets whether the Y position of this node is fixed.- Parameters:
fixedPositionY- true if the Y position should be fixed; false otherwise
-
toString
-
equals
-
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<AigNode>
-