protected float _distance(double x,double y){
  float distance=Float.POSITIVE_INFINITY;
  GeneralPath shape=getShape();
  if (getNeedToRegenerate() || shape == null) {
    return distance;
  }
  if (shape.contains(x,y)) {
    return 0f;
  }
 else {
    return distanceToEdge(x,y);
  }
}

protected float _distance ( double x , double y ) { float distance = Float . POSITIVE_INFINITY ; GeneralPath shape = getShape ( ) ; if ( getNeedToRegenerate ( ) || shape == null ) { return distance ; } if ( shape . contains ( x , y ) ) { return 0f ; } else { return distanceToEdge ( x , y ) ; } }
return the shortest distance from the graphic to an xy - point . checks to see of the point is contained within the omgraphic , which may , or may not be the right thing for clear omgraphics or lines . < p > _distance was added so subclasses could make this call if their geometries / attributes require this action ( when fill color doesn ' t matter ) .
