Class JungWrappingVisualGraphLayoutAdapter<V extends VisualVertex,​E extends VisualEdge<V>>

  • Type Parameters:
    V - the vertex type
    E - the edge type
    All Implemented Interfaces:
    com.google.common.base.Function<V,​java.awt.geom.Point2D>, edu.uci.ics.jung.algorithms.layout.Layout<V,​E>, VisualGraphLayout<V,​E>
    Direct Known Subclasses:
    JungLayout

    public class JungWrappingVisualGraphLayoutAdapter<V extends VisualVertex,​E extends VisualEdge<V>>
    extends java.lang.Object
    implements VisualGraphLayout<V,​E>
    A wrapper that allows for existing Jung layouts to be used inside of the Visual Graph system.
    • Field Detail

    • Constructor Detail

      • JungWrappingVisualGraphLayoutAdapter

        public JungWrappingVisualGraphLayoutAdapter​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> jungLayout)
    • Method Detail

      • initialize

        public void initialize()
        Specified by:
        initialize in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • reset

        public void reset()
        Specified by:
        reset in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • calculateLocations

        public LayoutPositions<V,​E> calculateLocations​(VisualGraph<V,​E> graph,
                                                             TaskMonitor monitor)
        Description copied from interface: VisualGraphLayout
        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.
        Specified by:
        calculateLocations in interface VisualGraphLayout<V extends VisualVertex,​E extends VisualEdge<V>>
        Parameters:
        graph - the graph that contains the vertices to layout
        monitor - the task monitor used to report progress or to cancel
      • cloneJungLayout

        protected edu.uci.ics.jung.algorithms.layout.Layout<V,​E> cloneJungLayout​(VisualGraph<V,​E> newGraph)
      • usesEdgeArticulations

        public boolean usesEdgeArticulations()
        Description copied from interface: VisualGraphLayout
        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?

        Specified by:
        usesEdgeArticulations in interface VisualGraphLayout<V extends VisualVertex,​E extends VisualEdge<V>>
        Returns:
        true if this layout uses articulated edges.
        See Also:
        ArticulatedEdge
      • getGraph

        public edu.uci.ics.jung.graph.Graph<V,​E> getGraph()
        Specified by:
        getGraph in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • getSize

        public java.awt.Dimension getSize()
        Specified by:
        getSize in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • isLocked

        public boolean isLocked​(V v)
        Specified by:
        isLocked in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • lock

        public void lock​(V v,
                         boolean lock)
        Specified by:
        lock in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • setGraph

        public void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)
        Specified by:
        setGraph in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • setInitializer

        public void setInitializer​(com.google.common.base.Function<V,​java.awt.geom.Point2D> t)
        Specified by:
        setInitializer in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • setSize

        public void setSize​(java.awt.Dimension d)
        Specified by:
        setSize in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>
      • apply

        public java.awt.geom.Point2D apply​(V v)
        Specified by:
        apply in interface com.google.common.base.Function<V extends VisualVertex,​E extends VisualEdge<V>>
      • getEdgeRenderer

        public edu.uci.ics.jung.visualization.renderers.BasicEdgeRenderer<V,​E> getEdgeRenderer()
        Description copied from interface: VisualGraphLayout
        Returns an optional edge renderer. This is used to render each edge.
        Specified by:
        getEdgeRenderer in interface VisualGraphLayout<V extends VisualVertex,​E extends VisualEdge<V>>
        Returns:
        an optional edge renderer
      • getEdgeShapeTransformer

        public com.google.common.base.Function<E,​java.awt.Shape> getEdgeShapeTransformer()
        Description copied from interface: VisualGraphLayout
        Returns an optional edge shape transformer. This is used to create shapes for each edge.
        Specified by:
        getEdgeShapeTransformer in interface VisualGraphLayout<V extends VisualVertex,​E extends VisualEdge<V>>
        Returns:
        an optional edge shape transformer
      • getEdgeLabelRenderer

        public edu.uci.ics.jung.visualization.renderers.Renderer.EdgeLabel<V,​E> getEdgeLabelRenderer()
        Description copied from interface: VisualGraphLayout
        Returns an optional custom edge label renderer. This is used to add labels to the edges.
        Specified by:
        getEdgeLabelRenderer in interface VisualGraphLayout<V extends VisualVertex,​E extends VisualEdge<V>>
        Returns:
        an optional renderer
      • setLocation

        public void setLocation​(V v,
                                java.awt.geom.Point2D location)
        Specified by:
        setLocation in interface edu.uci.ics.jung.algorithms.layout.Layout<V extends VisualVertex,​E extends VisualEdge<V>>