ImageJ - image window

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

ImageJ - image window

Student1
Hi,
I am making a customized GUI for imageJ, where everything is contained within the desktop pane. I want the image window to be an internal frame within my desktop pane. I was wondering if anyone knows how to do this.

Thanks in advance.

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

Re: ImageJ - image window

John Hayes
Hi,

Normally in Java this is done with JDesktopPane, JInternalPane, etc., with Swing: http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-a-virtual-desktop-in-your-applic.html

However, note that ImageJ’s main frame and ImageWindow class are AWT and not Swing, so I think this may be a lot more work than you anticipate.

HTH, and best regards,

John

Le 15 mai 2014 à 17:56, Student1 a écrit :

> Hi,
> I am making a customized GUI for imageJ, where everything is contained within the desktop pane. I want the image window to be an internal frame within my desktop pane. I was wondering if anyone knows how to do this.
>
> Thanks in advance.
>
> Mariam Dost
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: ImageJ - image window

Student1
Hi,
Thank you for such a quick reply. I would still like to attempt this, even though I do know it contains a lot of work. I am just a little unsure on how to actually start this. I have created most of the imageJ functionality like opening, saving, reading, etc interface by myself but the only thing that is of problem is the image window where imageJ displays the image. I don’t know exactly how to start with this. Any help would really be appreciated.  

Thank you.

Mariam Dost


On May 15, 2014, at 10:17 AM, John Hayes <[hidden email]> wrote:

> Hi,
>
> Normally in Java this is done with JDesktopPane, JInternalPane, etc., with Swing: http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-a-virtual-desktop-in-your-applic.html
>
> However, note that ImageJ’s main frame and ImageWindow class are AWT and not Swing, so I think this may be a lot more work than you anticipate.
>
> HTH, and best regards,
>
> John
>
> Le 15 mai 2014 à 17:56, Student1 a écrit :
>
>> Hi,
>> I am making a customized GUI for imageJ, where everything is contained within the desktop pane. I want the image window to be an internal frame within my desktop pane. I was wondering if anyone knows how to do this.
>>
>> Thanks in advance.
>>
>> Mariam Dost
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: ImageJ - image window

John Hayes
Hi,

I believe you will want to copy ij.gui.ImageWindow to something like ij.gui.JInternalImagePane and extend JInternalPane instead of java.awt.Frame. You will also have to make a JImageCanvas that mimics ij.gui.ImageCanvas but as a JCanvas instead of java.awt.Canvas and change the appropriate sections in JInternalImagePane. You’ll also probably have to override the appropriate paint and update methods. Then, you’ll have to have some class that is your main JDesktopPane that would contain the respective JInternalImagePanes (like ij.ImageJ) that you start from your main application.

HTH, and best,

John

Le 15 mai 2014 à 18:27, Student1 a écrit :

> Hi,
> Thank you for such a quick reply. I would still like to attempt this, even though I do know it contains a lot of work. I am just a little unsure on how to actually start this. I have created most of the imageJ functionality like opening, saving, reading, etc interface by myself but the only thing that is of problem is the image window where imageJ displays the image. I don’t know exactly how to start with this. Any help would really be appreciated.  
>
> Thank you.
>
> Mariam Dost
>
>
> On May 15, 2014, at 10:17 AM, John Hayes <[hidden email]> wrote:
>
>> Hi,
>>
>> Normally in Java this is done with JDesktopPane, JInternalPane, etc., with Swing: http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-a-virtual-desktop-in-your-applic.html
>>
>> However, note that ImageJ’s main frame and ImageWindow class are AWT and not Swing, so I think this may be a lot more work than you anticipate.
>>
>> HTH, and best regards,
>>
>> John
>>
>> Le 15 mai 2014 à 17:56, Student1 a écrit :
>>
>>> Hi,
>>> I am making a customized GUI for imageJ, where everything is contained within the desktop pane. I want the image window to be an internal frame within my desktop pane. I was wondering if anyone knows how to do this.
>>>
>>> Thanks in advance.
>>>
>>> Mariam Dost
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: ImageJ - image window

ctrueden
In reply to this post by Student1
Hi Mariam,

> I am making a customized GUI for imageJ, where everything is contained
> within the desktop pane.

Suddenly there are a rash of questions on StackOverflow about this topic
[1]. I'm not sure how many of these are from you, but they have little to
do with ImageJ specifically. They are all just questions about adapting a
fundamentally SDI-based application (java.awt.Frame) to an MDI-based one
(javax.swing.JInternalFrame).

Doing this is a huge endeavor, especially for a junior programmer. You will
need to rewrite substantial portions of the ImageJ 1.x codebase, as it was
never designed to work as anything other than a single SDI AWT-based UI.

You will need to be thoroughly familiar with Java Swing, particularly MDI
and JInternalFrame:
http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html

And unless you invest hundreds or even thousands of hours with an extremely
careful design, you will end up with something that is not backwards
compatible with ImageJ 1.x, and hence does not with the majority of its
plugins. And no matter what you do, some plugins will not work as you want,
because many of them directly rely on the fact that ImageJ1's data
structures are SDI AWT components by nature.

So before charging down this track, I want to ask: what do you really want
to accomplish? Why are you doing this? What is the end goal? How will it
help users?

If you seriously want to redesign ImageJ as an MDI application for some
reason, then I would encourage you to check out ImageJ2:
http://developer.imagej.net/about. One of its primary goals is proper
separation of concerns -- i.e., keeping the data model logic isolated from
the display logic -- so that things like MDI user interfaces become
possible. It has been in development now for over four years, and we do
have a proof of concept MDI Swing user interface. But it is not yet
complete, and the UI framework still needs more iterations -- that
component is still very much in beta, and will be for at least another
year. You are very welcome to get involved, and we are happy to answer
specific technical questions about it, but it would be a very steep
learning curve for anyone who is not already intimately familiar with Java
Swing.

Much easier might be to find an alternative way to accomplish your goals
here, which is why I asked for more details about them.

Regards,
Curtis

[1]
http://stackoverflow.com/q/23638291
http://stackoverflow.com/q/23574523
http://stackoverflow.com/q/23528247
http://stackoverflow.com/q/23546698
http://stackoverflow.com/q/23548625
http://stackoverflow.com/q/23552108
http://stackoverflow.com/q/23574523



On Thu, May 15, 2014 at 11:27 AM, Student1 <[hidden email]> wrote:

> Hi,
> Thank you for such a quick reply. I would still like to attempt this, even
> though I do know it contains a lot of work. I am just a little unsure on
> how to actually start this. I have created most of the imageJ functionality
> like opening, saving, reading, etc interface by myself but the only thing
> that is of problem is the image window where imageJ displays the image. I
> don’t know exactly how to start with this. Any help would really be
> appreciated.
>
> Thank you.
>
> Mariam Dost
>
>
> On May 15, 2014, at 10:17 AM, John Hayes <[hidden email]> wrote:
>
> > Hi,
> >
> > Normally in Java this is done with JDesktopPane, JInternalPane, etc.,
> with Swing:
> http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-a-virtual-desktop-in-your-applic.html
> >
> > However, note that ImageJ’s main frame and ImageWindow class are AWT and
> not Swing, so I think this may be a lot more work than you anticipate.
> >
> > HTH, and best regards,
> >
> > John
> >
> > Le 15 mai 2014 à 17:56, Student1 a écrit :
> >
> >> Hi,
> >> I am making a customized GUI for imageJ, where everything is contained
> within the desktop pane. I want the image window to be an internal frame
> within my desktop pane. I was wondering if anyone knows how to do this.
> >>
> >> Thanks in advance.
> >>
> >> Mariam Dost
> >> --
> >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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