|
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). |
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 GraphElementsController
label
- Label for the node
public Node createNode(java.lang.String label, java.lang.String id)
GraphElementsController
Creates a node with the given id and label.
If a node with that id already exists, no node will be created
createNode
in interface GraphElementsController
label
- Label for the nodeid
- Id for the node
public Node duplicateNode(Node node)
GraphElementsController
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
.
duplicateNode
in interface GraphElementsController
node
- Node to copy
public void duplicateNodes(Node[] nodes)
GraphElementsController
duplicateNode
method.
duplicateNodes
in interface GraphElementsController
nodes
- Array of nodes to duplicatepublic Edge createEdge(Node source, Node target, boolean directed)
GraphElementsController
Creates and edge between source and target node (if it does not already exist), directed or undirected.
createEdge
in interface GraphElementsController
source
- 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)
GraphElementsController
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.
createEdge
in interface GraphElementsController
source
- Source nodetarget
- Target nodedirected
- Indicates if the edge has to be directed
public void createEdges(Node source, Node[] allNodes, boolean directed)
GraphElementsController
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.
createEdges
in interface GraphElementsController
source
- Source nodeallNodes
- All edgesdirected
- Indicates if the edges have to be directedpublic void deleteNode(Node node)
GraphElementsController
deleteNode
in interface GraphElementsController
node
- Node to deletepublic void deleteNodes(Node[] nodes)
GraphElementsController
deleteNodes
in interface GraphElementsController
nodes
- Array of nodes to deletepublic void deleteEdge(Edge edge)
GraphElementsController
deleteEdge
in interface GraphElementsController
edge
- Edge to deletepublic void deleteEdges(Edge[] edges)
GraphElementsController
deleteEdges
in interface GraphElementsController
edges
- Array of edges to deletepublic void deleteEdgeWithNodes(Edge edge, boolean deleteSource, boolean deleteTarget)
GraphElementsController
deleteEdgeWithNodes
in interface GraphElementsController
edge
- Edge to deletedeleteSource
- Indicates if the source node has to be deleteddeleteTarget
- Indicates if the target node has to be deletedpublic void deleteEdgesWithNodes(Edge[] edges, boolean deleteSource, boolean deleteTarget)
GraphElementsController
deleteEdgesWithNodes
in interface GraphElementsController
edges
- 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 GraphElementsController
nodes
- Array of nodes to group
public boolean canGroupNodes(Node[] nodes)
GraphElementsController
canGroupNodes
in interface GraphElementsController
nodes
- Array of nodes to check
public boolean ungroupNode(Node node)
GraphElementsController
ungroupNode
in interface GraphElementsController
node
- Node to ungroup
public void ungroupNodes(Node[] nodes)
GraphElementsController
ungroupNodes
in interface GraphElementsController
nodes
- Array of nodes to ungrouppublic boolean ungroupNodeRecursively(Node node)
GraphElementsController
ungroupNodeRecursively
in interface GraphElementsController
node
- Node to ungroup recursively
public void ungroupNodesRecursively(Node[] nodes)
GraphElementsController
ungroupNodesRecursively
in interface GraphElementsController
nodes
- Array of nodes to ungrouppublic boolean canUngroupNode(Node node)
GraphElementsController
canUngroupNode
in interface GraphElementsController
node
- Node to check
public boolean moveNodeToGroup(Node node, Node group)
GraphElementsController
moveNodeToGroup
in interface GraphElementsController
node
- Node to move to groupgroup
- Group of nodes to move the node
public void moveNodesToGroup(Node[] nodes, Node group)
GraphElementsController
moveNodesToGroup
in interface GraphElementsController
nodes
- Array of nodes to movegroup
- Group nodepublic Node[] getAvailableGroupsToMoveNodes(Node[] nodes)
GraphElementsController
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.
getAvailableGroupsToMoveNodes
in interface GraphElementsController
nodes
- Nodes to get available groups to be moved
public boolean canMoveNodeToGroup(Node node, Node group)
GraphElementsController
canMoveNodeToGroup
in interface GraphElementsController
node
- Node to check if can be movedgroup
- Group node
public boolean removeNodeFromGroup(Node node)
GraphElementsController
removeNodeFromGroup
in interface GraphElementsController
node
- Node to remove from its group
public void removeNodesFromGroup(Node[] nodes)
GraphElementsController
removeNodesFromGroup
in interface GraphElementsController
nodes
- 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 GraphElementsController
node
- Node to set fixed statefixed
- Fixed state for the nodepublic void setNodesFixed(Node[] nodes, boolean fixed)
GraphElementsController
setNodesFixed
in interface GraphElementsController
nodes
- Array of nodes to set fixed statefixed
- Fixed state for the nodespublic boolean isNodeFixed(Node node)
GraphElementsController
isNodeFixed
in interface GraphElementsController
node
- Node to check
public Node[] getNodeNeighbours(Node node)
GraphElementsController
getNodeNeighbours
in interface GraphElementsController
node
- Node to get neighbours
public Edge[] getNodeEdges(Node node)
GraphElementsController
getNodeEdges
in interface GraphElementsController
node
- Node to get edges
public int getNodesCount()
GraphElementsController
getNodesCount
in interface GraphElementsController
public int getEdgesCount()
GraphElementsController
getEdgesCount
in interface GraphElementsController
public boolean isNodeInGraph(Node node)
GraphElementsController
isNodeInGraph
in interface GraphElementsController
node
- Node to check
public boolean areNodesInGraph(Node[] nodes)
GraphElementsController
areNodesInGraph
in interface GraphElementsController
nodes
- Array of nodes to check
public boolean isEdgeInGraph(Edge edge)
GraphElementsController
isEdgeInGraph
in interface GraphElementsController
edge
- Edge to check
public boolean areEdgesInGraph(Edge[] edges)
GraphElementsController
areEdgesInGraph
in interface GraphElementsController
edges
- Edges to check
|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |