Login  Register

Re: How can I get input from an event handler?

Posted by Avital Steinberg on Aug 19, 2014; 7:27pm
URL: http://imagej.273.s1.nabble.com/How-can-I-get-input-from-an-event-handler-tp5009243p5009276.html

Thank you Bob - I found your comment very helpful!

Avital


On Tue, Aug 19, 2014 at 6:16 AM, Robert Dougherty <[hidden email]> wrote:

> Avital,
>
> > If I would use the code in the link you sent me in one class:
>
> > How would I access offscreenX and offscreenY from another class?
>
> Why not have the "other class" implement the the MouseListener and
> MouseMotionListener interfaces and get the events itself?  You can tell the
> class about the ImagePlus to listen to in various ways, or it might
> discover it for itself with something like
> WindowManager.getCurrentImage().  Alternatively, the other, "processing"
> class could have methods that do something with the mouse coordinates, and
> the class with the MouseListener could invoke these, passing the
> coordinates. This would require the listening class to have a reference
> object in the processing class, somehow.
>
> Bob
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html