Search in sources :

Example 1 with DefaultProcessor

use of org.gephi.io.processor.plugin.DefaultProcessor in project gephi by gephi.

the class DesktopGeneratorController method finishGenerate.

private void finishGenerate(Container container) {
    ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
    ProjectControllerUI pcui = Lookup.getDefault().lookup(ProjectControllerUI.class);
    Workspace workspace;
    if (pc.getCurrentProject() == null) {
        pcui.newProject();
        workspace = pc.getCurrentWorkspace();
    } else {
        workspace = pc.newWorkspace(pc.getCurrentProject());
        pc.openWorkspace(workspace);
    }
    if (container.getSource() != null) {
        pc.setSource(workspace, container.getSource());
    }
    container.closeLoader();
    DefaultProcessor defaultProcessor = new DefaultProcessor();
    defaultProcessor.setContainers(new ContainerUnloader[] { container.getUnloader() });
    defaultProcessor.setWorkspace(workspace);
    defaultProcessor.process();
}
Also used : DefaultProcessor(org.gephi.io.processor.plugin.DefaultProcessor) ProjectController(org.gephi.project.api.ProjectController) ProjectControllerUI(org.gephi.desktop.project.api.ProjectControllerUI) Workspace(org.gephi.project.api.Workspace)

Aggregations

ProjectControllerUI (org.gephi.desktop.project.api.ProjectControllerUI)1 DefaultProcessor (org.gephi.io.processor.plugin.DefaultProcessor)1 ProjectController (org.gephi.project.api.ProjectController)1 Workspace (org.gephi.project.api.Workspace)1