Class GraphStreamUtils
- java.lang.Object
-
- romanemperorsscraper.scraping.dynasties.GraphStreamUtils
-
public class GraphStreamUtils extends java.lang.ObjectUtility class providing methods related to GraphStream- Author:
- Matteo Collica
- See Also:
DynastyTree
-
-
Constructor Summary
Constructors Modifier Constructor Description privateGraphStreamUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddClassToElement(org.graphstream.graph.Element element, java.lang.String customClass)Given a GraphStream Element (a node or an edge) and a style class's name, add it to the element's 'ui.class' attribute (or set it as the only class if empty)static org.graphstream.graph.NodeaddNodeToGraph(java.lang.String id, java.lang.String label, org.graphstream.graph.Graph graph)Create a node and add it to an existing GraphStream's graphstatic booleanareConnected(org.graphstream.graph.Node firstNode, org.graphstream.graph.Node secondNode)Given two GraphStream nodes, check whether there is a connection between them
-
-
-
Method Detail
-
addClassToElement
public static void addClassToElement(org.graphstream.graph.Element element, java.lang.String customClass)Given a GraphStream Element (a node or an edge) and a style class's name, add it to the element's 'ui.class' attribute (or set it as the only class if empty)- Parameters:
element- a GraphStream element (a node or an edge)customClass- the class to be added to the element's 'ui.class' attribute
-
addNodeToGraph
public static org.graphstream.graph.Node addNodeToGraph(java.lang.String id, java.lang.String label, org.graphstream.graph.Graph graph)Create a node and add it to an existing GraphStream's graph- Parameters:
id- the node's IDlabel- the node's label textgraph- the graph the node as to be added to- Returns:
- the created and styled node
-
areConnected
public static boolean areConnected(org.graphstream.graph.Node firstNode, org.graphstream.graph.Node secondNode)Given two GraphStream nodes, check whether there is a connection between them- Parameters:
firstNode- the first nodesecondNode- the second node- Returns:
- whether there is a connection between the two nodes
-
-