Class JungRadiusGraphElementAccessor
- java.lang.Object
-
- repast.simphony.visualization.visualization3D.layout.JungRadiusGraphElementAccessor
-
- All Implemented Interfaces:
JungGraphElementAccessor
public class JungRadiusGraphElementAccessor extends Object implements JungGraphElementAccessor
Returns the vertex or edge that is closest to the specified location. This implementation provides the same picking options that were available in previous versions of AbstractLayout. See JUNG RadiusGraphElementAccessor for further details- Author:
- M. Altaweel
-
-
Field Summary
Fields Modifier and Type Field Description protected JungNetworkLayout
layout
protected double
maxDistance
-
Constructor Summary
Constructors Constructor Description JungRadiusGraphElementAccessor(JungNetworkLayout l)
JungRadiusGraphElementAccessor(JungNetworkLayout l, double maxDistance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepastEdge
getEdge(double x, double y)
Gets the edge nearest to the location of the (x,y) location selected.RepastEdge
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.Object
getVertex(double x, double y)
Gets the vertex nearest to the location of the (x,y) location selected, within a distance of maxDistance.Object
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(JungNetworkLayout l)
Sets theNetwork
that is used to specify the locations of vertices and edges in this instance tolayout
.
-
-
-
Field Detail
-
layout
protected JungNetworkLayout layout
-
maxDistance
protected double maxDistance
-
-
Constructor Detail
-
JungRadiusGraphElementAccessor
public JungRadiusGraphElementAccessor(JungNetworkLayout l)
-
JungRadiusGraphElementAccessor
public JungRadiusGraphElementAccessor(JungNetworkLayout l, double maxDistance)
-
-
Method Detail
-
getVertex
public Object getVertex(double x, double y)
Gets the vertex nearest to the location of the (x,y) location selected, within a distance of maxDistance. Iterates through all visible vertices and checks their distance from the click. Override this method to provde a more efficient implementation.- Specified by:
getVertex
in interfaceJungGraphElementAccessor
-
getVertex
public Object 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. Iterates through all visible vertices and checks their distance from the click. Override this method to provde a more efficient implementation.- Parameters:
x
-y
-maxDistance
- temporarily overrides member maxDistance
-
getEdge
public RepastEdge getEdge(double x, double y)
Gets the edge nearest to the location of the (x,y) location selected. Calls the longer form of the call.- Specified by:
getEdge
in interfaceJungGraphElementAccessor
-
getEdge
public RepastEdge 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. Override this method to provide a more efficient implementation.- Parameters:
x
-y
-maxDistance
- temporarily overrides member maxDistance- Returns:
- Edge closest to the click.
-
setLayout
public void setLayout(JungNetworkLayout l)
Description copied from interface:JungGraphElementAccessor
Sets theNetwork
that is used to specify the locations of vertices and edges in this instance tolayout
.- Specified by:
setLayout
in interfaceJungGraphElementAccessor
-
-