Class MathWindowListener

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

    public class MathWindowListener
    extends MathListener
    implements java.awt.event.WindowListener
    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 an WindowEvent, objects of this class send to Mathematica:

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

      • MathWindowListener

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

        public MathWindowListener​(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.
        Parameters:
        ml - The link to which computations will be sent when WindowEvents arrive.
      • MathWindowListener

        public MathWindowListener​(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.
        Parameters:
        handlers - An array of {meth, func} pairs associating methods in the WindowListener interface with Mathematica functions.
    • Method Detail

      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent e)
        Specified by:
        windowActivated in interface java.awt.event.WindowListener
      • windowClosed

        public void windowClosed​(java.awt.event.WindowEvent e)
        Specified by:
        windowClosed in interface java.awt.event.WindowListener
      • windowClosing

        public void windowClosing​(java.awt.event.WindowEvent e)
        Specified by:
        windowClosing in interface java.awt.event.WindowListener
      • windowDeactivated

        public void windowDeactivated​(java.awt.event.WindowEvent e)
        Specified by:
        windowDeactivated in interface java.awt.event.WindowListener
      • windowDeiconified

        public void windowDeiconified​(java.awt.event.WindowEvent e)
        Specified by:
        windowDeiconified in interface java.awt.event.WindowListener
      • windowIconified

        public void windowIconified​(java.awt.event.WindowEvent e)
        Specified by:
        windowIconified in interface java.awt.event.WindowListener
      • windowOpened

        public void windowOpened​(java.awt.event.WindowEvent e)
        Specified by:
        windowOpened in interface java.awt.event.WindowListener