Class ViewLensShapePickSupport<V,E>

java.lang.Object
edu.uci.ics.jung.visualization.picking.ShapePickSupport<V,E>
edu.uci.ics.jung.visualization.picking.ViewLensShapePickSupport<V,E>
Type Parameters:
V - the vertex type
E - the edge type
All Implemented Interfaces:
GraphElementAccessor<V,E>

public class ViewLensShapePickSupport<V,E> extends ShapePickSupport<V,E> implements GraphElementAccessor<V,E>
ShapePickSupport provides access to Vertices and EdgeType based on their actual shapes.
  • Constructor Details

  • Method Details

    • getVertex

      public V getVertex(Layout<V,E> layout, double x, double y)
      Description copied from class: ShapePickSupport
      Returns the vertex, if any, whose shape contains (x, y). If (x,y) is contained in more than one vertex's shape, returns the vertex whose center is closest to the pick point.
      Specified by:
      getVertex in interface GraphElementAccessor<V,E>
      Overrides:
      getVertex in class ShapePickSupport<V,E>
      Parameters:
      layout - the layout instance that records the positions for all vertices
      x - the x coordinate of the pick point
      y - the y coordinate of the pick point
      Returns:
      the vertex whose shape contains (x,y), and whose center is closest to the pick point
    • getVertices

      public Collection<V> getVertices(Layout<V,E> layout, Shape rectangle)
      Description copied from class: ShapePickSupport
      Returns the vertices whose layout coordinates are contained in 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 GraphElementAccessor<V,E>
      Overrides:
      getVertices in class ShapePickSupport<V,E>
      Parameters:
      layout - the layout instance that records the positions for all vertices
      rectangle - the region in which the returned vertices are located
      Returns:
      the Collection of vertices whose layout coordinates are contained in shape.
    • getEdge

      public E getEdge(Layout<V,E> layout, double x, double y)
      Description copied from class: ShapePickSupport
      Returns an edge whose shape intersects the 'pickArea' footprint of the passed x,y, coordinates.
      Specified by:
      getEdge in interface GraphElementAccessor<V,E>
      Overrides:
      getEdge in class ShapePickSupport<V,E>
      Parameters:
      layout - the context in which the location is defined
      x - the x coordinate of the location
      y - the y coordinate of the location
      Returns:
      an edge whose shape intersects the pick area centered on the location (x,y)