|
||||||||||
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.ShapePickSupport<V,E>
public class ShapePickSupport<V,E>
A GraphElementAccessor
that returns elements whose Shape
contains the specified pick point or region.
Nested Class Summary | |
---|---|
static class |
ShapePickSupport.Style
The available picking heuristics: Style.CENTERED : returns the element whose
center is closest to the pick point. |
Field Summary | |
---|---|
protected float |
pickSize
|
protected ShapePickSupport.Style |
style
The current picking heuristic for this instance. |
protected VisualizationServer<V,E> |
vv
The VisualizationServer in which the
this instance is being used for picking. |
Constructor Summary | |
---|---|
ShapePickSupport(VisualizationServer<V,E> vv)
Create a ShapePickSupport for the specified
VisualizationServer with a default pick footprint. |
|
ShapePickSupport(VisualizationServer<V,E> vv,
float pickSize)
Creates a ShapePickSupport for the vv
VisualizationServer, with the specified pick footprint and
the default pick style. |
Method Summary | |
---|---|
protected boolean |
edgesAreFiltered()
Quick test to allow optimization of getFilteredEdges() . |
E |
getEdge(Layout<V,E> layout,
double x,
double y)
Returns an edge whose shape intersects the 'pickArea' footprint of the passed x,y, coordinates. |
protected Collection<E> |
getFilteredEdges(Layout<V,E> layout)
|
protected Collection<V> |
getFilteredVertices(Layout<V,E> layout)
|
float |
getPickSize()
Returns the size of the edge picking area. |
ShapePickSupport.Style |
getStyle()
Returns the style of picking used by this instance. |
V |
getVertex(Layout<V,E> layout,
double x,
double y)
Iterates over Vertices, checking to see if x,y is contained in the Vertex's Shape. |
Collection<V> |
getVertices(Layout<V,E> layout,
Shape shape)
Returns the vertices whose layout coordinates are contained in Shape . |
protected boolean |
isEdgeRendered(Context<Graph<V,E>,E> context)
Returns true if this edge and its endpoints
in this graph are all included in the collections of
elements to be rendered, and false otherwise. |
protected boolean |
isVertexRendered(Context<Graph<V,E>,V> context)
Returns true if this vertex in this graph is included
in the collections of elements to be rendered, and false otherwise. |
void |
setPickSize(float pickSize)
Sets the size of the edge picking area. |
void |
setStyle(ShapePickSupport.Style style)
Specifies the style of picking to be used by this instance. |
protected boolean |
verticesAreFiltered()
Quick test to allow optimization of getFilteredVertices() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected float pickSize
protected VisualizationServer<V,E> vv
VisualizationServer
in which the
this instance is being used for picking. Used to
retrieve properties such as the layout, renderer,
vertex and edge shapes, and coordinate transformations.
protected ShapePickSupport.Style style
CENTERED
.
Constructor Detail |
---|
public ShapePickSupport(VisualizationServer<V,E> vv, float pickSize)
ShapePickSupport
for the vv
VisualizationServer, with the specified pick footprint and
the default pick style.
The VisualizationServer
is used to access
properties of the current visualization (layout, renderer,
coordinate transformations, vertex/edge shapes, etc.).
vv
- source of the current Layout
.pickSize
- the size of the pick footprint for line edgespublic ShapePickSupport(VisualizationServer<V,E> vv)
ShapePickSupport
for the specified
VisualizationServer
with a default pick footprint.
of size 2.
Method Detail |
---|
public ShapePickSupport.Style getStyle()
Style.CENTERED
: returns the element whose
center is closest to the pick point.
Style.LOWEST
: returns the first such element
encountered. (If the element collection has a consistent
ordering, this will also be the element "on the bottom",
that is, the one which is rendered first.)
Style.HIGHEST
: returns the last such element
encountered. (If the element collection has a consistent
ordering, this will also be the element "on the top",
that is, the one which is rendered last.)
public void setStyle(ShapePickSupport.Style style)
Style.CENTERED
: returns the element whose
center is closest to the pick point.
Style.LOWEST
: returns the first such element
encountered. (If the element collection has a consistent
ordering, this will also be the element "on the bottom",
that is, the one which is rendered first.)
Style.HIGHEST
: returns the last such element
encountered. (If the element collection has a consistent
ordering, this will also be the element "on the top",
that is, the one which is rendered last.)
style
- the style to setpublic V getVertex(Layout<V,E> layout, double x, double y)
getVertex
in interface GraphElementAccessor<V,E>
edu.uci.ics.jung.visualization.picking.PickSupport#getVertex(double, double)
public Collection<V> getVertices(Layout<V,E> layout, Shape shape)
Shape
.
The shape is in screen coordinates, and the graph vertices
are transformed to screen coordinates before they are tested
for inclusion.
getVertices
in interface GraphElementAccessor<V,E>
Collection
of vertices whose layout
coordinates are contained in shape
.public E getEdge(Layout<V,E> layout, double x, double y)
getEdge
in interface GraphElementAccessor<V,E>
protected Collection<V> getFilteredVertices(Layout<V,E> layout)
layout
-
protected Collection<E> getFilteredEdges(Layout<V,E> layout)
layout
-
protected boolean verticesAreFiltered()
getFilteredVertices()
.
true
if there is an active vertex filtering
mechanism for this visualization, false
otherwiseprotected boolean edgesAreFiltered()
getFilteredEdges()
.
true
if there is an active edge filtering
mechanism for this visualization, false
otherwiseprotected boolean isVertexRendered(Context<Graph<V,E>,V> context)
true
if this vertex in this graph is included
in the collections of elements to be rendered, and false
otherwise.
context
- the vertex and graph to be queried
true
if this vertex is
included in the collections of elements to be rendered, false
otherwise.protected boolean isEdgeRendered(Context<Graph<V,E>,E> context)
true
if this edge and its endpoints
in this graph are all included in the collections of
elements to be rendered, and false
otherwise.
context
- the edge and graph to be queried
true
if this edge and its endpoints are all
included in the collections of elements to be rendered, false
otherwise.public float getPickSize()
public void setPickSize(float pickSize)
the
- length of one side of the (square) picking area, in view coordinates
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |