NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Overriding default mouse behavior

  • To: visad-list@xxxxxxxxxxxxx
  • Subject: Overriding default mouse behavior
  • From: root <root@localhost.localdomain>
  • Date: Wed, 30 Jan 2002 22:25:00 -0500
To override the default mouse behavior in a 2D VisAD window,
I was advised here to take a look at
        http://www.unidata.ucar.edu/glimpse/visad-lis/2255
I believe I have reproduced the logic of that example below,
and so I wonder why I got the following run-time error:

"Exception in thread "main" visad.VisADError: cannot construct
class MouseSupercede at visad.java2d.DefaultDisplayRendererJ2D.
createSceneGraph(DefaultDisplayRenderer"...[etc.]

---------------------- EXAMPLE: -----------------
import visad.*;
import visad.java2d.*;
import java.rmi.RemoteException;
import java.awt.*;
import javax.swing.*;

public class a11 {

public
a11 (String[] args) throws RemoteException, VisADException {

    DisplayRendererJ2D DR
         new DefaultDisplayRendererJ2D(MouseSuperceded.class);
    DisplayImpl theDisp = new DisplayImplJ2D("theDisp", DR);
}

public static void main(String[] args)
    throws RemoteException, VisADException {
        new a11(args);
        }
}


class DeadMouse extends MouseHelper {

public DeadMouse(DisplayRenderer DR, MouseBehavior MB) {
        super(DR, MB);
}
}

class MouseSuperceded extends MouseBehaviorJ2D {

public MouseSuperceded(DisplayRendererJ2D dRd {
        super(dRd, DeadMouse.class);
}
}
---------------- end of example -----------------------

As a sanity check, if I replace the line 
         new DefaultDisplayRendererJ2D(MouseSuperceded.class);
with
  new DefaultDisplayRendererJ2D
        (visad.java2d.MouseBehaviorJ2D.class)
I don't get the error.


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