NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #897 (closed defect: fixed)

Opened 2011-12-01T09:05:35-06:00

Last modified 2014-05-10T21:49:37-05:00

Modifiers on MenuItem and Tool Events

Reported by: gharris Owned by: bdezonia
Priority: minor Milestone: imagej2-unscheduled
Component: Other Version:
Severity: minor Keywords:
Cc: Blocked By:
Blocking: #1010, #1631


I’ve come across some IJ1 UI Peculiarities that I’m wondering if we do or should address:
There is at least one case (Histogram) where “an options dialog can be called by holding <Alt> while clicking on the menu item.” Do we have any way to detect this and pass it to the plugin/module? (We don’t yet have option fields defined in the plugin itself, but if we did, such options could appear in an options tab/page or pop-up when <Alt>-clicking on a menu item.)

(Perhaps there is a way using getModifiers() on the ActionEvent generated by the MenuItem being invoked.)

Also, with regard to Tools, “If an ‘Options’ dialog is available for a particular tool, it can be accessed by double clicking
on the tool icon (e.g., Wand Tool).”

Change History

comment:1 Changed 2012-02-26T21:58:04-06:00 by curtis

  • Owner set to curtis
  • Status changed from new to assigned
  • Blocking 1010 added

comment:2 Changed 2012-07-12T17:03:47-05:00 by curtis

  • Blocking 1052 added
  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4

comment:3 Changed 2012-08-03T10:40:27-05:00 by curtis

  • Blocking 1357 added

comment:4 Changed 2012-08-03T10:41:04-05:00 by curtis

  • Blocking 1052 removed

comment:5 Changed 2012-09-07T16:37:24-05:00 by curtis

  • Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0-beta5

comment:6 Changed 2013-01-22T16:35:52-06:00 by bdezonia

  • Blocking 1631 added; 1357 removed
  • Milestone changed from imagej2-b7-ndim-data to imagej2-unscheduled

Note that the tool behavior in IJ2 is that right clicking on a tool icon will bring up it's configure options plugin if one is defined.

Otherwise I'm not sure we need to satisfy this ticket. If plugins that have options provide a Options button that will launch the correct plugin we have all the code we need. Maybe we don't want to complicate our design? Comments?

comment:7 Changed 2013-03-19T10:45:07-05:00 by curtis

  • Owner changed from curtis to bdezonia

In ImageJ1, right-clicking on a tool brings up the context menu allowing you to change to related tools. We have no plans to implement that feature in ImageJ2, preferring all tools have separate, always-visible buttons on the toolbar.

In ImageJ1, double-clicking on a tool brings up its options, if any. It would be nice if ImageJ2 had the same behavior. Having right-click also bring up the options seems fine to me, since it won't do anything else, and gives users another way to quickly find the options without using the Edit > Options menu.

Right now, in my tests, ImageJ2 does not bring up the associated options menu with any combination of left/right clicks and modifiers; I was only able to bring up e.g. the Line Width dialog by choosing Edit > Options > Line Width explicitly.

So in summary, I would say we can close this ticket when both right-click and double-click on a toolbar button brings up its associated options, if any. This should now be doable since we do pass keyboard modifiers with MsEvents on the event bus.

comment:8 Changed 2013-03-19T11:07:18-05:00 by bdezonia

Sounds good.

Note that right click currently does work for those buttons that have defined the configuration method. This is true of brush, spray can, pencil, and bucket.

comment:9 Changed 2014-05-10T21:49:37-05:00 by curtis

  • Status changed from assigned to closed
  • Resolution set to fixed

Regarding modifier keys held during module execution: we now have an InputService which tracks which modifiers are currently being held. That would be sufficient to mimic IJ1's behavior, enabling "secret" behavior when various modifier key combinations are held. (Personally I don't like such secret behavior, but from a technical standpoint, the IJ2 framework makes it possible.)