Login  Register

Changing multipoint tool behavior

Posted by David Kysela on May 21, 2018; 10:27pm
URL: http://imagej.273.s1.nabble.com/Changing-multipoint-tool-behavior-tp5020693.html

My plugin generates multipoint selections that require interactive adjustment by the user. Currently, I simply let the user select the default multipoint tool and drag around the points. However, if a user inadvertently clicks just outside of a point, a new point selection is created and the existing multipoint selection is lost.

Is there a way to basically clone the multipoint tool in such a way that its behavior is limited to dragging existing points? I've dug around a bit, but honestly I just can't wrap my head around how the multipoint tool is implemented. I did find info on extending the PlugInTool class, but it seems prudent to try extending the multipoint tool itself and simply overriding undesirable behaviors. Or at least if I have a better understanding of the multipoint tool, I may be able to develop my own PlugInTool to do what I've described.

Along similar lines, is there a way to automatically activate such a tool via my plugin, then revert to the previously selected ImageJ tool upon exiting my plugin?

Thanks,
Dave

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html