ImageJ icon indicating copy to clipboard operation
ImageJ copied to clipboard

Add support for ignoring progess bar and status line updates.

Open Sethur opened this issue 2 years ago • 0 comments

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:

  • If B wants to call A in parallel, the status updates of A will mess up the progress bar and status line completely.
  • If B wants to display a total status of some task that involves repeatedly calling A, the progress bar and status line display of A will get in the way, even if B does not employ parallelization.

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.

Sethur avatar Feb 15 '23 11:02 Sethur