Login  Register

Re: JAVA - notification that slice changes in Stack

Posted by Wayne Rasband-2 on Oct 05, 2019; 12:49pm
URL: http://imagej.273.s1.nabble.com/JAVA-notification-that-slice-changes-in-Stack-tp5022491p5022493.html

> On Oct 5, 2019, at 12:03 AM, Kenneth Sloan <[hidden email]> wrote:
>
> I'm writing a Java plugin that manages 4 windows.  Two of these are StackWindows.
>
> a) Is there a way to be notified when the user changes slices using the StackWindow controls?

The plugin will be notified when the slice changes if it implements the ImageListener interface. For an example, see the Plugins>Utilities>Monitor events command.

-wayne


> b) If the user has turned on " play" to scroll through slices, can I turn that OFF?
>
> In a similar plugin, written in a different style, I handled this by creating a class
> that extended StackWindow.  That implementations could tell when the slice changed, and
> communicate that to an object handling a paired window.  With 2 windows, this seemed like
> a reasonable idea.  With 4, it seems best to have a controller object which handles all events
> and pushes the results down to the individual windows (2 StackWindows, 2 single-image windows).
>
> But...I can't figure out how to be notified when the user uses the StackWindow controls to
> change slices (either one at a time, or by hitting the "play" button).  I can live with this
> flaw, but I'd prefer to fix it.
>
> I have considered displaying the stacks without the StackWindow scrollbar, but that's too high
> a price to pay.  I *want* the scrollbars, but I also want a notification when a user interaction
> with the scrollbar has caused the displayed slice to change.
>
> The ability to turn off "play" (in response to an event in a different window) would be nice, but
> it's not as important as knowing what the current slice is at all times.
>
> I have been looking at the code for Orthogonal_Views, which has a similar interface.  I have found
> many good ideas there - but I can't find the solution to THIS problem.
>
> Help, please!
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.

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