public class GraphElementsControllerImpl extends Object implements GraphElementsController
GraphElementsController| Modifier and Type | Field and Description |
|---|---|
private static float |
DEFAULT_EDGE_WEIGHT |
private static float |
DEFAULT_NODE_SIZE |
| Constructor and Description |
|---|
GraphElementsControllerImpl() |
| 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.
|
private org.gephi.graph.api.Edge |
buildEdge(org.gephi.graph.api.Graph graph,
String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel) |
private org.gephi.graph.api.Node |
buildNode(org.gephi.graph.api.Graph graph,
String label) |
private org.gephi.graph.api.Node |
buildNode(org.gephi.graph.api.Graph graph,
String label,
String id) |
private org.gephi.graph.api.Node |
copyNode(org.gephi.graph.api.Node node,
org.gephi.graph.api.Graph 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. |
private org.gephi.graph.api.Graph |
getCurrentGraph()
**********Private methods : ***********
|
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.
|
private void |
removeEdge(org.gephi.graph.api.Edge edge,
org.gephi.graph.api.Graph graph) |
private void |
removeNode(org.gephi.graph.api.Node node,
org.gephi.graph.api.Graph graph) |
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.
|
private static final float DEFAULT_NODE_SIZE
private static final float DEFAULT_EDGE_WEIGHT
public org.gephi.graph.api.Node createNode(String label)
GraphElementsControllercreateNode in interface GraphElementsControllerlabel - Label for the nodepublic org.gephi.graph.api.Node createNode(String label, org.gephi.graph.api.Graph graph)
GraphElementsControllercreateNode in interface GraphElementsControllerlabel - Label for the nodegraph - Graph to insert the node intopublic org.gephi.graph.api.Node createNode(String label, String id)
GraphElementsControllerCreates 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
createNode in interface GraphElementsControllerlabel - Label for the nodeid - Id for the nodepublic org.gephi.graph.api.Node createNode(String label, String id, org.gephi.graph.api.Graph graph)
GraphElementsControllerCreates a node with the given id and label.
If a node with that id already exists, no node will be created
createNode in interface GraphElementsControllerlabel - Label for the nodeid - Id for the nodegraph - Graph to insert the node intopublic org.gephi.graph.api.Node duplicateNode(org.gephi.graph.api.Node node)
GraphElementsControllerDuplicates 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.
duplicateNode in interface GraphElementsControllernode - Node to copypublic void duplicateNodes(org.gephi.graph.api.Node[] nodes)
GraphElementsControllerduplicateNode method.duplicateNodes in interface GraphElementsControllernodes - Array of nodes to duplicatepublic org.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed)
GraphElementsControllerCreates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
createEdge in interface GraphElementsControllersource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedpublic 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)
GraphElementsControllerCreates and edge between source and target node (if it does not already exist), directed or undirected.
createEdge in interface GraphElementsControllersource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedgraph - Graph to insert the node intopublic org.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed)
GraphElementsControllerCreates 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.
createEdge in interface GraphElementsControllerid - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedpublic org.gephi.graph.api.Edge createEdge(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel)
GraphElementsControllerCreates and edge between source and target node (if it does not already exist), directed or undirected, in the current graph.
createEdge in interface GraphElementsControllersource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullpublic 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)
GraphElementsControllerCreates and edge between source and target node (if it does not already exist), directed or undirected.
createEdge in interface GraphElementsControllersource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullgraph - Graph to insert the node intopublic org.gephi.graph.api.Edge createEdge(String id, org.gephi.graph.api.Node source, org.gephi.graph.api.Node target, boolean directed, Object typeLabel)
GraphElementsControllerCreates 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.
createEdge in interface GraphElementsControllerid - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedtypeLabel - Edge type label or nullpublic 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)
GraphElementsControllerCreates 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.
createEdge in interface GraphElementsControllerid - Id for the new edgesource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directedgraph - Graph to insert the node intopublic 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)
GraphElementsControllerCreates 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.
createEdge in interface GraphElementsControllerid - 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 intopublic void createEdges(org.gephi.graph.api.Node source,
org.gephi.graph.api.Node[] allNodes,
boolean directed)
GraphElementsControllerTries 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.
createEdges in interface GraphElementsControllersource - Source nodeallNodes - All edgesdirected - Indicates if the edges have to be directedpublic void deleteNode(org.gephi.graph.api.Node node)
GraphElementsControllerdeleteNode in interface GraphElementsControllernode - Node to deletepublic void deleteNodes(org.gephi.graph.api.Node[] nodes)
GraphElementsControllerdeleteNodes in interface GraphElementsControllernodes - Array of nodes to deletepublic void deleteEdge(org.gephi.graph.api.Edge edge)
GraphElementsControllerdeleteEdge in interface GraphElementsControlleredge - Edge to deletepublic void deleteEdges(org.gephi.graph.api.Edge[] edges)
GraphElementsControllerdeleteEdges in interface GraphElementsControlleredges - Array of edges to deletepublic void deleteEdgeWithNodes(org.gephi.graph.api.Edge edge,
boolean deleteSource,
boolean deleteTarget)
GraphElementsControllerdeleteEdgeWithNodes in interface GraphElementsControlleredge - Edge to deletedeleteSource - Indicates if the source node has to be deleteddeleteTarget - Indicates if the target node has to be deletedpublic void deleteEdgesWithNodes(org.gephi.graph.api.Edge[] edges,
boolean deleteSource,
boolean deleteTarget)
GraphElementsControllerdeleteEdgesWithNodes in interface GraphElementsControlleredges - Array of edges to deletedeleteSource - Indicates if the source nodes have to be deleteddeleteTarget - Indicates if the target nodes have to be deletedpublic 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)
GraphElementsControllermergeNodes in interface GraphElementsControllergraph - 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 deletedpublic void setNodeFixed(org.gephi.graph.api.Node node,
boolean fixed)
GraphElementsControllersetNodeFixed in interface GraphElementsControllernode - Node to set fixed statefixed - Fixed state for the nodepublic void setNodesFixed(org.gephi.graph.api.Node[] nodes,
boolean fixed)
GraphElementsControllersetNodesFixed in interface GraphElementsControllernodes - Array of nodes to set fixed statefixed - Fixed state for the nodespublic boolean isNodeFixed(org.gephi.graph.api.Node node)
GraphElementsControllerisNodeFixed in interface GraphElementsControllernode - Node to checkpublic org.gephi.graph.api.Node[] getNodeNeighbours(org.gephi.graph.api.Node node)
GraphElementsControllergetNodeNeighbours in interface GraphElementsControllernode - Node to get neighbourspublic org.gephi.graph.api.Edge[] getNodeEdges(org.gephi.graph.api.Node node)
GraphElementsControllergetNodeEdges in interface GraphElementsControllernode - Node to get edgespublic int getNodesCount()
GraphElementsControllergetNodesCount in interface GraphElementsControllerpublic int getEdgesCount()
GraphElementsControllergetEdgesCount in interface GraphElementsControllerpublic boolean isNodeInGraph(org.gephi.graph.api.Node node)
GraphElementsControllerisNodeInGraph in interface GraphElementsControllernode - Node to checkpublic boolean areNodesInGraph(org.gephi.graph.api.Node[] nodes)
GraphElementsControllerareNodesInGraph in interface GraphElementsControllernodes - Array of nodes to checkpublic boolean isEdgeInGraph(org.gephi.graph.api.Edge edge)
GraphElementsControllerisEdgeInGraph in interface GraphElementsControlleredge - Edge to checkpublic boolean areEdgesInGraph(org.gephi.graph.api.Edge[] edges)
GraphElementsControllerareEdgesInGraph in interface GraphElementsControlleredges - Edges to checkprivate org.gephi.graph.api.Graph getCurrentGraph()
private org.gephi.graph.api.Node buildNode(org.gephi.graph.api.Graph graph,
String label)
private org.gephi.graph.api.Node buildNode(org.gephi.graph.api.Graph graph,
String label,
String id)
private org.gephi.graph.api.Edge buildEdge(org.gephi.graph.api.Graph graph,
String id,
org.gephi.graph.api.Node source,
org.gephi.graph.api.Node target,
boolean directed,
Object typeLabel)
private org.gephi.graph.api.Node copyNode(org.gephi.graph.api.Node node,
org.gephi.graph.api.Graph graph)
private void removeNode(org.gephi.graph.api.Node node,
org.gephi.graph.api.Graph graph)
private void removeEdge(org.gephi.graph.api.Edge edge,
org.gephi.graph.api.Graph graph)
Copyright © 2007–2016 Gephi Consortium. All rights reserved.