Can geotools use shapefiles as boundaries (or exclusion areas) for the mouse's cursor ?
My goal is to draw on a map a trajectory for a vehicle. The user drags the mouse on the map to draw the trajectory (of a car for example). But I don't want the car to go in a river, or a lake or even cross an ocean.
I have found shapefiles representing the continents but I don't know how to tell geotools to not let the mouse step over a shape line while drawing a trajectory.
I am not asking for the code but just an orientation on which tool(s) would allow me to do this, or even if there is something in geotools to do it.
More basically, when the user is pressing the mouse's left button, how can I forbid the mouse to cross a line (or a shape border) ?