saalfeldlab / paintera

GNU General Public License v2.0
99 stars 17 forks source link

Auto-detect ActionType with SciJava plugins #257

Open hanslovsky opened 5 years ago

hanslovsky commented 5 years ago

I am not sure I understand the ActionTypes to 100% yet but it looks to me that they could be auto-detectable. This might be useful for extensibility.

igorpisarev commented 5 years ago

Good point, the default mode where all actions are allowed combines all available ActionsTypes in the map: https://github.com/saalfeldlab/paintera/blob/master/src/main/java/org/janelia/saalfeldlab/paintera/control/actions/AllowedActions.java#L42-L51 which can be simplified with auto-discovery.

However, this ActionType mechanism is a rather hacky design to make shape interpolation mode work properly. It basically allows to block or intercept certain UI actions without having to re-install event handlers. What I don't like about them currently is that they only list actions, but the actions themselves are defined in completely unrelated places. When we get to work on restructuring event handling as part of https://github.com/saalfeldlab/paintera/issues/245, it would probably also be a good time to re-iterate on ActionTypes.