001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 package graphlab.plugins.algorithmanimator.core.atoms; 005 006 import graphlab.library.event.DelayEvent; 007 import graphlab.library.event.Event; 008 import graphlab.platform.core.BlackBoard; 009 import graphlab.plugins.algorithmanimator.core.AtomAnimator; 010 011 012 /** 013 * @author Omid Aladini 014 */ 015 public class DelayEventHandler implements AtomAnimator<DelayEvent> { 016 public boolean isAnimatable(Event event) { 017 if (event instanceof DelayEvent) 018 return true; 019 else 020 return false; 021 } 022 023 public DelayEvent animate(DelayEvent event, BlackBoard b) { 024 try { 025 Thread.sleep(300); 026 } catch (InterruptedException e) { 027 e.printStackTrace(); 028 } 029 return event; 030 } 031 }