Quantcast

Two column dialog layout

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Two column dialog layout

Michael Doube
Dear all

I have a GenericDialog that is getting too tall to fit on smaller
notebook monitors (mine is 1280 x 800 pixels) because of the large
number of options it contains.

Is there a simple way to split the dialog into a two-column layout?

Plugin examples and pointers to code would be appreciated.

Michael
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Curtis Rueden
Hi Michael,

Is there a simple way to split the dialog into a two-column layout?
>

You can do it, but it involves some legwork. What we do is to first build up
the GenericDialog with calls to addCheckbox, etc., and then when finished,
strip off all the GUI components and rebuild using a better layout manager.

Here is a (rather complex) example of how we rebuild the main Bio-Formats
Importer dialog to have two columns, divided into sections, with context
help:
https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/loci-plugins/src/loci/plugins/in/MainDialog.java?rev=6247#L208

We also add scroll bars to the generic dialog, in case the screen is too
small, like so:
https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/loci-plugins/src/loci/plugins/util/WindowTools.java?rev=6229#L67

For now this code is GPL, but we will have a BSD version before the end of
the year. In any case, please feel free to use the WindowTools.addScrollBars
code for whatever you want in your own project, if it is useful to you.

HTH,
Curtis

On Mon, May 10, 2010 at 6:33 AM, Michael Doube <[hidden email]>wrote:

> Dear all
>
> I have a GenericDialog that is getting too tall to fit on smaller notebook
> monitors (mine is 1280 x 800 pixels) because of the large number of options
> it contains.
>
> Is there a simple way to split the dialog into a two-column layout?
>
> Plugin examples and pointers to code would be appreciated.
>
> Michael
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Zwick, Ari A.
In reply to this post by Michael Doube
Hi Michael,

Maybe I'm not thinking about this right, but a simple way might just be
to divide everything into subfolders.  I downloaded a package of plugins
that wouldn't display entirely in 1 column, so I just turned it into 2
folders so that I could see everything.  I don't know if that would help
you with this, but it takes just seconds!

Ari

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Doube
Sent: Monday, May 10, 2010 6:34 AM
To: [hidden email]
Subject: Two column dialog layout

Dear all

I have a GenericDialog that is getting too tall to fit on smaller
notebook monitors (mine is 1280 x 800 pixels) because of the large
number of options it contains.

Is there a simple way to split the dialog into a two-column layout?

Plugin examples and pointers to code would be appreciated.

Michael
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

BenTupper
In reply to this post by Michael Doube
Hi,

On May 10, 2010, at 7:33 AM, Michael Doube wrote:

> Dear all
>
> I have a GenericDialog that is getting too tall to fit on smaller  
> notebook monitors (mine is 1280 x 800 pixels) because of the large  
> number of options it contains.
>
> Is there a simple way to split the dialog into a two-column layout?
>
> Plugin examples and pointers to code would be appreciated.
>

I think you can use addPanel of the GenericDialog class create  
multiple columns. See http://rsb.info.nih.gov/ij/plugins/dialog-grid.html

Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

dscho
Hi,

On Mon, 10 May 2010, Ben Tupper wrote:

> On May 10, 2010, at 7:33 AM, Michael Doube wrote:
>
> >I have a GenericDialog that is getting too tall to fit on smaller
> >notebook monitors (mine is 1280 x 800 pixels) because of the large
> >number of options it contains.
> >
> >Is there a simple way to split the dialog into a two-column layout?
> >
> >Plugin examples and pointers to code would be appreciated.
> >
>
> I think you can use addPanel of the GenericDialog class create multiple
> columns. See http://rsb.info.nih.gov/ij/plugins/dialog-grid.html

Note that one of the biggest benefits of GenericDialogs is lost that way:
the recordability.

The way Curtis described it (i.e. how Bio-Formats does it), keeps the
recordability: it starts out as if it were a classical GenericDialog, then
reorders all the components into two columns.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Michael Doube
On May 10, 2010, at 7:33 AM, Michael Doube wrote:

> Dear all
>
> I have a GenericDialog that is getting too tall to fit on smaller
> notebook monitors (mine is 1280 x 800 pixels) because of the large
> number of options it contains.
>
> Is there a simple way to split the dialog into a two-column layout?
>
> Plugin examples and pointers to code would be appreciated.

You can display dialog options in multiple columns by using a checkbox group. In v1.44a and later you can add headings to the columns. There is an example at

      http://rsbweb.nih.gov/ij/plugins/multi-column-dialog/index.html

-wayne
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Md Tamjidul Hoque
Dear Wayne

           the arrangement seems arranged column-wise sequentially -
then how can we arrange, 1st column with 3 rows and 2nd with 4 rows?

           The only option I see is to place the column (or group) with
maximum row at first and ... is it so?

Thanks
Tamjid

Rasband, Wayne (NIH/NIMH) [E] wrote:

> On May 10, 2010, at 7:33 AM, Michael Doube wrote:
>
>  
>> Dear all
>>
>> I have a GenericDialog that is getting too tall to fit on smaller
>> notebook monitors (mine is 1280 x 800 pixels) because of the large
>> number of options it contains.
>>
>> Is there a simple way to split the dialog into a two-column layout?
>>
>> Plugin examples and pointers to code would be appreciated.
>>    
>
> You can display dialog options in multiple columns by using a checkbox group. In v1.44a and later you can add headings to the columns. There is an example at
>
>       http://rsbweb.nih.gov/ij/plugins/multi-column-dialog/index.html
>
> -wayne
>
>  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Rasband, Wayne (NIH/NIMH) [E]
On May 12, 2010, at 12:46 AM, Md Tamjidul Hoque wrote:

> Dear Wayne
>
>           the arrangement seems arranged column-wise sequentially -
> then how can we arrange, 1st column with 3 rows and 2nd with 4 rows?
>
>           The only option I see is to place the column (or group) with
> maximum row at first and ... is it so?

Set the label for the last checkbox in the first column to "" and that position will be left blank. The example plugin at

     http://rsbweb.nih.gov/ij/plugins/multi-column-dialog/index.html

now has a checkbox group with three checkboxes in the first column and four in the second. You will need to be running the 1.44a11 daily build for this feature to work. The daily build also works around a bug on Linux that caused the labels in checkbox groups to be centered rather than left justified.

-wayne
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Two column dialog layout

Md Tamjidul Hoque
Rasband, Wayne (NIH/NIMH) [E] wrote:

> On May 12, 2010, at 12:46 AM, Md Tamjidul Hoque wrote:
>
>  
>> Dear Wayne
>>
>>           the arrangement seems arranged column-wise sequentially -
>> then how can we arrange, 1st column with 3 rows and 2nd with 4 rows?
>>
>>           The only option I see is to place the column (or group) with
>> maximum row at first and ... is it so?
>>    
>
> Set the label for the last checkbox in the first column to "" and that position will be left blank. The example plugin at
>
>      http://rsbweb.nih.gov/ij/plugins/multi-column-dialog/index.html
>
> now has a checkbox group with three checkboxes in the first column and four in the second. You will need to be running the 1.44a11 daily build for this feature to work. The daily build also works around a bug on Linux that caused the labels in checkbox groups to be centered rather than left justified.
>
> -wayne
>
>  

Great! - thanks Wayne.
- Tamjid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Transparent Window

vischer
Hello All,

is it possible to create a transparent window in Java so that the content of an other application becomes visible? I would like to make the live image of any foreign image acquisition program shine through.
So far, I succeeded to periodically copying part of the screen to my ImageJ window using the robot function. It works nicely, but it is a mirroring technique where the image will be displayed twice on the screen. This is a disadvantage especially if there is only one screen.
So before I continue with my mirroring technique: can I make a window completely transparent and still paint onto it?

Norbert Vischer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sequence of colors in hyperstack viewer

Peter Haub
Dear List,

is there an easy way to change the default color sequence
(Red-Green-Blue) in the hyperstack viewer.
I do not want to change the image content but just the channel LUT.
Is there an interactive way to do this or can I change the LUT per
channel programmatically?

Thanks
Peter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transparent Window

dscho
In reply to this post by vischer
Hi Norbert,

On Fri, 23 Mar 2012, Norbert Vischer wrote:

> is it possible to create a transparent window in Java so that the
> content of an other application becomes visible? I would like to make
> the live image of any foreign image acquisition program shine through.
> So far, I succeeded to periodically copying part of the screen to my
> ImageJ window using the robot function. It works nicely, but it is a
> mirroring technique where the image will be displayed twice on the
> screen. This is a disadvantage especially if there is only one screen.
> So before I continue with my mirroring technique: can I make a window
> completely transparent and still paint onto it?

Maybe this helps?

        http://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html

It requires Java 6 Update 10 or later, though.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sequence of colors in hyperstack viewer

Curtis Rueden
In reply to this post by Peter Haub
Hi Peter,

is there an easy way to change the default color sequence (Red-Green-Blue)
> in the hyperstack viewer.
> I do not want to change the image content but just the channel LUT.
> Is there an interactive way to do this or can I change the LUT per channel
> programmatically?
>

Here is a macro that updates a color image to display as BGR:

run("Make Composite");
Stack.setChannel(1);
run("Blue");
Stack.setChannel(2);
run("Green");
Stack.setChannel(3);
run("Red");

Once you have a composite image (Image > Color > Make Composite) you can
change the LUT for the selected channel by using the Image > Lookup Tables
menu.

HTH,
Curtis


On Fri, Mar 23, 2012 at 9:36 AM, Peter Haub <[hidden email]> wrote:

> Dear List,
>
> is there an easy way to change the default color sequence (Red-Green-Blue)
> in the hyperstack viewer.
> I do not want to change the image content but just the channel LUT.
> Is there an interactive way to do this or can I change the LUT per channel
> programmatically?
>
> Thanks
> Peter
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sequence of colors in hyperstack viewer

Peter Haub
Dear Curtis,
Thanks for your help.
It so easy  :-) (-:
Peter

On 23.03.2012 19:48, Curtis Rueden wrote:

> Hi Peter,
>
> is there an easy way to change the default color sequence (Red-Green-Blue)
>> in the hyperstack viewer.
>> I do not want to change the image content but just the channel LUT.
>> Is there an interactive way to do this or can I change the LUT per channel
>> programmatically?
>>
> Here is a macro that updates a color image to display as BGR:
>
> run("Make Composite");
> Stack.setChannel(1);
> run("Blue");
> Stack.setChannel(2);
> run("Green");
> Stack.setChannel(3);
> run("Red");
>
> Once you have a composite image (Image>  Color>  Make Composite) you can
> change the LUT for the selected channel by using the Image>  Lookup Tables
> menu.
>
> HTH,
> Curtis
>
>
> On Fri, Mar 23, 2012 at 9:36 AM, Peter Haub<[hidden email]>  wrote:
>
>> Dear List,
>>
>> is there an easy way to change the default color sequence (Red-Green-Blue)
>> in the hyperstack viewer.
>> I do not want to change the image content but just the channel LUT.
>> Is there an interactive way to do this or can I change the LUT per channel
>> programmatically?
>>
>> Thanks
>> Peter
>>
Loading...