Gephi Toolkit Javadoc

org.gephi.graph.api
Interface GraphView


public interface GraphView

Graph view define a subgraph, i.e. a subset of the original graph. GraphModel has at least a single view, called the main view, which contains 100% of the graph. Other views can be defined by users to define subgraphs with a reduced number of nodes and edges. This is typically used by filters, which returns filtered graphs.

GraphModel also contains the visible view, which is the main view by default but can be set to configure the view that is visualized.

What exactly contains the view? The complete hierarchy of nodes, the edges and meta-edges. Each view has separate hierarchy, therefore grouping and meta-edges are independent.

Note that nodes' id is unique, and is not touched by views.

Main or Visible View?

When you need to interact with the graph structure, you have the choice between working on the complete graph, i.e. the main view, or the visible view. In most cases, it's preferable to use the visible view because your action will use the graph currently visualized, which has been potentially filtered by users on purpose.

To get the graph in the visible view, see GraphModel.getGraphVisible().

Set the Visible View

This is the typical workflow for filtering a graph and display the results, as done by FiltersAPI. To set a view as the currently visible view, see GraphModel.setVisibleView(org.gephi.graph.api.GraphView).

Author:
Mathieu Bastian

Method Summary
 GraphModel getGraphModel()
          Returns the graph model this view belongs.
 int getViewId()
          Returns this view unique identifier.
 boolean isMainView()
          Returns true if this view is the main view.
 

Method Detail

getViewId

int getViewId()
Returns this view unique identifier. The id is a positive integer. The main view always has it's id equal to zero.

Returns:
the view identifier

isMainView

boolean isMainView()
Returns true if this view is the main view. Each GraphModel has a single main view, which contains all nodes and edges in the model.

Returns:
true if this is the main view, false otherwise.

getGraphModel

GraphModel getGraphModel()
Returns the graph model this view belongs.

Returns:
the graph model this view belongs.

Gephi Toolkit Javadoc