Package org.gephi.project.api

Examples of org.gephi.project.api.Workspace


            executor.execute(exporter, new Runnable() {

                @Override
                public void run() {
                    //Get the current workspace and set it to the exporter
                    Workspace currentWorkspace = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace();
                    exporter.setWorkspace(currentWorkspace);
                   
                    //Execute export
                    cancelled = !exporter.execute();
                   
View Full Code Here


    @Override
    public synchronized DynamicModelImpl getModel() {
        if (model == null) {
            ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
            if (projectController.getCurrentWorkspace() != null) {
                Workspace workspace = projectController.getCurrentWorkspace();
                return workspace.getLookup().lookup(DynamicModelImpl.class);
            }
        }
        return model;
    }
View Full Code Here

        graphController = Lookup.getDefault().lookup(GraphController.class);
    }

    @Override
    public Ranking[] buildRanking(RankingModel model) {
        Workspace workspace = model.getWorkspace();
        GraphModel graphModel = graphController.getGraphModel(workspace);

        return new Ranking[]{new DegreeRanking(Ranking.NODE_ELEMENT, graphModel, model)};
    }
View Full Code Here

            }
        }
    }

    public synchronized AttributeModel getModel() {
        Workspace workspace = projectController.getCurrentWorkspace();
        if (workspace != null) {
            AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
            if (model != null) {
                return model;
            }
            model = new IndexedAttributeModel(workspace);
            workspace.add(model);
            return model;
        }
        return null;
    }
View Full Code Here

        graphController = Lookup.getDefault().lookup(GraphController.class);
    }

    @Override
    public Ranking[] buildRanking(RankingModel model) {
        Workspace workspace = model.getWorkspace();
        GraphModel graphModel = graphController.getGraphModel(workspace);
        if (graphModel.isDirected() || graphModel.isMixed()) {
            return new Ranking[]{new OutDegreeRanking(Ranking.NODE_ELEMENT, graphModel, model)};
        }
View Full Code Here

        graphController = Lookup.getDefault().lookup(GraphController.class);
    }

    @Override
    public Ranking[] buildRanking(RankingModel model) {
        Workspace workspace = model.getWorkspace();
        GraphModel graphModel = graphController.getGraphModel(workspace);
        if (graphModel.isDirected() || graphModel.isMixed()) {
            return new Ranking[]{new InDegreeRanking(Ranking.NODE_ELEMENT, graphModel, model)};
        }
View Full Code Here

@ServiceProvider(service = GraphController.class)
public class GraphControllerImpl implements GraphController {

    @Override
    public synchronized GraphModelImpl getGraphModel() {
        Workspace currentWorkspace = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace();
        if (currentWorkspace == null) {
            return null;
        }
        GraphModelImpl model = currentWorkspace.getLookup().lookup(GraphModelImpl.class);
        if (model == null) {
            model = newGraphModel(currentWorkspace);
        }
        return model;
    }
View Full Code Here

        return projects;
    }

    @Override
    public Workspace newWorkspace(Project project) {
        Workspace workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace();

        //Event
        fireWorkspaceEvent(EventType.INITIALIZE, workspace);
        return workspace;
    }
View Full Code Here

    @Override
    public void deleteWorkspace(Workspace workspace) {
        Project project = workspace.getProject();
        WorkspaceProviderImpl workspaceProvider = project.getLookup().lookup(WorkspaceProviderImpl.class);

        Workspace toSelectWorkspace = null;
        if (getCurrentWorkspace() == workspace) {
            toSelectWorkspace = workspaceProvider.getPrecedingWorkspace(workspace);
        }

        workspaceProvider.removeWorkspace(workspace);
View Full Code Here

        projects.setCurrentProject(projectImpl);
        projectInformationImpl.open();

        if (!workspaceProviderImpl.hasCurrentWorkspace()) {
            if (workspaceProviderImpl.getWorkspaces().length == 0) {
                Workspace workspace = newWorkspace(project);
                openWorkspace(workspace);
            } else {
                Workspace workspace = workspaceProviderImpl.getWorkspaces()[0];
                openWorkspace(workspace);
            }
        } else {
            fireWorkspaceEvent(EventType.SELECT, workspaceProviderImpl.getCurrentWorkspace());
        }
View Full Code Here

TOP

Related Classes of org.gephi.project.api.Workspace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.