if (!cycleGeom) {
SimpleFeatureType featureType = editLayer.getSchema();
GeometryDescriptor defaultGeometryType = featureType.getGeometryDescriptor();
Class< ? > type = defaultGeometryType.getType().getBinding();
boolean polygonLayer=Polygon.class.isAssignableFrom(type) || MultiPolygon.class.isAssignableFrom(type);
ClosestEdge edge = geom.getShell().getClosestEdge(Point.valueOf(e.x, e.y), polygonLayer);
if (edge != null &&
edge.getDistanceToEdge() <= PreferenceUtil.instance().getVertexRadius()){
return geom.getShell();
}
}
}
if (cycleGeom) //selected geom was the last one, therefore select the first match