4 */ |
4 */ |
5 package isac.bridge; |
5 package isac.bridge; |
6 |
6 |
7 import isac.util.CalcChanged; |
7 import isac.util.CalcChanged; |
8 import isac.util.CalcChangedEvent; |
8 import isac.util.CalcChangedEvent; |
|
9 import isac.util.NotInSpecificationPhaseException; |
9 import isac.util.StartSolvingException; |
10 import isac.util.StartSolvingException; |
10 import isac.util.formulae.CalcHead; |
11 import isac.util.formulae.CalcHead; |
11 import isac.util.formulae.CalcFormula; |
12 import isac.util.formulae.CalcFormula; |
|
13 import isac.util.formulae.CalcHeadCompoundID; |
12 import isac.util.formulae.Position; |
14 import isac.util.formulae.Position; |
13 import isac.util.interfaces.ICalcIterator; |
15 import isac.util.interfaces.ICalcIterator; |
14 import isac.util.interfaces.IToCalc; |
16 import isac.util.interfaces.IToCalc; |
15 import isac.util.interfaces.IToUser; |
17 import isac.util.interfaces.IToUser; |
16 import isac.util.tactics.Tactic; |
18 import isac.util.tactics.Tactic; |
508 e.printStackTrace(); |
510 e.printStackTrace(); |
509 } |
511 } |
510 return null; |
512 return null; |
511 } |
513 } |
512 |
514 |
|
515 /** |
|
516 * @see isac.util.interfaces.IToCalc#tryMatch(CalcHead, CalcHeadCompoundID) |
|
517 * FIXXXME.WN050610 change to: tryMatch( CalcHeadCompoundID) |
|
518 */ |
|
519 public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID) |
|
520 throws NotInSpecificationPhaseException { |
|
521 CalcHead newCalcHead = null; |
|
522 try { |
|
523 //WN040924 newCalcHead = |
|
524 // bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); |
|
525 bridgeRMI_.tryMatch(calcHead.getCalcTreeID(), problemID); |
|
526 if (newCalcHead == null) { |
|
527 throw new NotInSpecificationPhaseException(); |
|
528 } |
|
529 calcHead.fillValuesfrom(newCalcHead); |
|
530 } catch (RemoteException e) { |
|
531 // TODO Auto-generated catch block |
|
532 e.printStackTrace(); |
|
533 } |
|
534 } |
|
535 |
|
536 /** |
|
537 * Refine a given problem for this CalcTree |
|
538 * |
|
539 * @param problemID |
|
540 * @return CalcHead, if the operation was successful, else null |
|
541 */ |
|
542 public void tryRefine(CalcHead calcHead, CalcHeadCompoundID problemID) |
|
543 throws NotInSpecificationPhaseException { |
|
544 CalcHead newCalcHead = null; |
|
545 try { |
|
546 //WN040924 newCalcHead = |
|
547 // bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); |
|
548 bridgeRMI_.tryRefine(calcHead.getCalcTreeID(), problemID); |
|
549 if (newCalcHead == null) { |
|
550 throw new NotInSpecificationPhaseException(); |
|
551 } |
|
552 calcHead.fillValuesfrom(newCalcHead); |
|
553 } catch (RemoteException e) { |
|
554 // TODO Auto-generated catch block |
|
555 e.printStackTrace(); |
|
556 } |
|
557 } |
|
558 |
513 } |
559 } |