|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.webcompmath.data.Constant
net.sourceforge.webcompmath.data.Variable
net.sourceforge.webcompmath.draw.beans.WCMMouseVariableBean
public class WCMMouseVariableBean
This class is a convenience class used when creating applications via a GUI builder. After dropping a WCMMouseTrackerBean or a WCMDraggablePointBean on a canvas, you can access it's x and y variables by creating a WCMMouseVariableBean and setting its Mouse property (and optionally it's AxisDirection property, which defaults to the x axis). Once set up, you can use this anywhere you would normally use a variable. The implementation just gets the appropriate variable from the mouse tracker or draggable point, saves it, and then passes appropriate method calls on to the variable.
| Field Summary | |
|---|---|
static int |
X_AXIS
Indicates that the variable should track the mouse's x position |
static int |
Y_AXIS
Indicates that the variable should track the mouse's y position |
| Fields inherited from class net.sourceforge.webcompmath.data.Constant |
|---|
value |
| Constructor Summary | |
|---|---|
WCMMouseVariableBean()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Just pass through to the support class |
void |
appendOutputString(ExpressionProgram prog,
int myIndex,
java.lang.StringBuffer buffer)
Passed through to the MouseVar variable. |
void |
apply(StackOfDouble stack,
Cases cases)
Passed through to the MouseVar variable. |
void |
compileDerivative(ExpressionProgram prog,
int myIndex,
ExpressionProgram deriv,
Variable wrt)
Passed through to the MouseVar variable. |
boolean |
dependsOn(Variable x)
Passed through to the MouseVar variable. |
Expression |
derivative(Variable wrt)
Passed through to the MouseVar variable. |
int |
extent(ExpressionProgram prog,
int myIndex)
Passed through to the MouseVar variable. |
int |
getAxisDirection()
Get whether this variable represents the x or y position of the mouse. |
MathObject |
getMathObject()
Just return the variable. |
MouseVar |
getMouse()
Get the MouseTracker or DraggablePoint being referenced |
java.lang.String |
getName()
Passed through to the MouseVar variable. |
long |
getSerialNumber()
Passed through to the MouseVar variable. |
double |
getVal()
Passed through to the MouseVar variable. |
double |
getValueWithCases(Cases cases)
Passed through to the MouseVar variable. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
just pass through to the support class ) |
void |
setAxisDirection(int d)
Set whether this variable represents the x or y position of the mouse. |
void |
setMouse(MouseVar m)
Set the MouseTracker or DraggablePoint to use when getting a position variable |
void |
setName(java.lang.String name)
Passed through to the MouseVar variable. |
void |
setVal(double value)
Passed through to the MouseVar variable. |
void |
sync(Tie tie,
Tieable newest)
Passed through to the MouseVar variable. |
java.lang.String |
toString()
Passed through to the MouseVar variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int X_AXIS
public static final int Y_AXIS
| Constructor Detail |
|---|
public WCMMouseVariableBean()
| Method Detail |
|---|
public void setMouse(MouseVar m)
m - the mouse tracker or draggable pointpublic MouseVar getMouse()
public void setName(java.lang.String name)
setName in interface MathObjectsetName in class Constantname - name of the constantConstant.setName(java.lang.String)public java.lang.String getName()
getName in interface MathObjectgetName in class ConstantConstant.getName()public void setAxisDirection(int d)
d - the desired position, either X_AXIS or Y_AXISpublic int getAxisDirection()
public void setVal(double value)
setVal in class Variablevalue - value to set variable toVariable.setVal(double)public Expression derivative(Variable wrt)
derivative in interface Expressionderivative in class Variablewrt - "with respect to", i.e., the variable with respect to which to
take the derivative.
Variable.derivative(net.sourceforge.webcompmath.data.Variable)
public void compileDerivative(ExpressionProgram prog,
int myIndex,
ExpressionProgram deriv,
Variable wrt)
compileDerivative in interface ExpressionCommandcompileDerivative in class Variableprog - expression programmyIndex - location in programderiv - the derivativewrt - variable with respect toVariable.compileDerivative(net.sourceforge.webcompmath.data.ExpressionProgram,
int, net.sourceforge.webcompmath.data.ExpressionProgram,
net.sourceforge.webcompmath.data.Variable)public boolean dependsOn(Variable x)
dependsOn in interface ExpressiondependsOn in interface ExpressionCommanddependsOn in class Variablex - variable to check
Variable.dependsOn(net.sourceforge.webcompmath.data.Variable)public java.lang.String toString()
toString in interface ExpressiontoString in class VariableVariable.toString()public double getVal()
getVal in interface ValuegetVal in class ConstantConstant.getVal()public double getValueWithCases(Cases cases)
getValueWithCases in interface ExpressiongetValueWithCases in class Constantcases - the cases to use
Constant.getValueWithCases(net.sourceforge.webcompmath.data.Cases)
public void apply(StackOfDouble stack,
Cases cases)
apply in interface ExpressionCommandapply in class Constantstack - the stack to usecases - the cases to useConstant.apply(net.sourceforge.webcompmath.data.StackOfDouble,
net.sourceforge.webcompmath.data.Cases)
public int extent(ExpressionProgram prog,
int myIndex)
extent in interface ExpressionCommandextent in class Constantprog - program containing the constantmyIndex - location of the constant
Constant.extent(net.sourceforge.webcompmath.data.ExpressionProgram,
int)
public void appendOutputString(ExpressionProgram prog,
int myIndex,
java.lang.StringBuffer buffer)
appendOutputString in interface ExpressionCommandappendOutputString in class Constantprog - program containing the constantmyIndex - location of the constantbuffer - string to appendConstant.appendOutputString(net.sourceforge.webcompmath.data.ExpressionProgram,
int, java.lang.StringBuffer)public long getSerialNumber()
getSerialNumber in interface TieableTieable.getSerialNumber()
public void sync(Tie tie,
Tieable newest)
sync in interface Tieabletie - the tie connecting the objectsnewest - the object to notifyTieable.sync(net.sourceforge.webcompmath.awt.Tie,
net.sourceforge.webcompmath.awt.Tieable)public MathObject getMathObject()
getMathObject in interface ParserMathObjectParserMathObject.getMathObject()public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface ParserMathObjectParserMathObject.addPropertyChangeListener(java.beans.PropertyChangeListener)public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface ParserMathObjectParserMathObject.removePropertyChangeListener(java.beans.PropertyChangeListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||