Re: Spread Sheet Mouse Listeners

Date sent:              Mon, 19 Jul 1999 07:38:46 -0500

> Hi Rick,
> > I also want to add a listener to the SSCell so that if a right click
> > happens over the cell, the popup menu is displayed.  Currently
> > though popup menu's won't display over the cell and mouse events
> > don't work.
> >
> > My guess is that the SSCell has its own mouse handling stuff and
> > is capturing my clicks before my functions can handle it.  As to
> > why the menu doesn't display over the cell even when the click isn't
> > on the cell i don't know...
> I just added new DisplayEvents for MOUSE_PRESSED_RIGHT
> and MOUSE_PRESSED_LEFT.  Call the addDisplayListener()
> method on your FancySSCell to create a link to a
> DisplayListener, then in your DisplayListener:
>   public void displayChanged( DisplayEvent e ) {
>     if (e.getId() == DisplayEvent.MOUSE_PRESSED_RIGHT) {
>       // activate popup menu
>     }
>   }
> These new DisplayEvents are now on our ftp server.

kewl thanx for that...It all worked except for one prob... The popup 
menu needs the location of the mouse click so that it can show the 
menu in the right spot... How would I get the mouse position.

Also I need to recognise double click events...How would i do 


> The reason your popup menu won't show over the FancySSCell
> is that the popup is lightweight (i.e., not associated with
> a native window) but the FancySSCell display is heavyweight
> because that is what Java3D needs to run OpenGL.  This is a
> long-standing Java problem that won't be fixed any time soon.
> The work-around is to use heavyweight Components (e.g., AWT
> rather than Swing) for things that must appear over Java3D.

Using the setLightWeightPopup(false)
worked fine...

Thanx all

> Cheers,
> Bill
> ----------------------------------------------------------
> Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
> hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

Rick Frankel
Monash University
Clayton, Victoria, Australia

Batchelor Of Computer Science...

  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: