A wrapper that allows the IsingApp to be run inside a WrapperApplet. @author Wolfgang Christian @version 1.0
| 17 | * @version 1.0 |
| 18 | */ |
| 19 | public class IsingWRApp extends IsingApp implements Embeddable{ |
| 20 | ObjectManager viewManager = new ObjectManager(); |
| 21 | |
| 22 | /** |
| 23 | * Method sliderMoved |
| 24 | * |
| 25 | */ |
| 26 | public void sliderMoved () { |
| 27 | T = control.getDouble ("T"); |
| 28 | newH = control.getDouble ("H"); |
| 29 | if(newH!=H)fieldChanged=true; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Sets the Control. |
| 34 | * |
| 35 | * A null value is sent by an applet's destroy method. |
| 36 | * |
| 37 | * @param control |
| 38 | */ |
| 39 | @Override |
| 40 | public void setControl(Control control){ |
| 41 | stopAnimation(); // make sure the animation is stopped. |
| 42 | this.control=control; |
| 43 | if(this.control==null) return; |
| 44 | viewManager.addView("drawingFrame",drawingFrame); |
| 45 | viewManager.addView("drawingPanel",drawingPanel); |
| 46 | viewManager.addView("energyFrame",enFrame); |
| 47 | viewManager.addView("energyPanel",enPanel); |
| 48 | viewManager.addView("magnetizationFrame",magFrame); |
| 49 | viewManager.addView("magnetizationPanel",magPanel); |
| 50 | initMyControl (); // store initial values in the control |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Gets the Control for this applet. |
| 55 | */ |
| 56 | @Override |
| 57 | public Control getControl(){ |
| 58 | return control; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Gets the ObjectManager. Implementation of Embeddable. |
| 63 | * |
| 64 | * @return |
| 65 | */ |
| 66 | @Override |
| 67 | public ObjectManager getManager(){ return viewManager;} |
| 68 | |
| 69 | /** |
| 70 | * The main entry point for the program. |
| 71 | * |
| 72 | * @param args |
| 73 | */ |
| 74 | public static void main (String[] args) { |
| 75 | IsingWRApp model = new IsingWRApp (); |
| 76 | Control control = new IsingTempControl (model); |
nothing calls this directly
no outgoing calls
no test coverage detected