Class LayoutLensShapePickSupport<V,​E>

  • All Implemented Interfaces:
    edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,​E>

    public class LayoutLensShapePickSupport<V,​E>
    extends ShapePickSupport<V,​E>
    implements edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,​E>
    ShapePickSupport provides access to Vertices and EdgeType based on their actual shapes.
    • Constructor Detail

      • LayoutLensShapePickSupport

        public LayoutLensShapePickSupport​(VisualizationServer<V,​E> vv,
                                          float pickSize)
        Create an instance. The HasGraphLayout is used as the source of the current Graph Layout. The HasShapes is used to access the VertexShapes and the EdgeShapes
        Parameters:
        hasGraphLayout - source of the current layout.
        hasShapeFunctions - source of Vertex and Edge shapes.
        pickSize - how large to make the pick footprint for line edges
      • LayoutLensShapePickSupport

        public LayoutLensShapePickSupport​(VisualizationServer<V,​E> vv)
        Create an instance. The pickSize footprint defaults to 2.
    • Method Detail

      • getVertex

        public V getVertex​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                           double x,
                           double y)
        Iterates over Vertices, checking to see if x,y is contained in the Vertex's Shape. If (x,y) is contained in more than one vertex, use the vertex whose center is closest to the pick point.
        Specified by:
        getVertex in interface edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,​E>
        Overrides:
        getVertex in class ShapePickSupport<V,​E>
        See Also:
        edu.uci.ics.jung.visualization.picking.PickSupport#getVertex(double, double)
      • getVertices

        public java.util.Collection<V> getVertices​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                                                   java.awt.Shape rectangle)
        returns the vertices that are contained in the passed shape. The shape is in screen coordinates, and the graph vertices are transformed to screen coordinates before they are tested for inclusion
        Specified by:
        getVertices in interface edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,​E>
        Overrides:
        getVertices in class ShapePickSupport<V,​E>
        Returns:
        the Collection of vertices whose layout coordinates are contained in shape.
      • getEdge

        public E getEdge​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> layout,
                         double x,
                         double y)
        return an edge whose shape intersects the 'pickArea' footprint of the passed x,y, coordinates.
        Specified by:
        getEdge in interface edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,​E>
        Overrides:
        getEdge in class ShapePickSupport<V,​E>