public interface GraphView
Each graph can have views and use these views to obtain subgraphs. A view is a filter on the main graph structure where some nodes and/or edges are missing.
The graph model has a main view, which is always 100% of nodes and edges. Users can then create views and modify them by enabling/disabling elements. Views can only have elements which are in the model. As a consequence, if a element is removed from the graph it's also removed from all the views. By default, the view is empty.
The main benefits of views is the ability to obtain a Subgraph
object from it. Users can call the
GraphModel.getGraph(org.gephi.graph.api.GraphView)
method and obtain
a subgraph backed by the view. Update operations such as add or remove on
this graph are in-fact modifying the view rather than the model. Indeed,
adding a node to a view is enabling this node in the view. Similarly for
removal.
Views can apply on nodes only, edges only or both. This is configured when the view is created. Nodes-only view let the system automatically control the set of edges. Enabling a node in the view will automatically enable all it's edges if the opposite nodes are also in the view.
GraphModel
Modifier and Type | Method and Description |
---|---|
GraphModel |
getGraphModel()
Gets the graph model this view belongs to.
|
Interval |
getTimeInterval()
Gets the time interval for this view.
|
boolean |
isDestroyed()
Returns true if this view has been destroyed.
|
boolean |
isEdgeView()
Returns true if this view supports edge filtering.
|
boolean |
isMainView()
Returns true if this view is the main view.
|
boolean |
isNodeView()
Returns true if this view supports node filtering.
|
GraphModel getGraphModel()
boolean isMainView()
boolean isNodeView()
boolean isEdgeView()
Interval getTimeInterval()
If no interval is set, it returns a [-inf, +inf] interval.
boolean isDestroyed()
Copyright © 2007–2017 Gephi Consortium. All rights reserved.