public interface GraphElementsController
This interface defines part of the Data Laboratory API basic actions.
It contains methods for manipulating the nodes and edges of the graph.
All the provided methods take care to check first that the nodes and edges to manipulate are in the graph.
| Modifier and Type | Method and Description |
|---|---|
boolean |
areEdgesInGraph(org.gephi.graph.api.Edge[] edges)
Checks if an array of edges are contained in the main view graph.
|
boolean |
areNodesInGraph(org.gephi.graph.api.Node[] nodes)
Checks if an array of nodes are contained in the main view graph.
|
org.gephi.graph.api.Edge |
createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
|
org.gephi.graph.api.Edge |
createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
|
org.gephi.graph.api.Edge |
createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
|
org.gephi.graph.api.Edge |
createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
|
org.gephi.graph.api.Edge |
createEdge(String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
|
org.gephi.graph.api.Edge |
createEdge(String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
|
org.gephi.graph.api.Edge |
createEdge(String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
|
org.gephi.graph.api.Edge |
createEdge(String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
|
void |
createEdges(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node[] allNodes,
boolean directed)
Tries to create edges between the source node and all other edges, directed or undirected.
|
org.gephi.graph.api.Node |
createNode(String label)
Creates a node with default id and the given label in the current graph.
|
org.gephi.graph.api.Node |
createNode(String label,
org.gephi.graph.api.Graph graph)
Creates a node with default id and the given label.
|
org.gephi.graph.api.Node |
createNode(String label,
String id)
Creates a node with the given id and label in the current graph.
|
org.gephi.graph.api.Node |
createNode(String label,
String id,
org.gephi.graph.api.Graph graph)
Creates a node with the given id and label.
|
void |
deleteEdge(org.gephi.graph.api.Edge edge)
Tries to delete an edge checking first if it is on the graph.
|
void |
deleteEdges(org.gephi.graph.api.Edge[] edges)
Tries to delete an array of edges checking first if they are on the graph.
|
void |
deleteEdgesWithNodes(org.gephi.graph.api.Edge[] edges,
boolean deleteSource,
boolean deleteTarget)
Tries to delete an array of edges checking first if they are on the graph
and also deletes their source and target node if it is indicated.
|
void |
deleteEdgeWithNodes(org.gephi.graph.api.Edge edge,
boolean deleteSource,
boolean deleteTarget)
Tries to delete an edge checking first if it is on the graph
and also deletes its source and target node if it is indicated.
|
void |
deleteNode(org.gephi.graph.api.Node node)
Tries to delete a node checking first if it is on the graph.
|
void |
deleteNodes(org.gephi.graph.api.Node[] nodes)
Tries to delete an array of nodes checking first if they are on the graph.
|
org.gephi.graph.api.Node |
duplicateNode(org.gephi.graph.api.Node node)
Duplicates a node if it is in the graph, and returns the new node.
|
void |
duplicateNodes(org.gephi.graph.api.Node[] nodes)
Tries to duplicate an array of nodes with the same behaviour as
duplicateNode method. |
int |
getEdgesCount()
Returns the number of edges in the graph.
|
org.gephi.graph.api.Edge[] |
getNodeEdges(org.gephi.graph.api.Node node)
Prepares and returns an array with the edges incident to the specified node.
|
org.gephi.graph.api.Node[] |
getNodeNeighbours(org.gephi.graph.api.Node node)
Prepares and returns an array with the neighbour nodes of the specified node.
|
int |
getNodesCount()
Returns the number of nodes in the graph.
|
boolean |
isEdgeInGraph(org.gephi.graph.api.Edge edge)
Checks if an edge is contained in the main view graph.
|
boolean |
isNodeFixed(org.gephi.graph.api.Node node)
Checks the fixed state of a node.
|
boolean |
isNodeInGraph(org.gephi.graph.api.Node node)
Checks if a node is contained in the main view graph.
|
org.gephi.graph.api.Node |
mergeNodes(org.gephi.graph.api.Graph graph,
org.gephi.graph.api.Node[] nodes,
org.gephi.graph.api.Node selectedNode,
org.gephi.graph.api.Column[] columns,
AttributeRowsMergeStrategy[] mergeStrategies,
boolean deleteMergedNodes)
Merges 2 or more nodes into a new one node that has all the edges of the merged nodes.
|
void |
setNodeFixed(org.gephi.graph.api.Node node,
boolean fixed)
Sets the fixed state of a node to the indicated.
|
void |
setNodesFixed(org.gephi.graph.api.Node[] nodes,
boolean fixed)
Sets the fixed state of an array of nodes to the indicated.
|
org.gephi.graph.api.Node createNode(String label)
label - Label for the nodeorg.gephi.graph.api.Node createNode(String label, org.gephi.graph.api.Graph graph)
label - Label for the nodegraph - Graph to insert the node intoorg.gephi.graph.api.Node createNode(String label, String id)
Creates a node with the given id and label in the current graph.
If a node with that id already exists, no node will be created
label - Label for the nodeid - Id for the nodeorg.gephi.graph.api.Node createNode(String label, String id, org.gephi.graph.api.Graph graph)
Creates a node with the given id and label.
If a node with that id already exists, no node will be created
label - Label for the nodeid - Id for the nodegraph - Graph to insert the node intoorg.gephi.graph.api.Node duplicateNode(org.gephi.graph.api.Node node)
Duplicates a node if it is in the graph, and returns the new node.
If the node has children, they are also copied as children of the new node.
Sets the same properties and attributes for the node as the original node: id, label and AttributeColumns with DATA AttributeOrigin.
Does not copy AttributeColumns with COMPUTED AttributeOrigin.
node - Node to copyvoid duplicateNodes(org.gephi.graph.api.Node[] nodes)
duplicateNode method.nodes - Array of nodes to duplicateorg.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
source - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedorg.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
source - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullorg.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
source - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedgraph - Graph to insert the node intoorg.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel,
org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
source - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullgraph - Graph to insert the node intoorg.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
If a edge with the given id already exists, no edge will be created.
id - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedorg.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed, Object typeLabel)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
If a edge with the given id already exists, no edge will be created.
id - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullorg.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed, org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
If a edge with the given id already exists, no edge will be created.
id - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedgraph - Graph to insert the node intoorg.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed, Object typeLabel, org.gephi.graph.api.Graph graph)
Creates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
If a edge with the given id already exists, no edge will be created.
id - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullgraph - Graph to insert the node intovoid createEdges(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node[] allNodes,
boolean directed)
Tries to create edges between the source node and all other edges, directed or undirected.
An edge won't be created if it already exists or is a self-loop.
source - Source nodeallNodes - All edgesdirected - Indicates if the edges have to be directedvoid deleteNode(org.gephi.graph.api.Node node)
node - Node to deletevoid deleteNodes(org.gephi.graph.api.Node[] nodes)
nodes - Array of nodes to deletevoid deleteEdge(org.gephi.graph.api.Edge edge)
edge - Edge to deletevoid deleteEdges(org.gephi.graph.api.Edge[] edges)
edges - Array of edges to deletevoid deleteEdgeWithNodes(org.gephi.graph.api.Edge edge,
boolean deleteSource,
boolean deleteTarget)
edge - Edge to deletedeleteSource - Indicates if the source node has to be deleteddeleteTarget - Indicates if the target node has to be deletedvoid deleteEdgesWithNodes(org.gephi.graph.api.Edge[] edges,
boolean deleteSource,
boolean deleteTarget)
edges - Array of edges to deletedeleteSource - Indicates if the source nodes have to be deleteddeleteTarget - Indicates if the target nodes have to be deletedorg.gephi.graph.api.Node mergeNodes(org.gephi.graph.api.Graph graph,
org.gephi.graph.api.Node[] nodes,
org.gephi.graph.api.Node selectedNode,
org.gephi.graph.api.Column[] columns,
AttributeRowsMergeStrategy[] mergeStrategies,
boolean deleteMergedNodes)
graph - Graph that contains the nodesnodes - Nodes to merge (at least 1)selectedNode - Main selected node of the nodes to merge (or null to use first node)columns - Columns to apply a merge strategy in each rowmergeStrategies - Strategies to merge rows of each column in columnsdeleteMergedNodes - Indicates if merged nodes should be deletedvoid setNodeFixed(org.gephi.graph.api.Node node,
boolean fixed)
node - Node to set fixed statefixed - Fixed state for the nodevoid setNodesFixed(org.gephi.graph.api.Node[] nodes,
boolean fixed)
nodes - Array of nodes to set fixed statefixed - Fixed state for the nodesboolean isNodeFixed(org.gephi.graph.api.Node node)
node - Node to checkorg.gephi.graph.api.Node[] getNodeNeighbours(org.gephi.graph.api.Node node)
node - Node to get neighboursorg.gephi.graph.api.Edge[] getNodeEdges(org.gephi.graph.api.Node node)
node - Node to get edgesint getNodesCount()
int getEdgesCount()
boolean isNodeInGraph(org.gephi.graph.api.Node node)
node - Node to checkboolean areNodesInGraph(org.gephi.graph.api.Node[] nodes)
nodes - Array of nodes to checkboolean isEdgeInGraph(org.gephi.graph.api.Edge edge)
edge - Edge to checkboolean areEdgesInGraph(org.gephi.graph.api.Edge[] edges)
edges - Edges to checkCopyright © 2007–2016 Gephi Consortium. All rights reserved.