imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

Add support for ignoring progess bar and status line updates. #203

Open Sethur opened 1 year ago

Sethur commented 1 year ago

I added a flag for ignoring all subsequent status line and progress bar updates in IJ.java.

The motivation was that currently, when calling/running any plugin A from within another plugin B, and A writes its own updates to the status line or progress bar, there can be the following issues:

I tried "protecting" the status bar by posting messages beginning with !, but this will get deactivated across threads. When it comes to the progress bar, I tried to call the setBatchMode(...) method of the main ProgressBar instance manually, but this will get deactivated if any thread was calling IJ.showProgress(int currentIndex, int lastIndex) with currentIndex == lastIndex.

As a conclusion, there really is no good method of preventing other plugins from cluttering the progress bar and status line, so I thought it would be cleaner to introduce this flag.