Package org.gephi.workspace.impl

Examples of org.gephi.workspace.impl.WorkspaceInformationImpl


        return project;
    }

    public Workspace readWorkspace(XMLStreamReader reader) throws Exception {
        WorkspaceImpl workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace();
        WorkspaceInformationImpl info = workspace.getLookup().lookup(WorkspaceInformationImpl.class);

        //Name
        info.setName(reader.getAttributeValue(null, "name"));

        //Status
        String workspaceStatus = reader.getAttributeValue(null, "status");
        if (workspaceStatus.equals("open")) {
            info.open();
        } else if (workspaceStatus.equals("closed")) {
            info.close();
        } else {
            info.invalid();
        }

        //Hack to set this workspace active, when readers need to use attributes for instance
        ProjectControllerImpl pc = Lookup.getDefault().lookup(ProjectControllerImpl.class);
        pc.setTemporaryOpeningWorkspace(workspace);
View Full Code Here


                    } else {
                        workspaceId = Integer.parseInt(reader.getAttributeValue(null, "id"));
                    }

                    workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace(workspaceId);
                    WorkspaceInformationImpl info = workspace.getLookup().lookup(WorkspaceInformationImpl.class);

                    //Name
                    info.setName(reader.getAttributeValue(null, "name"));

                    //Status
                    String workspaceStatus = reader.getAttributeValue(null, "status");
                    if (workspaceStatus.equals("open")) {
                        info.open();
                    } else if (workspaceStatus.equals("closed")) {
                        info.close();
                    } else {
                        info.invalid();
                    }

                    //Hack to set this workspace active, when readers need to use attributes for instance
                    ProjectControllerImpl pc = Lookup.getDefault().lookup(ProjectControllerImpl.class);
                    pc.setTemporaryOpeningWorkspace(workspace);

                    //WorkspacePersistent
                    readWorkspaceChildren(workspace, reader);
                    if (currentProvider != null) {
                        //One provider not correctly closed
                        throw new GephiFormatException("The '" + currentProvider.getIdentifier() + "' persistence provider is not ending read.");
                    }
                    pc.setTemporaryOpeningWorkspace(null);

                    //Current workspace
                    if (info.isOpen()) {
                        WorkspaceProviderImpl workspaces = project.getLookup().lookup(WorkspaceProviderImpl.class);
                        workspaces.setCurrentWorkspace(workspace);
                    }
                }
            } else if (eventType.equals(XMLStreamReader.END_ELEMENT)) {
View Full Code Here

TOP

Related Classes of org.gephi.workspace.impl.WorkspaceInformationImpl

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.