|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.wolfram.jlink.MathListener
com.wolfram.jlink.MathActionListener
public class MathActionListener
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 ActionEvent, objects of this class send to Mathematica:
userFunc[theActionEvent, theActionEvent.getActionCommand()]
userFunc is specified as a string, either a function name or an expression
(like a pure function "foo[##]&"), via the setHandler() method. Sending the result of getActionCommand()
is an optimization to avoid a call back to Java in the likely event that you want this value.
| Constructor Summary | |
|---|---|
MathActionListener()
The constructor that is typically called from Mathematica. |
|
MathActionListener(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. |
|
MathActionListener(java.lang.String func)
Because the ActionListener interface has only one method, actionPerformed(), you can specify the Mathematica function to be called with this constructor, rather than having to separately call setHandler(). |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent 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 |
|---|
public MathActionListener()
public MathActionListener(KernelLink ml)
ml - The link to which computations will be sent when actionPerformed() is called.public MathActionListener(java.lang.String func)
func - The Mathematica function to be executed in response to an ActionEvent.| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||