@@ -156,8 +156,7 @@ public void initialize() {
156156 process (op );
157157 } catch (Throwable t ) {
158158 t .printStackTrace ();
159- indexStarting = i ;
160- break ;
159+ opperations .remove (op );
161160 }
162161 }
163162 setCurrentIndex (indexStarting );
@@ -254,16 +253,20 @@ public Thread regenerateFrom(ICaDoodleOpperation source) {
254253 // com.neuronrobotics.sdk.common.Log.error("Regenerating "+currentIndex);
255254 int currentIndex2 = getCurrentIndex () - 1 ;
256255 ICaDoodleOpperation op = opperations .get (currentIndex2 );
257- List <CSG > process = op .process (getPreviouState ());
258256 getTimelineImageFile (op ).delete ();
259257 try {
260- setTimelineImage (process , op );
261- } catch (IOException e ) {
262- // Auto-generated catch block
263- e .printStackTrace ();
258+ List <CSG > process = op .process (getPreviouState ());
259+ try {
260+ setTimelineImage (process , op );
261+ } catch (IOException e ) {
262+ // Auto-generated catch block
263+ e .printStackTrace ();
264+ }
265+ storeResultInCache (op , process );
266+ setCurrentState (op , process );
267+ } catch (Throwable tr ) {
268+ tr .printStackTrace ();
264269 }
265- storeResultInCache (op , process );
266- setCurrentState (op , process );
267270 }
268271 if (getCurrentIndex () != endIndex ) {
269272 setCurrentIndex (endIndex );
@@ -401,16 +404,16 @@ public Thread deleteOperation(ICaDoodleOpperation op) {
401404 }
402405 opperationRunner = new Thread (() -> {
403406 opperationRunner .setName ("addOpperation Thread " + toProcess .size ());
404- int index = 0 ;
405- for (int i = 0 ; i < getOpperations ().size ();i ++)
406- if (getOpperations ().get (i )== op )
407- index = i ;
407+ int index = 0 ;
408+ for (int i = 0 ; i < getOpperations ().size (); i ++)
409+ if (getOpperations ().get (i ) == op )
410+ index = i ;
408411 getOpperations ().remove (op );
409- if (index == getOpperations ().size ())
410- index -= 1 ;
411- if (index < 1 )
412- index = 1 ;
413- ICaDoodleOpperation newTar = getOpperations ().get (index - 1 );
412+ if (index == getOpperations ().size ())
413+ index -= 1 ;
414+ if (index < 1 )
415+ index = 1 ;
416+ ICaDoodleOpperation newTar = getOpperations ().get (index - 1 );
414417 try {
415418 regenerateFrom (newTar ).join ();
416419 } catch (InterruptedException e ) {
0 commit comments