|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.visualization.picking.ClosestShapePickSupport<V,E>
public class ClosestShapePickSupport<V,E>
A GraphElementAccessor
that finds the closest element to
the pick point, and returns it if it is within the element's shape.
This is best suited to elements with convex shapes that do not overlap.
It differs from ShapePickSupport
in that it only checks
the closest element to see whether it contains the pick point.
Possible unexpected odd behaviors:
null
even if the pick point is inside some element's shape, if the pick point is closer
to the center of another element.
ShapePickSupport
instead, which is slower but more flexible. If neither of the above conditions
(overlapping elements or non-convex shapes) is true, then ShapePickSupport
and this class should have the same behavior.
Field Summary | |
---|---|
protected float |
pickSize
|
protected VisualizationServer<V,E> |
vv
|
Constructor Summary | |
---|---|
ClosestShapePickSupport(VisualizationServer<V,E> vv)
Create a ShapePickSupport with the vv
VisualizationServer and default pick footprint. |
|
ClosestShapePickSupport(VisualizationServer<V,E> vv,
float pickSize)
Creates a ShapePickSupport for the vv
VisualizationServer, with the specified pick footprint. |
Method Summary | |
---|---|
E |
getEdge(Layout<V,E> layout,
double x,
double y)
Returns an edge which is associated with the location (x,y) . |
V |
getVertex(Layout<V,E> layout,
double x,
double y)
Returns a vertex which is associated with the location (x,y) . |
Collection<V> |
getVertices(Layout<V,E> layout,
Shape rectangle)
Returns the vertices contained within rectangle relative
to layout . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected VisualizationServer<V,E> vv
protected float pickSize
Constructor Detail |
---|
public ClosestShapePickSupport(VisualizationServer<V,E> vv, float pickSize)
ShapePickSupport
for the vv
VisualizationServer, with the specified pick footprint.
The VisualizationServer
is used to fetch the current
Layout
.
vv
- source of the current Layout
.pickSize
- the size of the pick footprint for line edgespublic ClosestShapePickSupport(VisualizationServer<V,E> vv)
ShapePickSupport
with the vv
VisualizationServer and default pick footprint.
The footprint defaults to 2.
Method Detail |
---|
public E getEdge(Layout<V,E> layout, double x, double y)
GraphElementAccessor
(x,y)
. This is typically determined
with respect to the edge's location as specified
by a Layout
.
getEdge
in interface GraphElementAccessor<V,E>
GraphElementAccessor.getEdge(edu.uci.ics.jung.algorithms.layout.Layout, double, double)
public V getVertex(Layout<V,E> layout, double x, double y)
GraphElementAccessor
(x,y)
. This is typically determined
with respect to the vertex's location as specified
by a Layout
.
getVertex
in interface GraphElementAccessor<V,E>
GraphElementAccessor.getVertex(edu.uci.ics.jung.algorithms.layout.Layout, double, double)
public Collection<V> getVertices(Layout<V,E> layout, Shape rectangle)
GraphElementAccessor
rectangle
relative
to layout
.
getVertices
in interface GraphElementAccessor<V,E>
GraphElementAccessor.getVertices(edu.uci.ics.jung.algorithms.layout.Layout, java.awt.Shape)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |