public class RadiusGraphElementAccessor extends java.lang.Object implements GraphElementAccessor
Modifier and Type | Field and Description |
---|---|
protected Layout |
layout |
protected double |
maxDistance |
Constructor and Description |
---|
RadiusGraphElementAccessor(Layout l) |
RadiusGraphElementAccessor(Layout l,
double maxDistance) |
Modifier and Type | Method and Description |
---|---|
Edge |
getEdge(double x,
double y)
Gets the edge nearest to the location of the (x,y) location selected.
|
Edge |
getEdge(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.
|
Vertex |
getVertex(double x,
double y)
Gets the vertex nearest to the location of the (x,y) location selected,
within a distance of maxDistance.
|
Vertex |
getVertex(double x,
double y,
double maxDistance)
Gets the vertex nearest to the location of the (x,y) location selected,
within a distance of maxDistance.
|
void |
setLayout(Layout l)
Sets the
Layout that is used to specify the locations
of vertices and edges in this instance to layout . |
protected Layout layout
protected double maxDistance
public RadiusGraphElementAccessor(Layout l)
public RadiusGraphElementAccessor(Layout l, double maxDistance)
public Vertex getVertex(double x, double y)
getVertex
in interface GraphElementAccessor
public Vertex getVertex(double x, double y, double maxDistance)
x
- y
- maxDistance
- temporarily overrides member maxDistancepublic Edge getEdge(double x, double y)
getEdge
in interface GraphElementAccessor
public Edge getEdge(double x, double y, double maxDistance)
x
- y
- maxDistance
- temporarily overrides member maxDistancepublic void setLayout(Layout l)
GraphElementAccessor
Layout
that is used to specify the locations
of vertices and edges in this instance to layout
.setLayout
in interface GraphElementAccessor