Ticket #897 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

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

Description

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 7 years ago by curtis

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

comment:2 Changed 7 years ago by curtis

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

comment:3 Changed 7 years ago by curtis

  • Blocking 1357 added

comment:4 Changed 7 years ago by curtis

  • Blocking 1052 removed

comment:5 Changed 6 years ago by curtis

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

comment:6 Changed 6 years ago 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 6 years ago 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 6 years ago 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 5 years ago 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.)

Note: See TracTickets for help on using tickets.