Posted by
Kurt De Vos on
Dec 21, 2005; 4:29pm
URL: http://imagej.273.s1.nabble.com/Which-Image-tp3704187p3704192.html
I guess you create a new custom window and canvas for each window?
If so you could give those an id and check that in the listener.
kurt
On 21 Dec 2005, at 16:26, Sullivan, Michael J (College of Med.) wrote:
> Wayne, Bob, Thanks for the responses. But I don't know which image/
> canvas the mouse event was triggered from; the mouse listener does
> not seem to be unique to the canvas.
>
> // "this" is the class from which the images are opened.
> preImageCanvas.addMouseListener(this);
> postImageCanvas.addMouseListener(this);
>
> I thought a "focus" test would work but it doesn't or I'm testing
> the wrong thing
>
> --- Mike
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf
> Of Wayne Rasband
> Sent: Tuesday, December 20, 2005 5:47 PM
> To:
[hidden email]
> Subject: Re: Which Image
>
>> hay All! I'm writing a plugin that will have two open images. The
>> two
>> images have the same filename from different folders. I want to
>> trigger an action (roiSave) off of the mouse release that occurs
>> after
>> the drawing of the ROI. How can I identify which image I'm in? Any
>> ideas appreciated -
>> -- Mike
>
> In a macro:
>
> dir = getDirectory("image");
>
> In a plugin:
>
> String dir = IJ.getDirectory("image");
>
> -wayne
*--*--*--*--*--*--*--*--*--*--*--*--*--*
University of Sheffield
Academic Neurology Unit
Division of Genomic Medicine
E Floor, Medical School
Beech Hill Road
Sheffield
S10 2RX
United Kingdom
Tel: ++44 (0) 114 271 2473
Fax: ++44 (0) 114 226 1201
Email:
[hidden email]
*--*--*--*--*--*--*--*--*--*--*--*--*--*