Class MathMouseMotionListener

  • All Implemented Interfaces:
    java.awt.event.MouseMotionListener, java.util.EventListener

    public class MathMouseMotionListener
    extends MathListener
    implements java.awt.event.MouseMotionListener
    This class lets you trigger a call into Mathematica on the occurrence of a particular event. Like all the MathXXXListener classes, it is intended to be used primarily from Mathematica, although it can be used from Java code as well.

    In response to a MouseEvent, objects of this class send to Mathematica:

         userCode[theMouseEvent, theMouseEvent.getX(), theMouseEvent.getY(), theMouseEvent.getClickCount()]
    userFunc is specified as a string, either a function name or an expression (like a pure function "foo[##]&"), via the setHandler() method.
    • Constructor Detail

      • MathMouseMotionListener

        public MathMouseMotionListener()
        The constructor that is called from Mathematica.
      • MathMouseMotionListener

        public MathMouseMotionListener​(KernelLink ml)
        You must use this constructor when using this class in a Java program, because you need to specify the KernelLink that will be used.
        ml - The link to which computations will be sent when MouseEvents arrive.
      • MathMouseMotionListener

        public MathMouseMotionListener​(java.lang.String[][] handlers)
        This form of the constructor lets you skip having to make a series of setHandler() calls. Use this constructor from Mathematica code only.
        handlers - An array of {meth, func} pairs associating methods in the MouseMotionListener interface with Mathematica functions.
    • Method Detail

      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent e)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener