public class RadiusGraphElementAccessor<V,E> extends java.lang.Object implements GraphElementAccessor<V,E>
No element will be returned that is farther away than the specified maximum distance.
| Modifier and Type | Field and Description |
|---|---|
protected double |
maxDistance |
| Constructor and Description |
|---|
RadiusGraphElementAccessor()
Creates an instance with an effectively infinite default maximum distance.
|
RadiusGraphElementAccessor(double maxDistance)
Creates an instance with the specified default maximum distance.
|
| Modifier and Type | Method and Description |
|---|---|
E |
getEdge(Layout<V,E> layout,
double x,
double y)
Gets the edge nearest to the location of the (x,y) location selected.
|
E |
getEdge(Layout<V,E> layout,
double x,
double y,
double maxDistance)
Gets the edge nearest to the location of the (x,y) location selected,
within a distance of maxDistance, Iterates through all
visible edges and checks their distance from the click.
|
V |
getVertex(Layout<V,E> layout,
double x,
double y)
Gets the vertex nearest to the location of the (x,y) location selected,
within a distance of maxDistance.
|
V |
getVertex(Layout<V,E> layout,
double x,
double y,
double maxDistance)
Gets the vertex nearest to the location of the (x,y) location selected,
within a distance of maxDistance.
|
java.util.Collection<V> |
getVertices(Layout<V,E> layout,
java.awt.Shape rectangle)
Returns the vertices contained within
rectangle relative
to layout. |
public RadiusGraphElementAccessor()
public RadiusGraphElementAccessor(double maxDistance)
public V getVertex(Layout<V,E> layout, double x, double y)
getVertex in interface GraphElementAccessor<V,E>public V getVertex(Layout<V,E> layout, double x, double y, double maxDistance)
x - y - maxDistance - temporarily overrides member maxDistancepublic java.util.Collection<V> getVertices(Layout<V,E> layout, java.awt.Shape rectangle)
GraphElementAccessorrectangle relative
to layout.getVertices in interface GraphElementAccessor<V,E>public E getEdge(Layout<V,E> layout, double x, double y)
getEdge in interface GraphElementAccessor<V,E>public E getEdge(Layout<V,E> layout, double x, double y, double maxDistance)
x - y - maxDistance - temporarily overrides member maxDistanceCopyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence