|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 MathObject
setName
in class Constant
name
- name of the constantConstant.setName(java.lang.String)
public java.lang.String getName()
getName
in interface MathObject
getName
in class Constant
Constant.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 Variable
value
- value to set variable toVariable.setVal(double)
public Expression derivative(Variable wrt)
derivative
in interface Expression
derivative
in class Variable
wrt
- "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 ExpressionCommand
compileDerivative
in class Variable
prog
- 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 Expression
dependsOn
in interface ExpressionCommand
dependsOn
in class Variable
x
- variable to check
Variable.dependsOn(net.sourceforge.webcompmath.data.Variable)
public java.lang.String toString()
toString
in interface Expression
toString
in class Variable
Variable.toString()
public double getVal()
getVal
in interface Value
getVal
in class Constant
Constant.getVal()
public double getValueWithCases(Cases cases)
getValueWithCases
in interface Expression
getValueWithCases
in class Constant
cases
- the cases to use
Constant.getValueWithCases(net.sourceforge.webcompmath.data.Cases)
public void apply(StackOfDouble stack, Cases cases)
apply
in interface ExpressionCommand
apply
in class Constant
stack
- 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 ExpressionCommand
extent
in class Constant
prog
- 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 ExpressionCommand
appendOutputString
in class Constant
prog
- 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 Tieable
Tieable.getSerialNumber()
public void sync(Tie tie, Tieable newest)
sync
in interface Tieable
tie
- 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 ParserMathObject
ParserMathObject.getMathObject()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface ParserMathObject
ParserMathObject.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface ParserMathObject
ParserMathObject.removePropertyChangeListener(java.beans.PropertyChangeListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |