}
protected GraphZone getLinkAt(double x,double y,Iterator i){
double delta=config.getSelectionSquare();
double flatness=config.getLinkFlatness();
Rectangle2D selectionZone=(delta==0)?null:new Rectangle2D.Double(x-delta,y-delta,2*delta+1,2*delta+1);
GraphicDependency dependency;
while(i.hasNext()){
dependency=(GraphicDependency)i.next();
if (selectionZone==null&&dependency.getPath().contains(x,y)) return dependency==null?null:new GraphZone(dependency);
else if (selectionZone!=null){
int segType;
double lx=-1;
double ly=-1;
for (PathIterator j=(flatness<=0)?dependency.getPath().getPathIterator(null):dependency.getPath().getPathIterator(null,flatness);!j.isDone();j.next()){
switch (j.currentSegment(segment)) {
case PathIterator.SEG_LINETO:
//case PathIterator.SEG_CLOSE:
if (Line2D.ptSegDist(lx,ly,segment[0],segment[1],x,y)<=delta)
return dependency==null?null:new GraphZone(dependency);