|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gephi.datalab.impl.GraphElementsControllerImpl
public class GraphElementsControllerImpl
Implementation of the GraphElementsController interface declared in the Data Laboratory API
GraphElementsController| Constructor Summary | |
|---|---|
GraphElementsControllerImpl()
|
|
| Method Summary | |
|---|---|
boolean |
areEdgesInGraph(Edge[] edges)
Checks if an array of edges are contained in the main view graph. |
boolean |
areNodesInGraph(Node[] nodes)
Checks if an array of nodes are contained in the main view graph. |
boolean |
canGroupNodes(Node[] nodes)
Checks if an array of nodes can form a group. |
boolean |
canMoveNodeToGroup(Node node,
Node group)
Indicates if a given node can be moved to a group node. |
boolean |
canUngroupNode(Node node)
Checks if the node can be ungrouped (it forms a group of nodes). |
Edge |
createEdge(Node source,
Node target,
boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected. |
Edge |
createEdge(java.lang.String id,
Node source,
Node target,
boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected. |
void |
createEdges(Node source,
Node[] allNodes,
boolean directed)
Tries to create edges between the source node and all other edges, directed or undirected. |
Node |
createNode(java.lang.String label)
Creates a node with default id and the given label. |
Node |
createNode(java.lang.String label,
java.lang.String id)
Creates a node with the given id and label. |
void |
deleteEdge(Edge edge)
Tries to delete an edge checking first if it is on the graph. |
void |
deleteEdges(Edge[] edges)
Tries to delete an array of edges checking first if they are on the graph. |
void |
deleteEdgesWithNodes(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(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(Node node)
Tries to delete a node checking first if it is on the graph. |
void |
deleteNodes(Node[] nodes)
Tries to delete an array of nodes checking first if they are on the graph. |
Node |
duplicateNode(Node node)
Duplicates a node if it is in the graph, and returns the new node. |
void |
duplicateNodes(Node[] nodes)
Tries to duplicate an array of nodes with the same behaviour as duplicateNode method. |
Node[] |
getAvailableGroupsToMoveNodes(Node[] nodes)
Prepares and returns an array with the groups that the given nodes can be moved to. |
int |
getEdgesCount()
Returns the number of edges in the graph. |
Edge[] |
getNodeEdges(Node node)
Prepares and returns an array with the edges incident to the specified node. |
Node[] |
getNodeNeighbours(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 |
groupNodes(Node[] nodes)
Groups an array of nodes if it is possible. |
boolean |
isEdgeInGraph(Edge edge)
Checks if an edge is contained in the main view graph. |
boolean |
isNodeFixed(Node node)
Checks the fixed state of a node. |
boolean |
isNodeInGraph(Node node)
Checks if a node is contained in the main view graph. |
boolean |
isNodeInGroup(Node node)
Checks if the node is in a group (has a parent). |
Node |
mergeNodes(Node[] nodes,
Node selectedNode,
AttributeRowsMergeStrategy[] mergeStrategies,
boolean deleteMergedNodes)
Merges 2 or more nodes into a new one node that has all the edges of the merged nodes. |
void |
moveNodesToGroup(Node[] nodes,
Node group)
Tries to move each node of the nodes array to the group node. |
boolean |
moveNodeToGroup(Node node,
Node group)
Moves a node to a group of nodes if it is possible. |
boolean |
removeNodeFromGroup(Node node)
Removes a node from its group if the node is in a group (has a parent). |
void |
removeNodesFromGroup(Node[] nodes)
Tries to remove every node in the array from its group checking first they are in a group. |
void |
setNodeFixed(Node node,
boolean fixed)
Sets the fixed state of a node to the indicated. |
void |
setNodesFixed(Node[] nodes,
boolean fixed)
Sets the fixed state of an array of nodes to the indicated. |
boolean |
ungroupNode(Node node)
Ungroups a node if it forms a group. |
boolean |
ungroupNodeRecursively(Node node)
Ungroups a node if it forms a group and also ungroups all its descendant. |
void |
ungroupNodes(Node[] nodes)
Tries to ungroup every node un the array of nodes checking first they form a group. |
void |
ungroupNodesRecursively(Node[] nodes)
Tries to ungroup every node un the array of nodes checking first they form a group. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphElementsControllerImpl()
| Method Detail |
|---|
public Node createNode(java.lang.String label)
GraphElementsController
createNode in interface GraphElementsControllerlabel - Label for the node
public Node createNode(java.lang.String label,
java.lang.String id)
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 node
public Node duplicateNode(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 copy
public void duplicateNodes(Node[] nodes)
GraphElementsControllerduplicateNode method.
duplicateNodes in interface GraphElementsControllernodes - Array of nodes to duplicate
public Edge createEdge(Node source,
Node target,
boolean directed)
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 directed
public Edge createEdge(java.lang.String id,
Node source,
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 GraphElementsControllersource - Source nodetarget - Target nodedirected - Indicates if the edge has to be directed
public void createEdges(Node source,
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(Node node)
GraphElementsController
deleteNode in interface GraphElementsControllernode - Node to deletepublic void deleteNodes(Node[] nodes)
GraphElementsController
deleteNodes in interface GraphElementsControllernodes - Array of nodes to deletepublic void deleteEdge(Edge edge)
GraphElementsController
deleteEdge in interface GraphElementsControlleredge - Edge to deletepublic void deleteEdges(Edge[] edges)
GraphElementsController
deleteEdges in interface GraphElementsControlleredges - Array of edges to delete
public void deleteEdgeWithNodes(Edge edge,
boolean deleteSource,
boolean deleteTarget)
GraphElementsController
deleteEdgeWithNodes in interface GraphElementsControlleredge - Edge to deletedeleteSource - Indicates if the source node has to be deleteddeleteTarget - Indicates if the target node has to be deleted
public void deleteEdgesWithNodes(Edge[] edges,
boolean deleteSource,
boolean deleteTarget)
GraphElementsController
deleteEdgesWithNodes 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 boolean groupNodes(Node[] nodes)
GraphElementsController
groupNodes in interface GraphElementsControllernodes - Array of nodes to group
public boolean canGroupNodes(Node[] nodes)
GraphElementsController
canGroupNodes in interface GraphElementsControllernodes - Array of nodes to check
public boolean ungroupNode(Node node)
GraphElementsController
ungroupNode in interface GraphElementsControllernode - Node to ungroup
public void ungroupNodes(Node[] nodes)
GraphElementsController
ungroupNodes in interface GraphElementsControllernodes - Array of nodes to ungrouppublic boolean ungroupNodeRecursively(Node node)
GraphElementsController
ungroupNodeRecursively in interface GraphElementsControllernode - Node to ungroup recursively
public void ungroupNodesRecursively(Node[] nodes)
GraphElementsController
ungroupNodesRecursively in interface GraphElementsControllernodes - Array of nodes to ungrouppublic boolean canUngroupNode(Node node)
GraphElementsController
canUngroupNode in interface GraphElementsControllernode - Node to check
public Node mergeNodes(Node[] nodes,
Node selectedNode,
AttributeRowsMergeStrategy[] mergeStrategies,
boolean deleteMergedNodes)
GraphElementsController
mergeNodes in interface GraphElementsControllernodes - Nodes to merge (at least 1)selectedNode - Main selected node of the nodes to merge (or null to use first node)mergeStrategies - Strategies to merge rows of each column of the nodesdeleteMergedNodes - Indicates if merged nodes should be deleted
public boolean moveNodeToGroup(Node node,
Node group)
GraphElementsController
moveNodeToGroup in interface GraphElementsControllernode - Node to move to groupgroup - Group of nodes to move the node
public void moveNodesToGroup(Node[] nodes,
Node group)
GraphElementsController
moveNodesToGroup in interface GraphElementsControllernodes - Array of nodes to movegroup - Group nodepublic Node[] getAvailableGroupsToMoveNodes(Node[] nodes)
GraphElementsControllerPrepares and returns an array with the groups that the given nodes can be moved to.
These groups are the nodes that have the same parent as the given nodes and are not in the given nodes array.
getAvailableGroupsToMoveNodes in interface GraphElementsControllernodes - Nodes to get available groups to be moved
public boolean canMoveNodeToGroup(Node node,
Node group)
GraphElementsController
canMoveNodeToGroup in interface GraphElementsControllernode - Node to check if can be movedgroup - Group node
public boolean removeNodeFromGroup(Node node)
GraphElementsController
removeNodeFromGroup in interface GraphElementsControllernode - Node to remove from its group
public void removeNodesFromGroup(Node[] nodes)
GraphElementsController
removeNodesFromGroup in interface GraphElementsControllernodes - Arrays of nodes to remove from its grouppublic boolean isNodeInGroup(Node node)
GraphElementsController
isNodeInGroup in interface GraphElementsController
public void setNodeFixed(Node node,
boolean fixed)
GraphElementsController
setNodeFixed in interface GraphElementsControllernode - Node to set fixed statefixed - Fixed state for the node
public void setNodesFixed(Node[] nodes,
boolean fixed)
GraphElementsController
setNodesFixed in interface GraphElementsControllernodes - Array of nodes to set fixed statefixed - Fixed state for the nodespublic boolean isNodeFixed(Node node)
GraphElementsController
isNodeFixed in interface GraphElementsControllernode - Node to check
public Node[] getNodeNeighbours(Node node)
GraphElementsController
getNodeNeighbours in interface GraphElementsControllernode - Node to get neighbours
public Edge[] getNodeEdges(Node node)
GraphElementsController
getNodeEdges in interface GraphElementsControllernode - Node to get edges
public int getNodesCount()
GraphElementsController
getNodesCount in interface GraphElementsControllerpublic int getEdgesCount()
GraphElementsController
getEdgesCount in interface GraphElementsControllerpublic boolean isNodeInGraph(Node node)
GraphElementsController
isNodeInGraph in interface GraphElementsControllernode - Node to check
public boolean areNodesInGraph(Node[] nodes)
GraphElementsController
areNodesInGraph in interface GraphElementsControllernodes - Array of nodes to check
public boolean isEdgeInGraph(Edge edge)
GraphElementsController
isEdgeInGraph in interface GraphElementsControlleredge - Edge to check
public boolean areEdgesInGraph(Edge[] edges)
GraphElementsController
areEdgesInGraph in interface GraphElementsControlleredges - Edges to check
|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||