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>
-
- All Implemented Interfaces:
edu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,E>
public class ViewLensShapePickSupport<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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.uci.ics.jung.visualization.picking.ShapePickSupport
ShapePickSupport.Style
-
-
Field Summary
-
Fields inherited from class edu.uci.ics.jung.visualization.picking.ShapePickSupport
pickSize, style, vv
-
-
Constructor Summary
Constructors Constructor Description ViewLensShapePickSupport(VisualizationServer<V,E> vv)
Create an instance.ViewLensShapePickSupport(VisualizationServer<V,E> vv, float pickSize)
Create an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.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.-
Methods inherited from class edu.uci.ics.jung.visualization.picking.ShapePickSupport
edgesAreFiltered, getFilteredEdges, getFilteredVertices, getPickSize, getStyle, isEdgeRendered, isVertexRendered, setPickSize, setStyle, verticesAreFiltered
-
-
-
-
Constructor Detail
-
ViewLensShapePickSupport
public ViewLensShapePickSupport(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
-
ViewLensShapePickSupport
public ViewLensShapePickSupport(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.
-
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 interfaceedu.uci.ics.jung.algorithms.layout.GraphElementAccessor<V,E>
- Overrides:
getVertices
in classShapePickSupport<V,E>
- Returns:
- the
Collection
of vertices whoselayout
coordinates are contained inshape
.
-
-