|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphModel
Root interface that contains the complete graph structure and build
Graph
objets on demand.
The graph structure contains several views. GraphView
are sub-graphs with a unique
identifier, the viewId. The model maintains all views, and especially:
It is preferable to use the main graph for performing updates (add, remove, ...).
Graph graph = model.getGraph(); Node n1 = model.factory().newNode(); Node n2 = model.factory().newNode(); Edge e1 = model.factory().newEdge(n1, n2); graph.addNode(n1); graph.addNode(n2); graph.addEdge(e1);
GraphView newView = model.newView(); //Duplicate main view Graph subGraph = model.getGraph(newView); //Filter subgraph by removing nodes and edges model.setVisibleView(newView); //Set the view as current visible viewNote: Pay attention to destroy views when they are not used anymore.
GraphController
Method Summary | |
---|---|
void |
addGraphListener(GraphListener graphListener)
Add graphListener as a listener to this graph, if it is not already. |
void |
clear()
Clears the model by deleting all views and reseting main
view. |
GraphModel |
copy()
Returns a complete copy of this model, including all views but not listeners. |
GraphView |
copyView(GraphView view)
Copy view to a new graph view. |
void |
destroyView(GraphView view)
Destroy view , if exists. |
GraphFactory |
factory()
Returns the factory that creates nodes and edges for this model. |
DirectedGraph |
getDirectedGraph()
Build a DirectedGraph to access the main view. |
DirectedGraph |
getDirectedGraph(GraphView view)
Build a DirectedGraph to access view . |
DirectedGraph |
getDirectedGraphVisible()
Build a DirectedGraph to access the visible view. |
Graph |
getGraph()
Build a Graph to access the main view. |
Graph |
getGraph(GraphView view)
Build a Graph to access view/code>. |
Graph |
getGraphVisible()
Build a Graph to access the visible view. |
HierarchicalDirectedGraph |
getHierarchicalDirectedGraph()
Build a HierarchicalDirectedGraph to access the main view. |
HierarchicalDirectedGraph |
getHierarchicalDirectedGraph(GraphView view)
Build a HierarchicalDirectedGraph to access view . |
HierarchicalDirectedGraph |
getHierarchicalDirectedGraphVisible()
Build a HierarchicalDirectedGraph to access the visible view. |
HierarchicalGraph |
getHierarchicalGraph()
Build a HierarchicalGraph to access the main view. |
HierarchicalGraph |
getHierarchicalGraph(GraphView view)
Build a HierarchicalGraph to access view . |
HierarchicalGraph |
getHierarchicalGraphVisible()
Build a HierarchicalGraph to access the visible view. |
HierarchicalMixedGraph |
getHierarchicalMixedGraph()
Build a HierarchicalMixedGraph to access the main view. |
HierarchicalMixedGraph |
getHierarchicalMixedGraph(GraphView view)
Build a HierarchicalMixedGraph to access view . |
HierarchicalMixedGraph |
getHierarchicalMixedGraphVisible()
Build a HierarchicalMixedGraph to access the visible view. |
HierarchicalUndirectedGraph |
getHierarchicalUndirectedGraph()
Build a HierarchicalUndirectedGraph to access the main view. |
HierarchicalUndirectedGraph |
getHierarchicalUndirectedGraph(GraphView view)
Build a HierarchicalUndirectedGraph to access view . |
HierarchicalUndirectedGraph |
getHierarchicalUndirectedGraphVisible()
Build a HierarchicalUndirectedGraph to access the visible view. |
MixedGraph |
getMixedGraph()
Build a MixedGraph to access the main view. |
MixedGraph |
getMixedGraph(GraphView view)
Build a MixedGraph to access view . |
MixedGraph |
getMixedGraphVisible()
Build a MixedGraph to access the visible view. |
UndirectedGraph |
getUndirectedGraph()
Build a UndirectedGraph to access the main view. |
UndirectedGraph |
getUndirectedGraph(GraphView view)
Build a UndirectedGraph to access view . |
UndirectedGraph |
getUndirectedGraphVisible()
Build a UndirectedGraph to access the visible view. |
GraphView |
getVisibleView()
Returns the current viisble view. |
Workspace |
getWorkspace()
Returns the workspace this graph model belongs to. |
boolean |
isDirected()
Returns true if the graph is directed by default. |
boolean |
isHierarchical()
Returns true if the graph is hierarchical. |
boolean |
isMixed()
Returns true if the graph is mixed by default. |
boolean |
isUndirected()
Returns true if the graph is undirected by default. |
GraphView |
newView()
Create a new view by duplicating main view. |
void |
pushFrom(Graph graph)
Copy the graph structure from graph to this model. |
void |
pushNodes(Graph graph,
Node[] nodes)
Copy the nodes and edges betweeen these nodes from the graph
to this model. |
void |
removeGraphListener(GraphListener graphListener)
Remove graphListener as a listener to this graph. |
GraphSettings |
settings()
Returns the model settings. |
void |
setVisibleView(GraphView view)
Sets the current visible view and nofity listeners the visible view changed. |
Method Detail |
---|
GraphFactory factory()
GraphSettings settings()
GraphView newView()
GraphView copyView(GraphView view)
view
to a new graph view. The new view contains all
nodes and edges present in view
.
view
void destroyView(GraphView view)
view
, if exists. Always destroy views that are not
needed anymore to avoid memory overhead.
view
- the view that is to be destroyedvoid setVisibleView(GraphView view)
view
- the view that is to be set as the visible viewGraphView getVisibleView()
Graph getGraph()
Graph
to access the main view. If no undirected
edges have been added, returns a DirectedGraph
. If the graph
only contains undirected edges, returns a UndirectedGraph
.
If both directed and undirected edges exists, returns a MixedGraph
.
DirectedGraph getDirectedGraph()
DirectedGraph
to access the main view.
UndirectedGraph getUndirectedGraph()
UndirectedGraph
to access the main view.
MixedGraph getMixedGraph()
MixedGraph
to access the main view.
HierarchicalGraph getHierarchicalGraph()
HierarchicalGraph
to access the main view.
If no undirected edges have been added, returns a
HierarchicalDirectedGraph
. If the graph only contains undirected
edges, returns a HierarchicalUndirectedGraph
. If both directed
and undirected edges exists, returns a HierarchicalMixedGraph
.
Hierarchical graphs are normal graphs with more features to handle graphs within graphs.
HierarchicalDirectedGraph getHierarchicalDirectedGraph()
HierarchicalDirectedGraph
to access the main view.
HierarchicalUndirectedGraph getHierarchicalUndirectedGraph()
HierarchicalUndirectedGraph
to access the main view.
HierarchicalMixedGraph getHierarchicalMixedGraph()
HierarchicalMixedGraph
to access the main view.
Graph getGraphVisible()
Graph
to access the visible view. If no undirected
edges have been added, returns a DirectedGraph
. If the graph
only contains undirected edges, returns a UndirectedGraph
.
If both directed and undirected edges exists, returns a MixedGraph
.
DirectedGraph getDirectedGraphVisible()
DirectedGraph
to access the visible view.
UndirectedGraph getUndirectedGraphVisible()
UndirectedGraph
to access the visible view.
MixedGraph getMixedGraphVisible()
MixedGraph
to access the visible view.
HierarchicalGraph getHierarchicalGraphVisible()
HierarchicalGraph
to access the visible view.
If no undirected edges have been added, returns a
HierarchicalDirectedGraph
. If the graph only contains undirected
edges, returns a HierarchicalUndirectedGraph
. If both directed
and undirected edges exists, returns a HierarchicalMixedGraph
.
Hierarchical graphs are normal graphs with more features to handle graphs within graphs.
HierarchicalDirectedGraph getHierarchicalDirectedGraphVisible()
HierarchicalDirectedGraph
to access the visible view.
HierarchicalUndirectedGraph getHierarchicalUndirectedGraphVisible()
HierarchicalUndirectedGraph
to access the visible view.
HierarchicalMixedGraph getHierarchicalMixedGraphVisible()
HierarchicalMixedGraph
to access the visible view.
Graph getGraph(GraphView view)
Graph
to access view/code>. If no undirected
edges have been added, returns a DirectedGraph
. If the graph
only contains undirected edges, returns a UndirectedGraph
.
If both directed and undirected edges exists, returns a MixedGraph
.
- Returns:
- a graph object on
view
, directed by default
DirectedGraph getDirectedGraph(GraphView view)
DirectedGraph
to access view
.
view
UndirectedGraph getUndirectedGraph(GraphView view)
UndirectedGraph
to access view
.
view
MixedGraph getMixedGraph(GraphView view)
MixedGraph
to access view
.
view
HierarchicalGraph getHierarchicalGraph(GraphView view)
HierarchicalGraph
to access view
.
If no undirected edges have been added, returns a
HierarchicalDirectedGraph
. If the graph only contains undirected
edges, returns a HierarchicalUndirectedGraph
. If both directed
and undirected edges exists, returns a HierarchicalMixedGraph
.
Hierarchical graphs are normal graphs with more features to handle graphs within graphs.
view
, directed by defaultHierarchicalDirectedGraph getHierarchicalDirectedGraph(GraphView view)
HierarchicalDirectedGraph
to access view
.
view
HierarchicalUndirectedGraph getHierarchicalUndirectedGraph(GraphView view)
HierarchicalUndirectedGraph
to access view
.
view
HierarchicalMixedGraph getHierarchicalMixedGraph(GraphView view)
HierarchicalMixedGraph
to access view
.
view
void pushFrom(Graph graph)
graph
to this model. The
given graph
must come from a different GraphModel
,
e.g. a different workspace.
graph
- the graph that is to be copied in this model
java.lang.IllegalArgumentException
- if graph
belongs to this
graph modelvoid pushNodes(Graph graph, Node[] nodes)
graph
to this model. The given graph
must come from a different
GraphModel
, e.g. a different workspace.
graph
- the graph that is to be copied in this modelnodes
- the nodes to copy
java.lang.IllegalArgumentException
- if graph
belongs to this
graph modelGraphModel copy()
void clear()
main
view. Calling this method immediately makes all Graph
on
other views than main obsolete.
void addGraphListener(GraphListener graphListener)
graphListener
as a listener to this graph, if it is not already.
To pass a WeakReference
, use Netbeans WeakListeners
utility class.
graphListener
- the listener to addvoid removeGraphListener(GraphListener graphListener)
graphListener
as a listener to this graph.
graphListener
- the listener to removeboolean isDirected()
true
if the graph is directed by default. This value is an
indicator of the current state and it means that so far all edges are directed in the graph.
true
if the graph is only directed or false
otherwiseDirectedGraph
boolean isUndirected()
true
if the graph is undirected by default. This value is an
indicator of the current state and it means that so far all edges are undirected in the graph.
true
if the graph is only undirected or false
otherwiseUndirectedGraph
boolean isMixed()
true
if the graph is mixed by default. This value is an
indicator of the current state and it means that directed and undirected edges has been
added to the graph. When it returns true
, isDirected()
and
isUndirected()
methods always returns false
.
true
if the graph is mixed or false
otherwiseMixedGraph
boolean isHierarchical()
true
if the graph is hierarchical. This indicates the presence
of a hierarchy, in other words the height of the tree is greater than 0.
true
if the graph is clustered or false
otherwiseHierarchicalGraph
Workspace getWorkspace()
|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |