Search in sources :

Example 1 with CompatibilityEngine

use of org.gephi.visualization.opengl.CompatibilityEngine in project gephi by gephi.

the class VizController method initInstances.

public void initInstances() {
    vizConfig = new VizConfig();
    graphIO = new StandardGraphIO();
    engine = new CompatibilityEngine();
    vizEventManager = new StandardVizEventManager();
    scheduler = new CompatibilityScheduler();
    limits = new GraphLimits();
    dataBridge = new DataBridge();
    textManager = new TextManager();
    screenshotMaker = new ScreenshotMaker();
    currentModel = new VizModel(true);
    selectionManager = new SelectionManager();
    if (vizConfig.isUseGLJPanel()) {
    //No more supported
    } else if (Utilities.isMac()) {
        drawable = createCanvas();
    } else {
        drawable = createNewtCanvas();
    }
    drawable.initArchitecture();
    engine.initArchitecture();
    ((CompatibilityScheduler) scheduler).initArchitecture();
    ((StandardGraphIO) graphIO).initArchitecture();
    dataBridge.initArchitecture();
    textManager.initArchitecture();
    screenshotMaker.initArchitecture();
    vizEventManager.initArchitecture();
    selectionManager.initArchitecture();
    ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
    pc.addWorkspaceListener(new WorkspaceListener() {

        @Override
        public void initialize(Workspace workspace) {
            if (workspace.getLookup().lookup(VizModel.class) == null) {
                workspace.add(new VizModel(workspace));
            }
        }

        @Override
        public void select(Workspace workspace) {
            engine.reinit();
        }

        @Override
        public void unselect(Workspace workspace) {
        }

        @Override
        public void close(Workspace workspace) {
        }

        @Override
        public void disable() {
            engine.reinit();
        }
    });
    if (pc.getCurrentWorkspace() != null) {
        engine.reinit();
    }
}
Also used : SelectionManager(org.gephi.visualization.api.selection.SelectionManager) CompatibilityEngine(org.gephi.visualization.opengl.CompatibilityEngine) TextManager(org.gephi.visualization.text.TextManager) StandardVizEventManager(org.gephi.visualization.events.StandardVizEventManager) CompatibilityScheduler(org.gephi.visualization.scheduler.CompatibilityScheduler) ProjectController(org.gephi.project.api.ProjectController) WorkspaceListener(org.gephi.project.api.WorkspaceListener) StandardGraphIO(org.gephi.visualization.swing.StandardGraphIO) ScreenshotMaker(org.gephi.visualization.screenshot.ScreenshotMaker) VizConfig(org.gephi.visualization.apiimpl.VizConfig) DataBridge(org.gephi.visualization.bridge.DataBridge) Workspace(org.gephi.project.api.Workspace)

Aggregations

ProjectController (org.gephi.project.api.ProjectController)1 Workspace (org.gephi.project.api.Workspace)1 WorkspaceListener (org.gephi.project.api.WorkspaceListener)1 SelectionManager (org.gephi.visualization.api.selection.SelectionManager)1 VizConfig (org.gephi.visualization.apiimpl.VizConfig)1 DataBridge (org.gephi.visualization.bridge.DataBridge)1 StandardVizEventManager (org.gephi.visualization.events.StandardVizEventManager)1 CompatibilityEngine (org.gephi.visualization.opengl.CompatibilityEngine)1 CompatibilityScheduler (org.gephi.visualization.scheduler.CompatibilityScheduler)1 ScreenshotMaker (org.gephi.visualization.screenshot.ScreenshotMaker)1 StandardGraphIO (org.gephi.visualization.swing.StandardGraphIO)1 TextManager (org.gephi.visualization.text.TextManager)1