Width of Log window

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Width of Log window

Douglas Benn-2
Can anybody please tell me the correct syntax for setting the width of
the Log window?

 

Thank you.
Reply | Threaded
Open this post in threaded view
|

Width of Log window

Douglas Benn-2
Can anybody please tell me the correct syntax for setting the width of
the Log window?


Thank you.

Douglas Benn
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

Michael Schmid
Hi Douglas,

first you should say whether you write a macro or a plugin.

For macros, see
   http://rsb.info.nih.gov/ij/developer/macro/functions.html

There, you will discover the selectWindow("name") and setLocation(x,  
y, width, height) commands.

For a plugin, java.awt.Window is a subclass of java.awt.Component.
It inherits the setSize(int width, int height) method.
See
   http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html

Michael
________________________________________________________________

On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:

> Can anybody please tell me the correct syntax for setting the width of
> the Log window?
>
>
> Thank you.
>
> Douglas Benn
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

Douglas Benn-2
Hi Michael,

Thank you for your reply.

Yes I am very familiar with the macro functions which I have been using. In
fact I wrote the following code

print("Open Log window");
selectWindow("Log");
setLocation(100,100,800,700);
updateDisplay();
print(".....................................");

The output into the Log was

Open Log window
.....................................


But the size of the window does not increase from the default value. Any
suggestions?

Thanks.

Douglas


On 3/11/10 12:11 PM, "Michael Schmid" <[hidden email]> wrote:

> Hi Douglas,
>
> first you should say whether you write a macro or a plugin.
>
> For macros, see
>    http://rsb.info.nih.gov/ij/developer/macro/functions.html
>
> There, you will discover the selectWindow("name") and setLocation(x,
> y, width, height) commands.
>
> For a plugin, java.awt.Window is a subclass of java.awt.Component.
> It inherits the setSize(int width, int height) method.
> See
>    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html
>
> Michael
> ________________________________________________________________
>
> On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:
>
>> Can anybody please tell me the correct syntax for setting the width of
>> the Log window?
>>
>>
>> Thank you.
>>
>> Douglas Benn

Dr Douglas K Benn, BDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal
College of Radiologists, England).
Professor
Dept of General Dentistry
Creighton University Dental School
2500 California Plaza
Omaha
Nebraska 68178

Tel: (402)280 5025
Fax: (402)280 5094
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

Michael Schmid
Hi Douglas,

hmmm, I see, I should also read the documentation more carefully...

setLocation(x, y, width, height)
Moves and resizes the active *image* window.

Funny enough, this is different from setLocation(x, y), which also  
works with non-image windows. The code in ij.macro.Functions.java  
shows this difference quite clearly.
I fear that this cannot be changed without some risk of breaking  
existing macros that rely on the macro call working on the current  
image window and not on, e.g., a Results window that might be open  
and in front of the image window.

So it seems that you can't resize the Log window in a macro.

Michael
________________________________________________________________

On 11 Mar 2010, at 19:47, Douglas Benn wrote:

> Hi Michael,
>
> Thank you for your reply.
>
> Yes I am very familiar with the macro functions which I have been  
> using. In
> fact I wrote the following code
>
> print("Open Log window");
> selectWindow("Log");
> setLocation(100,100,800,700);
> updateDisplay();
> print(".....................................");
>
> The output into the Log was
>
> Open Log window
> .....................................
>
>
> But the size of the window does not increase from the default  
> value. Any
> suggestions?
>
> Thanks.
>
> Douglas
>
>
> On 3/11/10 12:11 PM, "Michael Schmid" <[hidden email]> wrote:
>
>> Hi Douglas,
>>
>> first you should say whether you write a macro or a plugin.
>>
>> For macros, see
>>    http://rsb.info.nih.gov/ij/developer/macro/functions.html
>>
>> There, you will discover the selectWindow("name") and setLocation(x,
>> y, width, height) commands.
>>
>> For a plugin, java.awt.Window is a subclass of java.awt.Component.
>> It inherits the setSize(int width, int height) method.
>> See
>>    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html
>>
>> Michael
>> ________________________________________________________________
>>
>> On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:
>>
>>> Can anybody please tell me the correct syntax for setting the  
>>> width of
>>> the Log window?
>>>
>>>
>>> Thank you.
>>>
>>> Douglas Benn
>
> Dr Douglas K Benn, BDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal
> College of Radiologists, England).
> Professor
> Dept of General Dentistry
> Creighton University Dental School
> 2500 California Plaza
> Omaha
> Nebraska 68178
>
> Tel: (402)280 5025
> Fax: (402)280 5094
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

vischer
Hi Douglas

you could print to a text window, which accepts width parameter:

see:
http://rsbweb.nih.gov/ij/macros/PrintToTextWindow.txt

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

Douglas Benn-2
In reply to this post by Michael Schmid
Dear Michael,

Thanks very much. I feared as much.

Best wishes.

Douglas

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Schmid
Sent: Thursday, March 11, 2010 3:07 PM
To: [hidden email]
Subject: Re: Width of Log window

Hi Douglas,

hmmm, I see, I should also read the documentation more carefully...

setLocation(x, y, width, height)
Moves and resizes the active *image* window.

Funny enough, this is different from setLocation(x, y), which also  
works with non-image windows. The code in ij.macro.Functions.java  
shows this difference quite clearly.
I fear that this cannot be changed without some risk of breaking  
existing macros that rely on the macro call working on the current  
image window and not on, e.g., a Results window that might be open  
and in front of the image window.

So it seems that you can't resize the Log window in a macro.

Michael
________________________________________________________________

On 11 Mar 2010, at 19:47, Douglas Benn wrote:

> Hi Michael,
>
> Thank you for your reply.
>
> Yes I am very familiar with the macro functions which I have been  
> using. In
> fact I wrote the following code
>
> print("Open Log window");
> selectWindow("Log");
> setLocation(100,100,800,700);
> updateDisplay();
> print(".....................................");
>
> The output into the Log was
>
> Open Log window
> .....................................
>
>
> But the size of the window does not increase from the default  
> value. Any
> suggestions?
>
> Thanks.
>
> Douglas
>
>
> On 3/11/10 12:11 PM, "Michael Schmid" <[hidden email]> wrote:
>
>> Hi Douglas,
>>
>> first you should say whether you write a macro or a plugin.
>>
>> For macros, see
>>    http://rsb.info.nih.gov/ij/developer/macro/functions.html
>>
>> There, you will discover the selectWindow("name") and setLocation(x,
>> y, width, height) commands.
>>
>> For a plugin, java.awt.Window is a subclass of java.awt.Component.
>> It inherits the setSize(int width, int height) method.
>> See
>>    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html
>>
>> Michael
>> ________________________________________________________________
>>
>> On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:
>>
>>> Can anybody please tell me the correct syntax for setting the  
>>> width of
>>> the Log window?
>>>
>>>
>>> Thank you.
>>>
>>> Douglas Benn
>
> Dr Douglas K Benn, BDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal
> College of Radiologists, England).
> Professor
> Dept of General Dentistry
> Creighton University Dental School
> 2500 California Plaza
> Omaha
> Nebraska 68178
>
> Tel: (402)280 5025
> Fax: (402)280 5094
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

Douglas Benn-2
In reply to this post by vischer
Dear Norbert,

Perfect.

Thank you.

Douglas

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Norbert Vischer
Sent: Thursday, March 11, 2010 3:39 PM
To: [hidden email]
Subject: Re: Width of Log window

Hi Douglas

you could print to a text window, which accepts width parameter:

see:
http://rsbweb.nih.gov/ij/macros/PrintToTextWindow.txt

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Width of Log window

jmutterer
In reply to this post by Douglas Benn-2
Douglas,

In you macro, you could use the eval() macro function, with the following
javascript:

eval("script","f =
WindowManager.getFrame('Log'); f.setLocation(0,0); f.setSize(400,300);");


Jerome




On Thu, Mar 11, 2010 at 10:59 PM, Benn, Douglas K. <
[hidden email]> wrote:

> Dear Michael,
>
> Thanks very much. I feared as much.
>
> Best wishes.
>
> Douglas
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Michael Schmid
> Sent: Thursday, March 11, 2010 3:07 PM
> To: [hidden email]
> Subject: Re: Width of Log window
>
> Hi Douglas,
>
> hmmm, I see, I should also read the documentation more carefully...
>
> setLocation(x, y, width, height)
> Moves and resizes the active *image* window.
>
> Funny enough, this is different from setLocation(x, y), which also
> works with non-image windows. The code in ij.macro.Functions.java
> shows this difference quite clearly.
> I fear that this cannot be changed without some risk of breaking
> existing macros that rely on the macro call working on the current
> image window and not on, e.g., a Results window that might be open
> and in front of the image window.
>
> So it seems that you can't resize the Log window in a macro.
>
> Michael
> ________________________________________________________________
>
> On 11 Mar 2010, at 19:47, Douglas Benn wrote:
>
> > Hi Michael,
> >
> > Thank you for your reply.
> >
> > Yes I am very familiar with the macro functions which I have been
> > using. In
> > fact I wrote the following code
> >
> > print("Open Log window");
> > selectWindow("Log");
> > setLocation(100,100,800,700);
> > updateDisplay();
> > print(".....................................");
> >
> > The output into the Log was
> >
> > Open Log window
> > .....................................
> >
> >
> > But the size of the window does not increase from the default
> > value. Any
> > suggestions?
> >
> > Thanks.
> >
> > Douglas
> >
> >
> > On 3/11/10 12:11 PM, "Michael Schmid" <[hidden email]> wrote:
> >
> >> Hi Douglas,
> >>
> >> first you should say whether you write a macro or a plugin.
> >>
> >> For macros, see
> >>    http://rsb.info.nih.gov/ij/developer/macro/functions.html
> >>
> >> There, you will discover the selectWindow("name") and setLocation(x,
> >> y, width, height) commands.
> >>
> >> For a plugin, java.awt.Window is a subclass of java.awt.Component.
> >> It inherits the setSize(int width, int height) method.
> >> See
> >>    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html
> >>
> >> Michael
> >> ________________________________________________________________
> >>
> >> On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:
> >>
> >>> Can anybody please tell me the correct syntax for setting the
> >>> width of
> >>> the Log window?
> >>>
> >>>
> >>> Thank you.
> >>>
> >>> Douglas Benn
> >
> > Dr Douglas K Benn, BDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal
> > College of Radiologists, England).
> > Professor
> > Dept of General Dentistry
> > Creighton University Dental School
> > 2500 California Plaza
> > Omaha
> > Nebraska 68178
> >
> > Tel: (402)280 5025
> > Fax: (402)280 5094
>