|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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). |
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. |
Method Detail |
---|
Node createNode(java.lang.String label)
label
- Label for the node
Node createNode(java.lang.String label, java.lang.String id)
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 node
Node duplicateNode(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 copy
void duplicateNodes(Node[] nodes)
duplicateNode
method.
nodes
- Array of nodes to duplicateEdge createEdge(Node source, Node target, boolean directed)
Creates and edge between source and target node (if it does not already exist), directed or undirected.
This will not create a self-loop.
source
- Source nodetarget
- Target nodedirected
- Indicates if the edge has to be directed
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.
If a edge with the given id already exists, no edge will be created.
This will not create a self-loop.
source
- Source nodetarget
- Target nodedirected
- Indicates if the edge has to be directed
void createEdges(Node source, 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(Node node)
node
- Node to deletevoid deleteNodes(Node[] nodes)
nodes
- Array of nodes to deletevoid deleteEdge(Edge edge)
edge
- Edge to deletevoid deleteEdges(Edge[] edges)
edges
- Array of edges to deletevoid deleteEdgeWithNodes(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(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 deletedboolean groupNodes(Node[] nodes)
nodes
- Array of nodes to group
boolean canGroupNodes(Node[] nodes)
nodes
- Array of nodes to check
boolean ungroupNode(Node node)
node
- Node to ungroup
void ungroupNodes(Node[] nodes)
nodes
- Array of nodes to ungroupboolean ungroupNodeRecursively(Node node)
node
- Node to ungroup recursively
void ungroupNodesRecursively(Node[] nodes)
nodes
- Array of nodes to ungroupboolean canUngroupNode(Node node)
node
- Node to check
boolean moveNodeToGroup(Node node, Node group)
node
- Node to move to groupgroup
- Group of nodes to move the node
void moveNodesToGroup(Node[] nodes, Node group)
nodes
- Array of nodes to movegroup
- Group nodeNode[] getAvailableGroupsToMoveNodes(Node[] nodes)
Prepares 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.
nodes
- Nodes to get available groups to be moved
boolean canMoveNodeToGroup(Node node, Node group)
node
- Node to check if can be movedgroup
- Group node
boolean removeNodeFromGroup(Node node)
node
- Node to remove from its group
void removeNodesFromGroup(Node[] nodes)
nodes
- Arrays of nodes to remove from its groupboolean isNodeInGroup(Node node)
void setNodeFixed(Node node, boolean fixed)
node
- Node to set fixed statefixed
- Fixed state for the nodevoid setNodesFixed(Node[] nodes, boolean fixed)
nodes
- Array of nodes to set fixed statefixed
- Fixed state for the nodesboolean isNodeFixed(Node node)
node
- Node to check
Node[] getNodeNeighbours(Node node)
node
- Node to get neighbours
Edge[] getNodeEdges(Node node)
node
- Node to get edges
int getNodesCount()
int getEdgesCount()
boolean isNodeInGraph(Node node)
node
- Node to check
boolean areNodesInGraph(Node[] nodes)
nodes
- Array of nodes to check
boolean isEdgeInGraph(Edge edge)
edge
- Edge to check
boolean areEdgesInGraph(Edge[] edges)
edges
- Edges to check
|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |