예제 #1
0
 public void run() {
   // int counter=0;
   while (true) {
     try {
       try {
         long curTime = System.currentTimeMillis();
         while (!propagateChange
             || ((curTime = System.currentTimeMillis()) - startTime) < millis) {
           if (!propagateChange) {
             sleep(millis);
           } else {
             long sleepTime = millis - (curTime - startTime) - 10;
             if (sleepTime < 10) break;
             sleep(sleepTime);
           }
         }
         propagateChange = false;
         // if(counter++ % 10 == 0)
         // System.out.println(curTime-startTime+" "+curTime+" "+startTime);
       } catch (InterruptedException e) {
         ExceptionManager.doError(e);
       }
       ;
       try {
         synchronized (this) {
           ((HasBroker) MainWindow.get()).getBroker().propagateChange(UserDefinedFunction.this);
         }
       } catch (BrokerException e) {
         ExceptionManager.doError(e);
       }
     } catch (Throwable t) {
       ExceptionManager.doError(t);
     }
   } // while
 } // run
예제 #2
0
 public void evalFunction() {
   try {
     if (f != null) {
       f.eval();
     }
   } catch (MathException e) {
     ExceptionManager.doError(e);
   }
 } // evalFunction
예제 #3
0
 public void print() {
   PrinterJob printJob = PrinterJob.getPrinterJob();
   printJob.setPrintable(this);
   if (printJob.printDialog())
     try {
       printJob.print();
     } catch (PrinterException pe) {
       ExceptionManager.doError("Error printing: ", pe);
     }
 }
예제 #4
0
  public Object operator_set_ende(Object[] values) {
    Object obj = values[0];
    TermNode tm;
    if (obj instanceof AffPoint) {
      tm = new PathReference((AffPoint) obj, new LinkedList(), broker);
    } else {
      tm = ((UserFunction) values[0]).getFunction();
    }

    endPoint.setFunction(tm);
    try {
      broker.propagateChange(endPoint);
    } catch (BrokerException e) {
      ExceptionManager.doError("Fehler bei der Methode 'ende' (" + getKey() + ").", e);
    }
    return null;
  } // operator_ende