[ImageJ-devel] Display lifecycle

Lee Kamentsky leek at broadinstitute.org
Tue Sep 6 11:44:04 CDT 2011


Close to the same mistake is replicated in AbstractSwingUI (it probably 
works, but the cast is dangerous). The code that references 
SwingDisplayWindow in SwingDisplayPanel was added by me today and should 
be removed by Grant. If DisplayWindow has a close() method, then you can 
add a getWindow() method to DisplayPanel so you can get the 
DisplayWindow in a uniform fashion and close it.

IMHO SwingDisplayWindow should be abstract and you should derive SDI and 
MDI versions in the respective packages.

On 9/6/2011 12:34 PM, Curtis Rueden wrote:
> Hi Grant,
>
>     And SwingDisplayWindow should actually be in the Swing-SDI package.
>
>
> Just a heads up: SwingDisplayWindow is referenced in AbstractSwingUI 
> as well as SwingDisplayPanel, both of which are in the 
> ij-ui-swing-base package. It looks like it would be non-trivial to 
> migrate that class into the ij-ui-swing-sdi project.
>
> -Curtis
>
> On Tue, Sep 6, 2011 at 10:30 AM, Grant B. Harris <gharris at mbl.edu 
> <mailto:gharris at mbl.edu>> wrote:
>
>     Lee --
>
>     You have caught an oversight on my part... DisplayWindow should
>     have a close() method.
>     And SwingDisplayWindow should actually be in the Swing-SDI package.
>
>     So, I added a close() method to DisplayWindow and implemented it
>     in the SDI and MDI packages.
>
>     Let me know if this doesn't take care of the problem.
>
>     Grant B. Harris
>     ---------------------------------------------------------
>     Scientific Informatics Analyst, Cellular Dynamics Program
>     Marine Biological Laboratory, Woods Hole, Mass. 02543
>     gharris at mbl.edu  <mailto:gharris at mbl.edu>
>
>
>     On 9/6/2011 10:00 AM, Lee Kamentsky wrote:
>>     Hi Curtis / ImageJ dev. I've gotten CellProfiler to run ImageJ 2
>>     plugins with images. I assume that any Display parameter contains
>>     an image with possible overlay and that input Display parameters
>>     will be modified by the time they are output. The picture below
>>     is the result of running one of the IJ2 shadow commands in
>>     CellProfiler.
>>
>>     I have to fix what looks like a bug in SwingDisplayPanel. In
>>     "close", it assumes that its direct parent is the
>>     SwingDisplayWindow and apparently that's no longer the case. I'd
>>     just like to do this.window.dispose() there. The patch file for
>>     the change is attached, I'll probably just commit it but you guys
>>     should review briefly.
>>
>>     --Lee
>>
>>     (snip)
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110906/4cffa30c/attachment.html>


More information about the ImageJ-devel mailing list