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 TypeMethodDescriptionint
boolean
getColor()
Returns the color associated with this node.int
getId()
Returns the unique identifier of this node.getName()
Returns the name of this node.int
getX()
Returns the x-coordinate of this node.int
getY()
Returns the Y-coordinate of this node.int
hashCode()
boolean
Checks whether outgoing links are allowed for this node.boolean
Checks whether this node is deletable.boolean
Returns whether the X position of this node is fixed.boolean
Checks whether the Y position of this node is fixed.boolean
Checks whether the label of this node is editable.void
setAllowOutgoingLinks
(boolean allowOutgoingLinks) Sets whether this node is allowed to have outgoing links.void
Sets the color of this node.void
setDeletable
(boolean deletable) Sets whether this node can be deleted.void
setFixedPositionX
(boolean fixedPositionX) Sets the X position of this node is.void
setFixedPositionY
(boolean fixedPositionY) Sets whether the Y position of this node is fixed.void
setLabelEditable
(boolean labelEditable) Sets whether the label of this node is editable.void
Sets the name of this node.void
setX
(int x) Sets the x-coordinate of this node.void
setY
(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:
true
if the node can be deleted;false
otherwise.
-
setDeletable
public void setDeletable(boolean deletable) Sets whether this node can be deleted.- Parameters:
deletable
-true
if the node should be deletable;false
otherwise
-
isLabelEditable
public boolean isLabelEditable()Checks whether the label of this node is editable.- Returns:
true
if the label can be edited;false
otherwise.
-
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:
true
if outgoing links are permitted;false
otherwise.
-
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:
true
if the X position is fixed;false
otherwise.
-
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:
true
if the Y position is fixed;false
otherwise.
-
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:
compareTo
in interfaceComparable<AigNode>
-