Package org.gephi.project.api

Examples of org.gephi.project.api.Workspace


    }

    @Override
    public Workspace duplicateWorkspace(Workspace workspace) {
        if (projects.hasCurrentProject()) {
            Workspace duplicate = newWorkspace(projects.getCurrentProject());
            for (WorkspaceDuplicateProvider dp : Lookup.getDefault().lookupAll(WorkspaceDuplicateProvider.class)) {
                dp.duplicate(workspace, duplicate);
            }
            openWorkspace(duplicate);
            return duplicate;
View Full Code Here


        leftArrowButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Workspace sel = getPrecedentWorkspace(workspace);
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                if (pc.getCurrentWorkspace() != sel) {
                    pc.openWorkspace(sel);
                }
            }
        });

        rightArrowButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Workspace sel = getNextWorkspace(workspace);
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                if (pc.getCurrentWorkspace() != sel) {
                    pc.openWorkspace(sel);
                }
            }
View Full Code Here

        });
    }

    private Workspace getPrecedentWorkspace(Workspace workspace) {
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        Workspace prec = null;
        Workspace[] workspaces = pc.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces();
        for (Workspace w : workspaces) {
            if (w == workspace) {
                break;
            }
View Full Code Here

        return prec;
    }

    private Workspace getNextWorkspace(Workspace workspace) {
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        Workspace next = null;
        Workspace[] workspaces = pc.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces();
        for (Workspace w : workspaces) {
            if (next == workspace) {
                return w;
            }
View Full Code Here

                                Matcher matcher = Pattern.compile("Workspace_([0-9]*)_(.*)_bytes").matcher(name);
                                matcher.find();
                                String workspaceId = matcher.group(1);
                                String providerId = matcher.group(2);
                                WorkspaceProviderImpl workspaceProvider = project.getLookup().lookup(WorkspaceProviderImpl.class);
                                Workspace workspace = workspaceProvider.getWorkspace(Integer.parseInt(workspaceId));
                                if (workspace != null) {
                                    readWorkspaceBytes(is, workspace, providerId);
                                }
                            } finally {
                                if (is != null) {
View Full Code Here

            }
            reportPanel.destroy();
            final Processor processor = reportPanel.getProcessor();

            //Project
            Workspace workspace = null;
            ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
            ProjectControllerUI pcui = Lookup.getDefault().lookup(ProjectControllerUI.class);
            if (pc.getCurrentProject() == null) {
                pcui.newProject();
                workspace = pc.getCurrentWorkspace();
View Full Code Here

    @Override
    public void transform(Ranking ranking, Transformer transformer) {
        //Refresh ranking
        ranking = model.getRanking(ranking.getElementType(), ranking.getName());

        Workspace workspace = model.getWorkspace();
        GraphModel graphModel = graphController.getGraphModel(workspace);
        Graph graph = graphModel.getGraphVisible();
        Interpolator interpolator = model.getInterpolator();

        if (ranking.getElementType().equals(Ranking.NODE_ELEMENT)) {
View Full Code Here

                uiModel = null;
                refreshModel();
            }
        });
        if (pc.getCurrentWorkspace() != null) {
            Workspace workspace = pc.getCurrentWorkspace();
            filterModel = workspace.getLookup().lookup(FilterModel.class);
            uiModel = workspace.getLookup().lookup(FilterUIModel.class);
            if (uiModel == null) {
                uiModel = new FilterUIModel();
                workspace.add(uiModel);
            }
        }
        refreshModel();
    }
View Full Code Here

                }
                model = null;
            }
        });
        if (pc.getCurrentWorkspace() != null) {
            Workspace workspace = pc.getCurrentWorkspace();
            model = (FilterModelImpl) workspace.getLookup().lookup(FilterModel.class);
            if (model == null) {
                model = new FilterModelImpl(workspace);
                workspace.add(model);
            }
        }
    }
View Full Code Here

                if (progressProvider != null) {
                    ticket = progressProvider.createTicket("Export to workspace", null);
                }
                Progress.start(ticket);
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                Workspace newWorkspace = pc.duplicateWorkspace(pc.getCurrentWorkspace());
                GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel(newWorkspace);
                graphModel.clear();
                graphModel.pushFrom(graphView);
                Progress.finish(ticket);
                String workspaceName = newWorkspace.getLookup().lookup(WorkspaceInformation.class).getName();
                //StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(FilterControllerImpl.class, "FilterController.exportToNewWorkspace.status", workspaceName));
            }
        }, "Export filter to workspace").start();
    }
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.