Class MathWindowListener

java.lang.Object
com.wolfram.jlink.MathListener
com.wolfram.jlink.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 Summary

    Constructors 
    Constructor Description
    MathWindowListener()
    The constructor that is called from Mathematica.
    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.
    MathWindowListener​(java.lang.String[][] handlers)
    This form of the constructor lets you skip having to make a series of setHandler() calls.
  • Method Summary

    Modifier and Type Method Description
    void windowActivated​(java.awt.event.WindowEvent e)  
    void windowClosed​(java.awt.event.WindowEvent e)  
    void windowClosing​(java.awt.event.WindowEvent e)  
    void windowDeactivated​(java.awt.event.WindowEvent e)  
    void windowDeiconified​(java.awt.event.WindowEvent e)  
    void windowIconified​(java.awt.event.WindowEvent e)  
    void windowOpened​(java.awt.event.WindowEvent e)  

    Methods inherited from class com.wolfram.jlink.MathListener

    callMathHandler, callVoidMathHandler, getHandler, getLink, setHandler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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