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.visualization;
005    
006    import graphlab.platform.core.BlackBoard;
007    import graphlab.platform.extension.ExtensionLoader;
008    import graphlab.platform.plugin.PluginInterface;
009    import graphlab.plugins.visualization.corebasics.extension.VisualizationExtensionHandler;
010    import graphlab.ui.UI;
011    import org.xml.sax.SAXException;
012    
013    import java.io.IOException;
014    
015    /**
016     * @author Rouzbeh
017     */
018    public class Init implements PluginInterface {
019        static {
020            ExtensionLoader.registerExtensionHandler(new VisualizationExtensionHandler());
021    
022        }
023    
024        public void init(BlackBoard blackboard) {
025            UI ui = (UI) blackboard.getData(UI.name);
026            try {
027                ui.addXML("/graphlab/plugins/visualization/VisualizationUI.xml", getClass());
028            } catch (IOException e) {
029                e.printStackTrace();
030                System.out.println("xml file was not found , or IO error");
031    
032            } catch (SAXException e) {
033                e.printStackTrace();
034            }
035        }
036    }