Login  Register

Re: Two imagePlus in one window

Posted by Abderahmane Habaieb on Jul 16, 2014; 1:47pm
URL: http://imagej.273.s1.nabble.com/Two-imagePlus-in-one-window-tp5008665p5008775.html

Thank you Jay for your answer,

I preferred to use SyncWindows but in a non conventional way. I didn't want to have the SyncWindow GUI (the little form with list and checkboxes), so I tried to extend from SyncWindows. It is now something like that :

import ij.ImagePlus;
import ij.WindowManager;
import ij.gui.ImageWindow;
import ij.plugin.frame.SyncWindows;

public class CustomSyncWindows extends SyncWindows {
    public CustomSyncWindows() {
        super();
        this.close();
    }
   
    public void addWindows(int ID) {
        ImagePlus imp;
        ImageWindow iw;
        imp = WindowManager.getImage(ID);
        if (imp != null) {
            iw = imp.getWindow();
            iw.getCanvas().addMouseMotionListener(this);
            iw.getCanvas().addMouseListener(this);
        }
    }
}

The addWindows function is somewhat odd because the original SyncWindows' addWindows function is private, so I managed to reproduce its behavior but it still doesn't work :(

Any idea about how to do it ?

Thank you :D