Code example for ScheduledFuture

Methods: cancel

0
    DrawableComposite theComposite = new DrawableComposite();
    theComposite.addDrawable( myBackGroundDrawable );
    if(aFontSize < myEndTextSize){
      theComposite.addDrawable( new WordDrawable( myText, aFontSize ) );
    } else { 
      myTask.cancel( false );
    } 
    return theComposite;
  } 
 
  public class ExplodingText implements Runnable {
    @Override 
    public void run() { 
      try{ 
        float theEllapsedTime = System.currentTimeMillis() - myStartTime;
         
        float theCurrentFontSize = myStartTextSize + (myEndTextSize * (float)Math.pow(theEllapsedTime/myDuration,6));
        
        myDrawableQueue.put( getDrawable( theCurrentFontSize ) );
         
        /* 
        if(theEllapsedTime > myDuration){ 
          myTask.cancel( false ); 
        } 
        */ 
      }catch(Throwable e){
        //we do not want the animation thread to get stuck 
        //so whenever something happens stop the task 
        myTask.cancel( true );
      } 
    } 
  } 
 
  public void setBackGroundDrawable( iDrawable aBackGroundDrawable ) {