Package org.gephi.project.api

Examples of org.gephi.project.api.Workspace


    @Test
    public void testExport() {
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        pc.newProject();
        Workspace workspace = pc.getCurrentWorkspace();

        String sample = "/org/gephi/desktop/welcome/samples/Les Miserables.gexf";
        final InputStream stream = WelcomeTopComponent.class.getResourceAsStream(sample);
        try {
            stream.reset();
View Full Code Here


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

    @Test
    public void testExport() {
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        pc.newProject();
        Workspace workspace = pc.getCurrentWorkspace();

        Container container = Lookup.getDefault().lookup(ContainerFactory.class).newContainer();
        RandomGraph randomGraph = new RandomGraph();
        randomGraph.generate(container.getLoader());
View Full Code Here

        });

        leftArrowButton.addActionListener(new ActionListener() {

            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() {

            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

            }
            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

    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 {
            if (pc.getCurrentWorkspace() == null) {
View Full Code Here

    private final DynamicModel dynamicModel;
    private final boolean dynamic;

    public DynamicAttributesHelper(Filter filter, Graph graph) {
        if (graph != null) {
            Workspace workspace = graph.getGraphModel().getWorkspace();
            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
            filterModel = filterController.getModel(workspace);

            DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
            dynamicModel = dynamicController.getModel(workspace);
View Full Code Here

    public IDGen getIDGen() {
        return iDGen;
    }

    private synchronized Dhns getCurrentDhns() {
        Workspace currentWorkspace = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace();
        if (currentWorkspace == null) {
            return null;
        }
        Dhns dhns = currentWorkspace.getLookup().lookup(Dhns.class);
        if (dhns == null) {
            dhns = newDhns(currentWorkspace);
        }
        return dhns;
    }
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.