Converted from AWT to SWING, now mouse doesn't work.

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

Converted from AWT to SWING, now mouse doesn't work.

liquidnitro28
For our senior design project, we are converting ImageJ to use SWING instead of AWT. We have changed the most important GUI files, but now the mouse cannot click on the menu items.

You are able to click on things, like File, and the drop down menu will show up but if you click on something like Open, nothings happens.

We can still open files by pressing the "O" key, but not with the mouse. We think it is a problem in Menus.java, but we aren't exactly sure.

If anyone has an idea of what is happening, it would be greatly appreciated if you could help.

Thanks,
Robert
Reply | Threaded
Open this post in threaded view
|

Re: Converted from AWT to SWING, now mouse doesn't work.

ctrueden
Hi Robert,

For our senior design project, we are converting ImageJ to use SWING instead
> of AWT. We have changed the most important GUI files, but now the mouse
> cannot click on the menu items.
>

How bizarre. You are not the first group to convert ImageJ to Swing, and no
one else has reported a problem like this, nor could I find anything in a
cursory Google search. So chances are there is something unusual about what
you have done. One thing you could try is mixing AWT and Swing
components—i.e., keep using the AWT MenuBar and see if that works for you.
Alternately, you could try calling
JPopupMenu.setDefaultLightWeightPopupEnabled(false) and see if that makes a
difference. My only other thought would be to look for anything that is
listening for mouse events and then consuming them, or a subclass overriding
a MouseListener method and not calling super.mousePressed, etc.

As a side note, please be aware that ImageJ 2.0, due out in October, will
feature a Swing-based user interface.

Regards,
Curtis Rueden
ImageJDev project lead
http://imagejdev.org/

On Wed, May 4, 2011 at 4:15 PM, liquidnitro28 <[hidden email]>wrote:

> For our senior design project, we are converting ImageJ to use SWING
> instead
> of AWT. We have changed the most important GUI files, but now the mouse
> cannot click on the menu items.
>
> You are able to click on things, like File, and the drop down menu will
> show
> up but if you click on something like Open, nothings happens.
>
> We can still open files by pressing the "O" key, but not with the mouse. We
> think it is a problem in Menus.java, but we aren't exactly sure.
>
> If anyone has an idea of what is happening, it would be greatly appreciated
> if you could help.
>
> Thanks,
> Robert
>
> --
> View this message in context:
> http://imagej.588099.n2.nabble.com/Converted-from-AWT-to-SWING-now-mouse-doesn-t-work-tp6332398p6332398.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Converted from AWT to SWING, now mouse doesn't work.

Anna Eschene
Robert, Currtis,

ImageJ2x also offers a swing version of ImageJ.
http://www.rawak.de/ij2x/imagej2x.html
I find a little confusing the use of the
names ImageJdev,ImageJX,ImageJ2,ImageJ2X
for basically the same software. If it's the same software, it would be
better to keep the same name. If it's different, would better use a
different name.
ImageJ 2 for example seem to plan and include ImageJ 1, but with radically
different gears. Many custom or commercial software also include ij.jar.
Will those be able to upgrade to ij.jar 2 ?
The same applies for fiji, which in my new user opinion is not "just
ImageJ", because you just can't use/compile fiji plugins in ImageJ.
Anna.


On Thu, May 5, 2011 at 7:43 PM, Curtis Rueden <[hidden email]> wrote:

> Hi Robert,
>
> For our senior design project, we are converting ImageJ to use SWING
> instead
> > of AWT. We have changed the most important GUI files, but now the mouse
> > cannot click on the menu items.
> >
>
> How bizarre. You are not the first group to convert ImageJ to Swing, and no
> one else has reported a problem like this, nor could I find anything in a
> cursory Google search. So chances are there is something unusual about what
> you have done. One thing you could try is mixing AWT and Swing
> components—i.e., keep using the AWT MenuBar and see if that works for you.
> Alternately, you could try calling
> JPopupMenu.setDefaultLightWeightPopupEnabled(false) and see if that makes a
> difference. My only other thought would be to look for anything that is
> listening for mouse events and then consuming them, or a subclass
> overriding
> a MouseListener method and not calling super.mousePressed, etc.
>
> As a side note, please be aware that ImageJ 2.0, due out in October, will
> feature a Swing-based user interface.
>
> Regards,
> Curtis Rueden
> ImageJDev project lead
> http://imagejdev.org/
>
> On Wed, May 4, 2011 at 4:15 PM, liquidnitro28 <[hidden email]
> >wrote:
>
> > For our senior design project, we are converting ImageJ to use SWING
> > instead
> > of AWT. We have changed the most important GUI files, but now the mouse
> > cannot click on the menu items.
> >
> > You are able to click on things, like File, and the drop down menu will
> > show
> > up but if you click on something like Open, nothings happens.
> >
> > We can still open files by pressing the "O" key, but not with the mouse.
> We
> > think it is a problem in Menus.java, but we aren't exactly sure.
> >
> > If anyone has an idea of what is happening, it would be greatly
> appreciated
> > if you could help.
> >
> > Thanks,
> > Robert
> >
> > --
> > View this message in context:
> >
> http://imagej.588099.n2.nabble.com/Converted-from-AWT-to-SWING-now-mouse-doesn-t-work-tp6332398p6332398.html
> > Sent from the ImageJ mailing list archive at Nabble.com.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Converted from AWT to SWING, now mouse doesn't work.

dscho
Dear Anna,

On Thu, 5 May 2011, Anna Eschene wrote:

> Robert, Currtis,
             ^
Almost :-)

> ImageJ2x also offers a swing version of ImageJ.
> http://www.rawak.de/ij2x/imagej2x.html

I was not aware of this project.

> I find a little confusing the use of the
> names ImageJdev,ImageJX,ImageJ2,ImageJ2X
> for basically the same software.

It is good that you mention this confusion; only at the latest ImageJ
conference I got aware of that type of confusion. So let me try to clarify
things, and hopefully other people with the same question find this answer
on this mailing list.

They are not basically the same software. ImageJdev is not a software
but the community/project/website for ImageJ2. ImageJX was a
proof-of-concept that gave rise to the ImageJ2 project (although ImageJ2
is a complete rewrite with a backwards-compatibility layer that allows
you to run old-style ImageJ plugins just like before).

From my point of view, ImageJ2x is a toy project.

But all this does not matter: the only two you need to care about are
ImageJ and ImageJ2.

There is a quite nice timeline about the development of ImageJ2 (it uses
all the known best-practices developed in the IT industry), and the first
ImageJ2 version intended for users is slated for October this year.

> Will those be able to upgrade to ij.jar 2 ?

ImageJ2 will be more fine-grained, and able to talk to many other
programs, so if you wanted to update manually, you would need to "upgrade"
quite a few files. I would not recommend it, but if you insist, you
certainly can do it by hand.

> The same applies for fiji, which in my new user opinion is not "just
> ImageJ", because you just can't use/compile fiji plugins in ImageJ.

But you can! It is just that to compile the plugins, you sometimes need
some base libraries or some other plugins (so-called "dependencies"). For
some plugins, the number of dependencies is quite large.

So again, you can do it by hand if you insist. It just happens to be
tedious and no fun at all. Personally, I'd prefer tools to automate such
tedious, stupid and repetitive actions. Which is the whole reason for
Fiji's existence.

To answer the obvious next question: yes, Fiji will bundle ImageJ2 as soon
as it reaches the "intended for users" stage.

Feel free to ask away freely if you're still not sure about everything,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: Converted from AWT to SWING, now mouse doesn't work.

ctrueden
Hi Anna,

Thanks for your comments—hopefully Johannes's answer helped to clarify
matters. I have also created a FAQ entry about it on our web site:
  http://imagejdev.org/faq

Regards,
Curtis

On Fri, May 6, 2011 at 3:51 AM, Johannes Schindelin <
[hidden email]> wrote:

> Dear Anna,
>
> On Thu, 5 May 2011, Anna Eschene wrote:
>
> > Robert, Currtis,
>             ^
> Almost :-)
>
> > ImageJ2x also offers a swing version of ImageJ.
> > http://www.rawak.de/ij2x/imagej2x.html
>
> I was not aware of this project.
>
> > I find a little confusing the use of the
> > names ImageJdev,ImageJX,ImageJ2,ImageJ2X
> > for basically the same software.
>
> It is good that you mention this confusion; only at the latest ImageJ
> conference I got aware of that type of confusion. So let me try to clarify
> things, and hopefully other people with the same question find this answer
> on this mailing list.
>
> They are not basically the same software. ImageJdev is not a software
> but the community/project/website for ImageJ2. ImageJX was a
> proof-of-concept that gave rise to the ImageJ2 project (although ImageJ2
> is a complete rewrite with a backwards-compatibility layer that allows
> you to run old-style ImageJ plugins just like before).
>
> From my point of view, ImageJ2x is a toy project.
>
> But all this does not matter: the only two you need to care about are
> ImageJ and ImageJ2.
>
> There is a quite nice timeline about the development of ImageJ2 (it uses
> all the known best-practices developed in the IT industry), and the first
> ImageJ2 version intended for users is slated for October this year.
>
> > Will those be able to upgrade to ij.jar 2 ?
>
> ImageJ2 will be more fine-grained, and able to talk to many other
> programs, so if you wanted to update manually, you would need to "upgrade"
> quite a few files. I would not recommend it, but if you insist, you
> certainly can do it by hand.
>
> > The same applies for fiji, which in my new user opinion is not "just
> > ImageJ", because you just can't use/compile fiji plugins in ImageJ.
>
> But you can! It is just that to compile the plugins, you sometimes need
> some base libraries or some other plugins (so-called "dependencies"). For
> some plugins, the number of dependencies is quite large.
>
> So again, you can do it by hand if you insist. It just happens to be
> tedious and no fun at all. Personally, I'd prefer tools to automate such
> tedious, stupid and repetitive actions. Which is the whole reason for
> Fiji's existence.
>
> To answer the obvious next question: yes, Fiji will bundle ImageJ2 as soon
> as it reaches the "intended for users" stage.
>
> Feel free to ask away freely if you're still not sure about everything,
> Johannes
>