    001package org.vishia.guiInspc;
    002
    003import java.io.File;
    004
    005import org.vishia.fileRemote.FileCluster;
    006import org.vishia.fileRemote.FileRemote;
    007import org.vishia.gral.base.GralGraphicTimeOrder;
    008import org.vishia.gral.base.GralMng;
    009import org.vishia.gral.base.GralWindow;
    010import org.vishia.gral.ifc.GralFactory;
    011import org.vishia.gral.swt.SwtFactory;
    012import org.vishia.msgDispatch.LogMessage;
    013import org.vishia.msgDispatch.LogMessageStream;
    014import org.vishia.msgDispatch.MsgRedirectConsole;
    015
    016public class InspcCurveViewApp
    017{
    018
    019  InspcCurveView curveView;
    020  //GralWindow wind;
    021  GralMng gralMng;
    022
    023  public static void main(String[] args){
    024    InspcCurveViewApp main = new InspcCurveViewApp();
    025    File dir;
    026    if(args.length >=1) {
    027      dir = new File(args[0]);
    028      if(dir.exists() && !dir.isDirectory()) {
    029        dir = dir.getParentFile();
    030      } else if(!dir.exists()) {
    031        dir = new File("d:/");
    032      }
    033    } else {
    034      dir = new File("d:/");
    035    }
    036    main.execute(dir.getAbsolutePath());
    037
    038  }
    039
    040  private void execute(String sDir){
    041    GralFactory gralFactory = new SwtFactory();
    042    LogMessage log = new LogMessageStream(System.out);
    043    GralWindow wind = gralFactory.createWindow(log, "Curve View", 'C', 100, 50, 800, 600);
    044    FileCluster fileCluster = FileRemote.clusterOfApplication;
    045    FileRemote dirCfg = fileCluster.getDir(sDir);
    046    FileRemote dirSave = fileCluster.getDir(sDir);
    047    curveView = new InspcCurveView("curves", null, wind.gralMng(), dirCfg, dirSave, null);
    048    curveView.windCurve = wind;
    049    gralMng = wind.gralMng();
    050    gralMng.gralDevice.addDispatchOrder(initGraphic);
    051    //initGraphic.awaitExecution(1, 0);
    052    while(gralMng.gralDevice.isRunning()){
    053      try{ Thread.sleep(100);}
    054      catch (InterruptedException e)
    055      { //dialogZbnfConfigurator.terminate();
    056      }
    057    }
    058
    059  }
    060
    061
    062  GralGraphicTimeOrder initGraphic = new GralGraphicTimeOrder("GralArea9Window.initGraphic"){
    063    @Override public void executeOrder()
    064    {
    065      curveView.buildGraphicInCurveWindow(null);
    066      //
    067  } };
    068
    069
    070}