Package org.gephi.project.api

Examples of org.gephi.project.api.ProjectController


    private javax.swing.JLabel detailsLabel;
    private javax.swing.JLabel workspaceLabel;
    // End of variables declaration//GEN-END:variables

    public void mouseClicked(MouseEvent e) {
        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        if (pc.getCurrentWorkspace() != workspace) {
            pc.openWorkspace(workspace);
        }
    }
View Full Code Here


            NotifyDescriptor dd = new NotifyDescriptor(message, title,
                    NotifyDescriptor.YES_NO_OPTION,
                    NotifyDescriptor.QUESTION_MESSAGE, null, null);
            Object retType = DialogDisplayer.getDefault().notify(dd);
            if (retType == NotifyDescriptor.YES_OPTION) {
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                pc.deleteWorkspace(workspace);
            }
        }
View Full Code Here

        workspaceLabel.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                WorkspaceUISelectorPopupContent content = new WorkspaceUISelectorPopupContent();
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                if (pc.getCurrentProject() == null) {
                    return;
                }
                for (Workspace w : pc.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces()) {
                    content.addListComponent(new WorkspacePanePanel(w));
                }
                pane = new JPopupPane(WorkspaceUISelectorPanel.this, content);
                pane.showPopupPane();
            }
        });

        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);
                }
            }
        });

        ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
        if (pc.getCurrentWorkspace() != null) {
            setSelectedWorkspace(pc.getCurrentWorkspace());
        } else {
            noSelectedWorkspace();
        }
    }
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;
            }
            prec = w;
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;
            }
            next = w;
View Full Code Here

    public Component getStatusLineElement() {
        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {

            public void run() {
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
                pc.addWorkspaceListener(WorkspaceUISelector.this);
                if (pc.getCurrentWorkspace() != null) {
                    initialize(pc.getCurrentWorkspace());
                    select(pc.getCurrentWorkspace());
                }
            }
        });

        panel = new WorkspaceUISelectorPanel();
View Full Code Here

    private Query veryComplexQueryInter;

    @Before
    public void setUp() {
        //Graph
        ProjectController pj = Lookup.getDefault().lookup(ProjectController.class);
        pj.newProject();
        GraphController gc = Lookup.getDefault().lookup(GraphController.class);
        graphModel = gc.getModel();
        GraphFactory factory = graphModel.factory();
        Graph graph = gc.getModel().getUndirectedGraph();
        rootGraph = graph;
View Full Code Here

            public void disable() {
                model = null;
            }
        });

        ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
        if (projectController.getCurrentWorkspace() != null) {
            model = projectController.getCurrentWorkspace().getLookup().lookup(LayoutModelImpl.class);
            if (model == null) {
                model = new LayoutModelImpl();
            }
            projectController.getCurrentWorkspace().add(model);
        }
    }
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();
            }

            //Process
            final ProcessorUI pui = getProcessorUI(processor);
            final ValidResult validResult = new ValidResult();
View Full Code Here

        }, taskname, errorHandler);
    }

    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) {
                workspace = pc.newWorkspace(pc.getCurrentProject());
                pc.openWorkspace(workspace);
            } else {
                workspace = pc.getCurrentWorkspace();
            }
        }
        if (container.getSource() != null) {
            pc.setSource(workspace, container.getSource());
        }

        container.closeLoader();

        DefaultProcessor defaultProcessor = new DefaultProcessor();
View Full Code Here

TOP

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

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.