All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Button
|
+----edu.cornell.lassp.mck10.HysteresisApplet.LoopButton
LoopButton produces a button which can be used to generate
an entire hysteresis loop with the press of a single button.
Source Code is available.
LoopButton(model,fit,name) attatches the button
to the model, and the fit button which is used for zooming, and gives
the button a label given by the parameter name
action(e,o) is called every time the button is pressed.
makeLoop() is called to generate a new hysteresis loop.
run() is called when makeLoop() spawns
a new thread.
update(o,obj) is called whenever one of the parameters
of the model is changed.
public LoopButton(HysteresisLattice model,
AutoFitButton fit,
String name)
LoopButton(model,fit,name) attatches the button
to the model, and the fit button which is used for zooming, and gives
the button a label given by the parameter name
public boolean action(Event e,
Object o)
action(e,o) is called every time the button is pressed.
when this happens, makeLoop() is called to generate a new
hysteresis loop.
public void update(Observable o,
Object obj)
update(o,obj) is called whenever one of the parameters
of the model is changed. If this happens, there is a new simulation,
and we should stop trying to generate the hysteresis loop.
public void makeLoop()
makeLoop() is called to generate a new hysteresis loop.
It stops the model if it is running, then it spawns a new thread
in which the hysteresis loop is generated.
public void run()
run() is called when makeLoop() spawns
a new thread. It just tells the model to increase to the maximum
field, waits for it to finish, then tells it to decrease to the
minimum field. If running becomes false, it stops
generating the hysteresis loop, because the parameters of the model
have changed. After the loop is generated, the fit button is used
to zoom in on the loop.
All Packages Class Hierarchy This Package Previous Next Index