Package com.wolfram.jlink
Class MathComponentListener
java.lang.Object
com.wolfram.jlink.MathListener
com.wolfram.jlink.MathComponentListener
- All Implemented Interfaces:
java.awt.event.ComponentListener,java.util.EventListener
public class MathComponentListener extends MathListener implements java.awt.event.ComponentListener
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 ComponentEvent, objects of this class send to Mathematica:
userCode[theComponentEvent]
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 MathComponentListener()The constructor that is called from Mathematica.MathComponentListener(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.MathComponentListener(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 voidcomponentHidden(java.awt.event.ComponentEvent e)voidcomponentMoved(java.awt.event.ComponentEvent e)voidcomponentResized(java.awt.event.ComponentEvent e)voidcomponentShown(java.awt.event.ComponentEvent e)Methods inherited from class com.wolfram.jlink.MathListener
callMathHandler, callVoidMathHandler, getHandler, getLink, setHandler
-
Constructor Details
-
MathComponentListener
public MathComponentListener()The constructor that is called from Mathematica. -
MathComponentListener
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 ComponentEvents arrive.
-
MathComponentListener
public MathComponentListener(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 ComponentListener interface with Mathematica functions.
-
-
Method Details
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent e)- Specified by:
componentHiddenin interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)- Specified by:
componentMovedin interfacejava.awt.event.ComponentListener
-
componentResized
public void componentResized(java.awt.event.ComponentEvent e)- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener
-
componentShown
public void componentShown(java.awt.event.ComponentEvent e)- Specified by:
componentShownin interfacejava.awt.event.ComponentListener
-