Class ClosestShapePickSupport<V,E>

java.lang.Object
edu.uci.ics.jung.visualization.picking.ClosestShapePickSupport<V,E>
All Implemented Interfaces:
GraphElementAccessor<V,E>

public class ClosestShapePickSupport<V,E> extends Object implements GraphElementAccessor<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:
  • If the elements overlap, this mechanism may pick another element than the one that's "on top" (rendered last) if the pick point is closer to the center of an obscured vertex.
  • If element shapes are not convex, then this mechanism may return null even if the pick point is inside some element's shape, if the pick point is closer to the center of another element.
Users who want to avoid either of these should use 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.