com.wolfram.jlink
Class MathAdjustmentListener

java.lang.Object
  extended by com.wolfram.jlink.MathListener
      extended by com.wolfram.jlink.MathAdjustmentListener
All Implemented Interfaces:
java.awt.event.AdjustmentListener, java.util.EventListener

public class MathAdjustmentListener
extends MathListener
implements java.awt.event.AdjustmentListener

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 AdjustmentEvent, objects of this class send to Mathematica:

     userCode[theAdjustmentEvent, theAdjustmentEvent.getAdjustmentType(), theAdjustmentEvent.getValue()]
userFunc is specified as a string, either a function name or an expression (like a pure function "foo[##]&"), via the setHandler() method.


Constructor Summary
MathAdjustmentListener()
          The constructor that is typically called from Mathematica.
MathAdjustmentListener(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.
MathAdjustmentListener(java.lang.String func)
          Because the AdjustmentListener interface has only one method, adjustmentValueChanged(), you can specify the Mathematica function to be called with this constructor, rather than having to separately call setHandler().
 
Method Summary
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent 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

MathAdjustmentListener

public MathAdjustmentListener()
The constructor that is typically called from Mathematica.


MathAdjustmentListener

public MathAdjustmentListener(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 adjustmentValueChanged() is called.

MathAdjustmentListener

public MathAdjustmentListener(java.lang.String func)
Because the AdjustmentListener interface has only one method, adjustmentValueChanged(), 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 AdjustmentEvent.
Method Detail

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener


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