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 #808 (closed enhancement: fixed)

Opened 2011-10-10T11:00:37-05:00

Last modified 2011-10-17T11:04:04-05:00

Add Event Handling Priority/Ordering

Reported by: gharris Owned by: gharris
Priority: major Milestone: imagej2-b1-initial
Component: Event Framework Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Add ability to set the order/priority of event handlers

Global tools should be lower down in the chain so that specific tools can override how an event is handled.

For example, the display of pixel values in the status bar (by globak tool PixelProbe) should be overridden to show the (x,y, w, h) when dragging to create a figure (e.g. Rectangle Tool).

Change History

comment:1 Changed 2011-10-17T11:01:16-05:00 by gharris

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

All the event handling methods in ITool/AbstractTool return a boolean indicating whether the event should be consumed or passed down the chain.

Assuming such methods return true for 'consume the event', in ToolService each of the EventSubscribers do something like this:

public void onEvent(final MsReleasedEvent event) {

if(getActiveTool().onMouseUp(event)) return;
for (final ITool tool : getGlobalTools()) {

tool.onMouseUp(event);

}

}


comment:2 Changed 2011-10-17T11:04:04-05:00 by gharris

Created new ticket #827 for remaining issue re: Fix Event Handling in JHotDrawImageCanvas