Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Oh where did my MouseEvents go?

The DisplayListener did the trick.

Thanks,
Bruce


On Dec 22, 2004, at 4:23 AM, Bill Hibbard wrote:

Hi Bruce,

You can access many of the MouseEvents by adding a
visad.DisplayListener to your DisplayImplJ3D. See
visad.DisplayEvent for a list of event types.

Good luck,
Bill

On Tue, 21 Dec 2004, Bruce Flynn wrote:


I am trying to intercept MouseEvents from a JFrame containing a VisAD
graph by registering a MouseListener on the glass pane. The problem is
that I can't seem to get the glass pane to intercept the events with a
VisAD graph in the frame.  It does however work with other components.
After doing some investigating, using the example P2_01 code provided
by Ugo Taddei, it seems to only seems to malfunction with the
DisplayImplJ3D, which is what I'm using.  I can get the MouseEvents by
adding the below code, but not when I change the display to
DisplayImplJ3D.

     jframe.getGlassPane().addMouseListener( new MouseAdapter(){
         public void mouseClicked( MouseEvent evt ){
             System.out.println("MOUSE CLICKED");
         }
     });
     jframe.getGlassPane().setVisible(true);

Any idea how to get MouseEvents using DisplayImplJ3D?

I included both sources with P2_01.java containing the 3D display

Thanks
Bruce




 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690