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 StringUtility 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.booleanisDeletable(N node) Determines whether the specified node is deletable.booleanisDeletable(GeneralEdge<? extends N> link) Determines whether the specified edge can be deleted from the graph.booleanisLabelEditable(N node) Determines whether the label of the specified node is editable.booleanisLabelEditable(GeneralEdge<? extends N> link) Determines whether the label of the specified edge is editable.booleanisNodeFixedPositionX(N node) Checks whether the specified node has a fixed X position.booleanisNodeFixedPositionY(N node) Checks whether the Y position of the specified node is fixed.voidmakeLeveled(N root) ensures that the graph nodes are positioned in levels depending on their distance to the given root nodevoidSets the color of the specified node in the graph.voidsetColor(GeneralEdge<? extends N> link, String color) Sets the color of the specified edge in the graph.voidsetDeletable(N node, boolean nodeDeletable) Sets whether the specified node is deletable.voidsetDeletable(GeneralEdge<? extends N> link, boolean linkDeletable) Sets whether the specified link (edge) in the graph is deletable.voidsetEnableLatex(boolean enableLatex) Aktiviert oder deaktiviert die Verwendung von LaTeX zur Darstellung von Formeln oder Text.voidsetLabelEditable(N node, boolean labelEditable) Sets whether the label of the specified node is editable.voidsetLabelEditable(GeneralEdge<? extends N> link, boolean labelEditable) Sets whether the label of the specified edge is editable.voidsetLinkColor(String color) Sets the color of all links in the graph to the specified color.voidsetLinkDeletable(boolean linkDeletable) Sets the deletable status for all links in the graph.voidsetLinkLabelEditable(boolean labelEditable) Sets the editability of the labels for all links in the graph.voidsetNodeColor(String color) Sets the color of all nodes in the graph to the specified color.voidsetNodeDeletable(boolean nodeDeletable) Sets the deletable status for all nodes in the graph.voidsetNodeFixedPositionX(boolean fixedPositionX) Sets whether the X position of all nodes in the graph should be fixed.voidsetNodeFixedPositionX(N node, boolean fixedPositionX) Sets whether the X position of the specified node should be fixed.voidsetNodeFixedPositionY(boolean fixedPositionY) Sets whether the Y position of all nodes in the graph should be fixed.voidsetNodeFixedPositionY(N node, boolean fixedPositionY) Sets whether the Y position of the specified node should be fixed.voidsetNodeLabelEditable(boolean labelEditable) Sets whether the labels of all nodes in the graph are editable.voidsetNodePositionX(N node, int positionX) Sets the X-coordinate position for the specified node in the graph.voidsetNodePositionY(N node, int positionY) Sets the Y-coordinate position for the specified node in the graph.voidsetToggleFixedLinkDistance(boolean toggleFixedLinkDistance) Aktiviert oder deaktiviert eine feste Kantenlänge im Graphenlayout.voidsetToggleGraphEditingInGUI(boolean toggleGraphEditingInGUI) Aktiviert oder deaktiviert die Möglichkeit zur Bearbeitung des Graphen über die Benutzeroberfläche.voidsetToggleLinkLabels(boolean toggleLinkLabels) Aktiviert oder deaktiviert die Anzeige von Kantentexten im Graphen.voidsetToggleNodeLabels(boolean toggleNodeLabels) Aktiviert oder deaktiviert die Anzeige von Knotentexten im Graphen.voidsetToggleNodePhysics(boolean toggleNodePhysics) Aktiviert oder deaktiviert die Physiksimulation für Knoten im Graphen.voidsetToggleZoom(boolean toggleZoom) Aktiviert oder deaktiviert die Zoom-Funktionalität im Graph.voidshow()Renders the graph in the web browser via the aig-graph-componentstatic voidRenders the given graph in the web browser via the aig-graph-componentwrite()Creates a JSON-String for the graph in the aig-graph formatstatic StringCreates 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-trueif the node should be deletable;falseotherwise
-
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-trueif nodes should be deletable;falseotherwise
-
isDeletable
Determines whether the specified node is deletable.- Parameters:
node- the node to check for deletability- Returns:
trueif the node is deletable;falseotherwise
-
setLabelEditable
Sets whether the label of the specified node is editable.- Parameters:
node- the node whose label editability is to be setlabelEditable-trueif the label should be editable;falseotherwise
-
setNodeLabelEditable
public void setNodeLabelEditable(boolean labelEditable) Sets whether the labels of all nodes in the graph are editable.- Parameters:
labelEditable-trueif node labels should be editable;falseotherwise.
-
isLabelEditable
Determines whether the label of the specified node is editable.- Parameters:
node- the node whose label editability is to be checked- Returns:
trueif the label of the node is editable;falseotherwise
-
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-trueto fix the X position of the node,falseto 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-trueto fix the X position of all nodes,falseto allow movement.
-
isNodeFixedPositionX
Checks whether the specified node has a fixed X position.- Parameters:
node- the node to check- Returns:
trueif the node has a fixed X position;falseotherwise
-
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-trueto fix the Y position of the node,falseto 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-trueto fix the Y position of all nodes,falseto allow movement.
-
isNodeFixedPositionY
Checks whether the Y position of the specified node is fixed.- Parameters:
node- the node to check- Returns:
trueif the Y position of the node is fixed;falseotherwise
-
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-trueif the link should be deletable;falseotherwise
-
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-trueif the links should be deletable;falseotherwise.
-
isDeletable
Determines whether the specified edge can be deleted from the graph.- Parameters:
link- the edge to check for deletability- Returns:
trueif the edge is deletable;falseotherwise
-
setLabelEditable
Sets whether the label of the specified edge is editable.- Parameters:
link- the edge whose label editability is to be setlabelEditable-trueif the label should be editable;falseotherwise
-
setLinkLabelEditable
public void setLinkLabelEditable(boolean labelEditable) Sets the editability of the labels for all links in the graph.- Parameters:
labelEditable-trueif the link labels should be editable;falseotherwise.
-
isLabelEditable
Determines whether the label of the specified edge is editable.- Parameters:
link- the edge whose label editability is to be checked- Returns:
trueif the label of the given edge is editable;falseotherwise
-
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
-