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    
005    package graphlab.plugins.visualization.corebasics.extension;
006    
007    import graphlab.platform.core.AbstractAction;
008    import graphlab.platform.core.BlackBoard;
009    import graphlab.platform.extension.ExtensionHandler;
010    
011    /**
012     * @author Rouzbeh Ebrahimi
013     * Email: ruzbehus@gmail.com
014     */
015    public class VisualizationExtensionHandler implements ExtensionHandler {
016        AbstractAction a = null;
017    
018        /**
019         * @param b
020         * @param ext
021         * @return
022         */
023        public AbstractAction handle(BlackBoard b, Object ext) {
024            a = null;
025            if (ext instanceof VisualizationExtension) {
026                try {
027                    VisualizationExtension gg = (VisualizationExtension) ext;
028                    a = new VisualizationExtensionAction(b, gg);
029                } catch (Exception e) {
030                    e.printStackTrace();
031                }
032            }
033            return a;
034        }
035    }