com.wolfram.jlink
Class MathWindowListener

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


J/Link is Copyright (c) 1999-2008, Wolfram Research, Inc. All rights reserved.