Interface GraphView


  • public interface GraphView
    View on the graph.

    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.

    See Also:
    GraphModel
    • Method Detail

      • getGraphModel

        GraphModel getGraphModel()
        Gets the graph model this view belongs to.
        Returns:
        the graph model
      • isMainView

        boolean isMainView()
        Returns true if this view is the main view.
        Returns:
        true if main view, false otherwise
      • isNodeView

        boolean isNodeView()
        Returns true if this view supports node filtering.
        Returns:
        true if node view, false otherwise
      • isEdgeView

        boolean isEdgeView()
        Returns true if this view supports edge filtering.
        Returns:
        true if edge view, false otherwise
      • getTimeInterval

        Interval getTimeInterval()
        Gets the time interval for this view.

        If no interval is set, it returns a [-inf, +inf] interval.

        Returns:
        the time interval, or [-inf, +inf] if not set
      • isDestroyed

        boolean isDestroyed()
        Returns true if this view has been destroyed.
        Returns:
        true if destroyed, false otherwise