java.lang.Object
org.tweetyproject.graphs.util.AigGraphPlotter<G,N>
- Direct Known Subclasses:
AigSerialisationPlotter
-
Constructor Summary
ConstructorsConstructorDescriptionAigGraphPlotter
(G graph) Initializes a new instance of the graph plotter for the given graph -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Utility method that converts a String into a LaTeX-math stringReturns the color associated with the specified node.getColor
(GeneralEdge<? extends N> link) Returns the color associated with the specified edge in the graph.boolean
isDeletable
(N node) Determines whether the specified node is deletable.boolean
isDeletable
(GeneralEdge<? extends N> link) Determines whether the specified edge can be deleted from the graph.boolean
isLabelEditable
(N node) Determines whether the label of the specified node is editable.boolean
isLabelEditable
(GeneralEdge<? extends N> link) Determines whether the label of the specified edge is editable.boolean
isNodeFixedPositionX
(N node) Checks whether the specified node has a fixed X position.boolean
isNodeFixedPositionY
(N node) Checks whether the Y position of the specified node is fixed.void
makeLeveled
(N root) ensures that the graph nodes are positioned in levels depending on their distance to the given root nodevoid
Sets the color of the specified node in the graph.void
setColor
(GeneralEdge<? extends N> link, String color) Sets the color of the specified edge in the graph.void
setDeletable
(N node, boolean nodeDeletable) Sets whether the specified node is deletable.void
setDeletable
(GeneralEdge<? extends N> link, boolean linkDeletable) Sets whether the specified link (edge) in the graph is deletable.void
setEnableLatex
(boolean enableLatex) Aktiviert oder deaktiviert die Verwendung von LaTeX zur Darstellung von Formeln oder Text.void
setLabelEditable
(N node, boolean labelEditable) Sets whether the label of the specified node is editable.void
setLabelEditable
(GeneralEdge<? extends N> link, boolean labelEditable) Sets whether the label of the specified edge is editable.void
setLinkColor
(String color) Sets the color of all links in the graph to the specified color.void
setLinkDeletable
(boolean linkDeletable) Sets the deletable status for all links in the graph.void
setLinkLabelEditable
(boolean labelEditable) Sets the editability of the labels for all links in the graph.void
setNodeColor
(String color) Sets the color of all nodes in the graph to the specified color.void
setNodeDeletable
(boolean nodeDeletable) Sets the deletable status for all nodes in the graph.void
setNodeFixedPositionX
(boolean fixedPositionX) Sets whether the X position of all nodes in the graph should be fixed.void
setNodeFixedPositionX
(N node, boolean fixedPositionX) Sets whether the X position of the specified node should be fixed.void
setNodeFixedPositionY
(boolean fixedPositionY) Sets whether the Y position of all nodes in the graph should be fixed.void
setNodeFixedPositionY
(N node, boolean fixedPositionY) Sets whether the Y position of the specified node should be fixed.void
setNodeLabelEditable
(boolean labelEditable) Sets whether the labels of all nodes in the graph are editable.void
setNodePositionX
(N node, int positionX) Sets the X-coordinate position for the specified node in the graph.void
setNodePositionY
(N node, int positionY) Sets the Y-coordinate position for the specified node in the graph.void
setToggleFixedLinkDistance
(boolean toggleFixedLinkDistance) Aktiviert oder deaktiviert eine feste Kantenlänge im Graphenlayout.void
setToggleGraphEditingInGUI
(boolean toggleGraphEditingInGUI) Aktiviert oder deaktiviert die Möglichkeit zur Bearbeitung des Graphen über die Benutzeroberfläche.void
setToggleLinkLabels
(boolean toggleLinkLabels) Aktiviert oder deaktiviert die Anzeige von Kantentexten im Graphen.void
setToggleNodeLabels
(boolean toggleNodeLabels) Aktiviert oder deaktiviert die Anzeige von Knotentexten im Graphen.void
setToggleNodePhysics
(boolean toggleNodePhysics) Aktiviert oder deaktiviert die Physiksimulation für Knoten im Graphen.void
setToggleZoom
(boolean toggleZoom) Aktiviert oder deaktiviert die Zoom-Funktionalität im Graph.void
show()
Renders the graph in the web browser via the aig-graph-componentstatic void
Renders the given graph in the web browser via the aig-graph-componentwrite()
Creates a JSON-String for the graph in the aig-graph formatstatic String
Creates a JSON-String for the given graph in the aig-graph format
-
Constructor Details
-
AigGraphPlotter
Initializes a new instance of the graph plotter for the given graph- Parameters:
graph
- some graph
-
-
Method Details
-
write
-
write
Creates a JSON-String for the graph in the aig-graph format- Returns:
- JSON-String representation of the graph
-
makeLeveled
ensures that the graph nodes are positioned in levels depending on their distance to the given root node- Parameters:
root
- origin node
-
show
-
show
public void show()Renders the graph in the web browser via the aig-graph-component -
convert
-
setEnableLatex
public void setEnableLatex(boolean enableLatex) Aktiviert oder deaktiviert die Verwendung von LaTeX zur Darstellung von Formeln oder Text.- Parameters:
enableLatex
-true
, um LaTeX-Darstellung zu aktivieren;false
, um sie zu deaktivieren.
-
setToggleZoom
public void setToggleZoom(boolean toggleZoom) Aktiviert oder deaktiviert die Zoom-Funktionalität im Graph.- Parameters:
toggleZoom
-true
, um Zoom zu aktivieren;false
, um Zoom zu deaktivieren.
-
setToggleNodePhysics
public void setToggleNodePhysics(boolean toggleNodePhysics) Aktiviert oder deaktiviert die Physiksimulation für Knoten im Graphen.- Parameters:
toggleNodePhysics
-true
, um Physiksimulation zu aktivieren;false
, um sie zu deaktivieren.
-
setToggleFixedLinkDistance
public void setToggleFixedLinkDistance(boolean toggleFixedLinkDistance) Aktiviert oder deaktiviert eine feste Kantenlänge im Graphenlayout.- Parameters:
toggleFixedLinkDistance
-true
, um eine feste Kantenlänge zu verwenden;false
, um sie dynamisch zu lassen.
-
setToggleGraphEditingInGUI
public void setToggleGraphEditingInGUI(boolean toggleGraphEditingInGUI) Aktiviert oder deaktiviert die Möglichkeit zur Bearbeitung des Graphen über die Benutzeroberfläche.- Parameters:
toggleGraphEditingInGUI
-true
, um die Bearbeitung im GUI zu erlauben;false
, um sie zu deaktivieren.
-
setToggleNodeLabels
public void setToggleNodeLabels(boolean toggleNodeLabels) Aktiviert oder deaktiviert die Anzeige von Knotentexten im Graphen.- Parameters:
toggleNodeLabels
-true
, um Knotentexte anzuzeigen;false
, um sie auszublenden.
-
setToggleLinkLabels
public void setToggleLinkLabels(boolean toggleLinkLabels) Aktiviert oder deaktiviert die Anzeige von Kantentexten im Graphen.- Parameters:
toggleLinkLabels
-true
, um Kantentexte anzuzeigen;false
, um sie auszublenden.
-
setDeletable
Sets whether the specified node is deletable.- Parameters:
node
- the node whose deletable status is to be setnodeDeletable
-true
if the node should be deletable;false
otherwise
-
setNodeDeletable
public void setNodeDeletable(boolean nodeDeletable) Sets the deletable status for all nodes in the graph.This method iterates over all nodes and updates their deletable property according to the specified value.
- Parameters:
nodeDeletable
-true
if nodes should be deletable;false
otherwise
-
isDeletable
Determines whether the specified node is deletable.- Parameters:
node
- the node to check for deletability- Returns:
true
if the node is deletable;false
otherwise
-
setLabelEditable
Sets whether the label of the specified node is editable.- Parameters:
node
- the node whose label editability is to be setlabelEditable
-true
if the label should be editable;false
otherwise
-
setNodeLabelEditable
public void setNodeLabelEditable(boolean labelEditable) Sets whether the labels of all nodes in the graph are editable.- Parameters:
labelEditable
-true
if node labels should be editable;false
otherwise.
-
isLabelEditable
Determines whether the label of the specified node is editable.- Parameters:
node
- the node whose label editability is to be checked- Returns:
true
if the label of the node is editable;false
otherwise
-
setNodeFixedPositionX
Sets whether the X position of the specified node should be fixed.- Parameters:
node
- the node whose X position fixed state is to be setfixedPositionX
-true
to fix the X position of the node,false
to allow it to move
-
setNodeFixedPositionX
public void setNodeFixedPositionX(boolean fixedPositionX) Sets whether the X position of all nodes in the graph should be fixed.- Parameters:
fixedPositionX
-true
to fix the X position of all nodes,false
to allow movement.
-
isNodeFixedPositionX
Checks whether the specified node has a fixed X position.- Parameters:
node
- the node to check- Returns:
true
if the node has a fixed X position;false
otherwise
-
setNodeFixedPositionY
Sets whether the Y position of the specified node should be fixed.- Parameters:
node
- the node whose Y position fixed status is to be setfixedPositionY
-true
to fix the Y position of the node,false
to allow it to move
-
setNodeFixedPositionY
public void setNodeFixedPositionY(boolean fixedPositionY) Sets whether the Y position of all nodes in the graph should be fixed.- Parameters:
fixedPositionY
-true
to fix the Y position of all nodes,false
to allow movement.
-
isNodeFixedPositionY
Checks whether the Y position of the specified node is fixed.- Parameters:
node
- the node to check- Returns:
true
if the Y position of the node is fixed;false
otherwise
-
setNodePositionX
Sets the X-coordinate position for the specified node in the graph.- Parameters:
node
- the node whose X position is to be setpositionX
- the X-coordinate value to assign to the node
-
setNodePositionY
Sets the Y-coordinate position for the specified node in the graph.- Parameters:
node
- the node whose Y position is to be setpositionY
- the Y-coordinate value to assign to the node
-
setDeletable
Sets whether the specified link (edge) in the graph is deletable.- Parameters:
link
- the edge whose deletable status is to be setlinkDeletable
-true
if the link should be deletable;false
otherwise
-
setLinkDeletable
public void setLinkDeletable(boolean linkDeletable) Sets the deletable status for all links in the graph.This method iterates over all links and updates their deletable property according to the specified value.
- Parameters:
linkDeletable
-true
if the links should be deletable;false
otherwise.
-
isDeletable
Determines whether the specified edge can be deleted from the graph.- Parameters:
link
- the edge to check for deletability- Returns:
true
if the edge is deletable;false
otherwise
-
setLabelEditable
Sets whether the label of the specified edge is editable.- Parameters:
link
- the edge whose label editability is to be setlabelEditable
-true
if the label should be editable;false
otherwise
-
setLinkLabelEditable
public void setLinkLabelEditable(boolean labelEditable) Sets the editability of the labels for all links in the graph.- Parameters:
labelEditable
-true
if the link labels should be editable;false
otherwise.
-
isLabelEditable
Determines whether the label of the specified edge is editable.- Parameters:
link
- the edge whose label editability is to be checked- Returns:
true
if the label of the given edge is editable;false
otherwise
-
setColor
Sets the color of the specified edge in the graph.- Parameters:
link
- the edge whose color is to be setcolor
- the color to assign to the edge
-
setColor
-
setNodeColor
Sets the color of all nodes in the graph to the specified color.- Parameters:
color
- the color to set for all nodes
-
setLinkColor
Sets the color of all links in the graph to the specified color.- Parameters:
color
- the color to set for all links, represented as a string (e.g., a hex color code or color name)
-
getColor
Returns the color associated with the specified edge in the graph.- Parameters:
link
- the edge whose color is to be retrieved- Returns:
- the color of the given edge as a String
-
getColor
-