Interface VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>>

Type Parameters:
V - the vertex type
E - the edge type
All Superinterfaces:
com.google.common.base.Function<V,Point2D>, Function<V,Point2D>, edu.uci.ics.jung.algorithms.layout.Layout<V,E>
All Known Implementing Classes:
AbstractVisualGraphLayout, JungLayout, JungWrappingVisualGraphLayoutAdapter

public interface VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> extends edu.uci.ics.jung.algorithms.layout.Layout<V,E>
The interface for defining functions provided that are additional to that of Layout.
  • Method Details

    • addLayoutListener

      void addLayoutListener(LayoutListener<V,E> listener)
      Adds a layout listener
      Parameters:
      listener - the listener
    • removeLayoutListener

      void removeLayoutListener(LayoutListener<V,E> listener)
      Removes a layout listener
      Parameters:
      listener - the listener
    • usesEdgeArticulations

      boolean usesEdgeArticulations()
      Returns true if this layout uses articulated edges. All VisualEdges have the ability to articulate. This method servers as a shortcut for algorithms so that they need not loop over all edges to determine if they have articulations. (Looping over large graphs is time intensive.)

      What are articulations?

      Returns:
      true if this layout uses articulated edges.
    • calculateLocations

      LayoutPositions<V,E> calculateLocations(VisualGraph<V,E> graph, TaskMonitor monitor)
      Signals to again layout the current graph. The locations generated by the layout will be returned, but not actually applied to the graph. This allows clients to generate new locations and then apply them in a delayed fashion, like for animation.
      Parameters:
      graph - the graph that contains the vertices to layout
      monitor - the task monitor used to report progress or to cancel
      Returns:
      the layout locations
    • cloneLayout

      VisualGraphLayout<V,E> cloneLayout(VisualGraph<V,E> newGraph)
      Creates a new version of this layout using the given graph. Also, the new layout will have the same state as this layout (i.e., vertex positions (and edge articulations, if applicable)).
      Parameters:
      newGraph - the new graph for the new layout
      Returns:
      the new layout
    • setLocation

      void setLocation(V v, Point2D location, LayoutListener.ChangeType changeType)
      Allows the client to change the location while specifying the type of change
      Parameters:
      v - the vertex
      location - the new location
      changeType - the type of change
    • getVisualGraph

      VisualGraph<V,E> getVisualGraph()
      Returns the graph of this layout
      Returns:
      the graph of this layout
    • getEdgeRenderer

      edu.uci.ics.jung.visualization.renderers.BasicEdgeRenderer<V,E> getEdgeRenderer()
      Returns an optional edge renderer. This is used to render each edge.
      Returns:
      an optional edge renderer
    • getEdgeShapeTransformer

      com.google.common.base.Function<E,Shape> getEdgeShapeTransformer()
      Returns an optional edge shape transformer. This is used to create shapes for each edge.
      Returns:
      an optional edge shape transformer
    • getEdgeLabelRenderer

      edu.uci.ics.jung.visualization.renderers.Renderer.EdgeLabel<V,E> getEdgeLabelRenderer()
      Returns an optional custom edge label renderer. This is used to add labels to the edges.
      Returns:
      an optional renderer
    • dispose

      void dispose()
      Cleanup any resource being managed by this layout.