00001 import javasci.* ;
00002 import java.lang.Thread.*;
00003 import java.io.*;
00004
00005 class LoopEvent extends Thread
00006 {
00007 public void run()
00008 {
00009 int i=0;
00010 Scilab.Exec("plot2d();");
00011 System.out.println("Appuyer sur 'q' et 'return' pour quitter");
00012 do
00013 {
00014 Scilab.Events();
00015 }
00016 while ( (i==0) && ( Scilab.HaveAGraph() != false) );
00017 Scilab.Events();
00018 System.out.println("Fenetre Graphique fermee");
00019 Scilab.Finish();
00020 }
00021 }
00022
00023 class ExempleEvent2
00024 {
00025
00026 public static void main(String[] args) throws Exception
00027
00028 {
00029 char c;
00030 Thread thread = new LoopEvent();
00031 thread.start();
00032
00033
00034
00035 while (System.in.read()!='q')
00036 {
00037 try
00038 {
00039 Thread.sleep( 1 );
00040 }
00041 catch ( InterruptedException e )
00042 {
00043 }
00044
00045 }
00046 thread.stop();
00047 }
00048
00049 }
00050