Login  Register

Dialog and image position

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Dialog and image position

sombreroduck
13 posts
Hi,
I am writing a plugin, but at one point the dialog box always lands on top of the image. I've tried using genericDialog's setLocation(x,y) but it is ignored and is always in the same place no matter which (x,y) I use. Does anyone know why? and how I can fix it?
(also, if you know how to set the location of the FFT image on the screen I would be much obliged)

This is the section of relevant code
(back-story: I've just run an FFT which appears in a new window)

[...]
        new WaitForUserDialog("Title", "Draw rectangules around maxima, then click OK.").show();
        fftroi=impFFT.getRoi();
        IJ.run("Find Maxima...", "noise="+noise+" output=[Point Selection] [Exclude edge maxima] [Preview point selection]");

        GenericDialog again = new GenericDialog("Klar?");
        again.setCancelLabel("Scrap");
        again.addMessage("Next area? change noise tolerence? or scrap this one and move on?");
        again.enableYesNoCancel("Next", "Change");
        again.setLocation(100, 300);
        again.showDialog();

        if(again.wasCanceled())  
[etc...]
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Dialog and image position

Michael Schmid
2136 posts
Hi Sombreroduck,

if you don't call the centerDialog(false) method of your GenericDialog, it will be always centered on the screen.

Michael
________________________________________________________________
On Apr 4, 2013, at 12:16, sombreroduck wrote:

> Hi,
> I am writing a plugin, but at one point the dialog box always lands on top
> of the image. I've tried using genericDialog's setLocation(x,y) but it is
> ignored and is always in the same place no matter which (x,y) I use. Does
> anyone know why? and how I can fix it?
> (also, if you know how to set the location of the FFT image on the screen I
> would be much obliged)
>
> This is the section of relevant code
> (back-story: I've just run an FFT which appears in a new window)
>
> [...]
> new WaitForUserDialog("Title", "Draw rectangules around maxima, then click
> OK.").show();
> fftroi=impFFT.getRoi();
> IJ.run("Find Maxima...", "noise="+noise+" output=[Point Selection] [Exclude
> edge maxima] [Preview point selection]");
>
> GenericDialog again = new GenericDialog("Klar?");
> again.setCancelLabel("Scrap");
> again.addMessage("Next area? change noise tolerence? or scrap this one and
> move on?");
> again.enableYesNoCancel("Next", "Change");
> again.setLocation(100, 300);
> again.showDialog();
>
> if(again.wasCanceled())  
> [etc...]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Dialog and image position

sombreroduck
13 posts
Thanks Michael, that's brilliant!  it's much better now!
(at least that little section)     :-)


        )
       (
     ()-()
    _(o o)_
     /\o/\



On 4 April 2013 11:23, Michael Schmid-3 [via ImageJ] <
[hidden email]> wrote:

> Hi Sombreroduck,
>
> if you don't call the centerDialog(false) method of your GenericDialog, it
> will be always centered on the screen.
>
> Michael
> ________________________________________________________________
> On Apr 4, 2013, at 12:16, sombreroduck wrote:
>
> > Hi,
> > I am writing a plugin, but at one point the dialog box always lands on
> top
> > of the image. I've tried using genericDialog's setLocation(x,y) but it
> is
> > ignored and is always in the same place no matter which (x,y) I use.
> Does
> > anyone know why? and how I can fix it?
> > (also, if you know how to set the location of the FFT image on the
> screen I
> > would be much obliged)
> >
> > This is the section of relevant code
> > (back-story: I've just run an FFT which appears in a new window)
> >
> > [...]
> > new WaitForUserDialog("Title", "Draw rectangules around maxima, then
> click
> > OK.").show();
> > fftroi=impFFT.getRoi();
> > IJ.run("Find Maxima...", "noise="+noise+" output=[Point Selection]
> [Exclude
> > edge maxima] [Preview point selection]");
> >
> > GenericDialog again = new GenericDialog("Klar?");
> > again.setCancelLabel("Scrap");
> > again.addMessage("Next area? change noise tolerence? or scrap this one
> and
> > move on?");
> > again.enableYesNoCancel("Next", "Change");
> > again.setLocation(100, 300);
> > again.showDialog();
> >
> > if(again.wasCanceled())
> > [etc...]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://imagej.1557.n6.nabble.com/Dialog-and-image-position-tp5002536p5002537.html
>  To unsubscribe from Dialog and image position, click here<
> .
> NAML<
http://imagej.1557.n6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

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