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.main;
005    
006    import graphlab.graph.GraphUtils;
007    import graphlab.graph.atributeset.GraphAttrSet;
008    import graphlab.graph.graph.AbstractGraphRenderer;
009    import graphlab.graph.graph.GraphModel;
010    import graphlab.library.algorithms.util.LibraryUtils;
011    import graphlab.platform.core.BlackBoard;
012    import graphlab.platform.StaticUtils;
013    import graphlab.plugins.main.core.AlgorithmUtils;
014    import graphlab.plugins.main.core.CorePluginMethods;
015    import graphlab.plugins.main.saveload.SaveLoadPluginMethods;
016    import graphlab.plugins.main.select.SelectPluginMethods;
017    import graphlab.ui.UIUtils;
018    
019    /**
020     * This class provides usefull information and methods all in one place
021     * @author azin azadi
022     */
023    public class GraphData {
024        BlackBoard blackboard;
025        public SelectPluginMethods select;
026        public SaveLoadPluginMethods saveLoad;
027        AlgorithmUtils algorithmUtils = new AlgorithmUtils();
028        StaticUtils platformUtils = new StaticUtils();
029        GraphUtils graphUtils = new GraphUtils();
030        UIUtils uiUtils = new UIUtils();
031        LibraryUtils libraryUtils = new LibraryUtils();
032    //    public RightClickPluginMethods rightclick;
033    //    public ReporterPluginMethods browser;
034    //    public PreviewPluginMethods preview;
035        //    public HelpPluginMethods help;
036        public CorePluginMethods core;
037    
038        public GraphData(BlackBoard blackboard) {
039            this.blackboard = blackboard;
040            select = new SelectPluginMethods(blackboard);
041            saveLoad = new SaveLoadPluginMethods(blackboard);
042    //        rightclick = new RightClickPluginMethods();
043    //        browser = new ReporterPluginMethods();
044    //        preview = new PreviewPluginMethods();
045    //        help = new HelpPluginMethods(blackboard);
046            core = new CorePluginMethods(blackboard);
047    
048        }
049    
050        /**
051         * @return returns the current graph
052         */
053        public GraphModel getGraph() {
054            return blackboard.getData(GraphAttrSet.name);
055        }
056    
057        public AbstractGraphRenderer getGraphRenderer() {
058            return AbstractGraphRenderer.getCurrentGraphRenderer(blackboard);
059        }
060    
061        public BlackBoard getBlackboard() {
062            return blackboard;
063        }
064    
065    }