Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
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);
visad
archives: