Element f = simulator.getObject("el00242"); Element point = simulator.getObject("el01383"); 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("el01277"); Element undef = simulator.getObject("mt00000_0013"); undef.setVisibility(false); undef.update(); 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,max,min; while (true) { command = simulator.getNextEvent(); if (command.equals("buttonClick") || command.equals("abscChange")) { A=sp1.getDouble("Value"); B=sp2.getDouble("Value"); a=sp3.getDouble("Value"); b=sp4.getDouble("Value"); f.set("Function", A+ "*arcsin(" +a+ "*x+" +b+ ")+" +B+ "*pi"); f.update(); /*for(min=-3;java.lang.Math.abs(a*min+b)>=1;min+=0.1) if(min>=3) { min-=0.2; break; } for(max=min;java.lang.Math.abs(a*max+b)<1;max+=0.1) if(max>=3.1) break; max-=0.2; sp5.set("MinValueSpin", min); sp5.set("MaxValueSpin", max); if(java.lang.Math.abs(a*x+b)>=1) sp5.set("Value", min); sp5.update();*/ } if (command.equals("textChanged") || command.equals("abscChange") || command.equals("buttonClick")) { x=spx.getDouble("Value"); point.set("Var1",x); if(java.lang.Math.abs(a*x+b)<=1) { y=A*java.lang.Math.asin(a*x+b)+B*java.lang.Math.PI; point.set("Var2",y); point.setVisibility(true); y/=java.lang.Math.PI; undef.setVisibility(false); undef.update(); tf.set("Caption",DecUtil.fString(y,2)); } else { point.setVisibility(false); tf.set("Caption",""); undef.setVisibility(true); undef.update(); } point.update(); //y=point.getDouble("Var2"); //ord.setText(DecUtil.fString(y,2)); //y/=java.lang.Math.PI; //tf.set("Caption",DecUtil.fString(y,2)); tf.update(); } Thread.sleep(100); }