Element f = simulator.getObject("el00242"); Element point = simulator.getObject("el00360"); Element sp1 = simulator.getObject("el00248"); Element sp2 = simulator.getObject("el00251"); Element sp3 = simulator.getObject("el00254"); Element sp4 = simulator.getObject("el00258"); Element spx = simulator.getObject("el00361"); Element tf = simulator.getObject("el01493"); tf.setEnabled(false); tf.update(); /*Element ts2 = simulator.getObject("Text shape_0002"); physicon.dsi.shapes.TTextShape ord = (physicon.dsi.shapes.TTextShape)ts2.getElement();*/ String command; double a,b,A,B,x,y; while (true) { command = simulator.getNextEvent(); if (command.equals("buttonClick")) { A=sp1.getDouble("Value"); B=sp2.getDouble("Value"); a=sp3.getDouble("Value"); b=sp4.getDouble("Value"); f.set("Function", A+ "*arctg(" +a+ "*x+" +b+ ")+" +B+ "*pi"); f.update(); } /*if (command.equals("abscChange") || command.equals("buttonClick")) { x=sp5.getDouble("Value"); point.set("Var1",x); point.update(); y=point.getDouble("Var2"); y/=java.lang.Math.PI; ord.setText(DecUtil.fString(y,2)); }*/ if (command.equals("textChanged") || command.equals("abscChange") || command.equals("buttonClick")) { x=spx.getDouble("Value"); point.set("Var1",x); point.update(); y=point.getDouble("Var2"); //ord.setText(DecUtil.fString(y,2)); y/=java.lang.Math.PI; tf.set("Caption",DecUtil.fString(y,2)); if(x==3) x=2.99; if(x==-3) x=-2.99; point.set("Var1",x); point.update(); tf.update(); } Thread.sleep(100); }