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 #1551 (closed defect: fixed)

Opened 2012-10-24T15:30:37-05:00

Last modified 2013-01-18T14:23:27-06:00

Exceptions thrown via color buttons

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-b7-ndim-data
Component: Core Version:
Severity: serious Keywords:
Cc: dscho Blocked By:
Blocking:

Description

In the imagej-devel mailing list Johannes Schindelin reported:

there is a nasty issue with the {Bg,Fg}ColorButton when showing a
stack without calling createUI() since it tries very, very, very hard to always update the button even if the main window was never shown. The stack trace looks like this:

java.lang.IllegalArgumentException: There is no button associated with the specified tool

at imagej.ui.swing.SwingIconService$SwingIconDrawer.<init>(SwingIconService.java:86)
at imagej.ui.swing.SwingIconService.acquireDrawer(SwingIconService.java:68)
at imagej.core.tools.AbstractColorTool.acquireDrawer(AbstractColorTool.java:221)
at imagej.core.tools.AbstractColorTool.draw(AbstractColorTool.java:201)
at imagej.core.tools.AbstractColorTool.drawIcon(AbstractColorTool.java:170)
at imagej.core.tools.AbstractColorTool.onEvent(AbstractColorTool.java:195)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:226)
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:201)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
at imagej.event.DefaultEventBus.access$201(DefaultEventBus.java:61)
at imagej.event.DefaultEventBus$2.run(DefaultEventBus.java:226)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:670)
at java.awt.EventQueue.access$400(EventQueue.java:96)
at java.awt.EventQueue$2.run(EventQueue.java:631)
at java.awt.EventQueue$2.run(EventQueue.java:629)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:640)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

I wonder whether it makes sense to instantiate the ToolsService at all if the main window was not even shown?

See  http://imagej.net/pipermail/imagej-devel/2012-October/001247.html for the full context.

Change History

comment:1 Changed 2013-01-18T14:23:27-06:00 by curtis

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

I just fixed this as part of another bugfix; see 748d7656. It is not a complete and long-term solution, but I filed a separate ticket for that: #1627.