Problem extending MouseHelper class for customized mousehandling

I am writing customized mouse handling by extending the MouseHelper class.
Depending on a display button selectable by the user, I need the application
to toggle between different MouseHelper classes (the old one and my new
one(s) ).  I've created an extended MouseHelper class called
MouseGateHelper, and when the user clicks the appropriate display button,
the program creates a new DefaultDisplayRendererJ2D that uses this
MouseHelper subclass.  But I can't find a method for telling display to use
this new display renderer (DisplayImpl only has a getRenderer(), not a
setRenderer() methods).  

When a user selects the alternative mousehandling, the application
constructs MouseGateHelper, but then continues to handle mouse events using
the old MouseHelper.  I may be overlooking something obvious--here's the
code:

//MouseGateHelper extends MouseHelper for customized mouse events

DisplayImpl display = ...

 DefaultDisplayRendererJ2D dr = new
DefaultDisplayRendererJ2D(MouseGateHelper.class);
  try{
    dr.setDisplay(display);
  } catch (VisADException e) {}
  
MouseBehaviorJ2D mb = new
MouseBehaviorJ2D(dr,surrogate2.MouseGateHelper.class);
       
display.setMouseBehavior(mb);



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