Package com.wolfram.jlink
Class MathTextListener
java.lang.Object
com.wolfram.jlink.MathListener
com.wolfram.jlink.MathTextListener
- All Implemented Interfaces:
java.awt.event.TextListener
,java.util.EventListener
public class MathTextListener extends MathListener implements java.awt.event.TextListener
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 TextEvent, objects of this class send to Mathematica:
userFunc[theTextEvent]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 MathTextListener()
The constructor that is typically called from Mathematica.MathTextListener(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.MathTextListener(java.lang.String func)
Because the TextListener interface has only one method, textValueChanged(), you can specify the Mathematica function to be called with this constructor, rather than having to separately call setHandler(). -
Method Summary
Modifier and Type Method Description void
textValueChanged(java.awt.event.TextEvent e)
Methods inherited from class com.wolfram.jlink.MathListener
callMathHandler, callVoidMathHandler, getHandler, getLink, setHandler
-
Constructor Details
-
MathTextListener
public MathTextListener()The constructor that is typically called from Mathematica. -
MathTextListener
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 textValueChanged is called.
-
MathTextListener
public MathTextListener(java.lang.String func)Because the TextListener interface has only one method, textValueChanged(), you can specify the Mathematica function to be called with this constructor, rather than having to separately call setHandler(). Use this constructor from Mathematica code only.- Parameters:
func
- The Mathematica function to be executed in response to an TextEvent.
-
-
Method Details
-
textValueChanged
public void textValueChanged(java.awt.event.TextEvent e)- Specified by:
textValueChanged
in interfacejava.awt.event.TextListener
-