Package org.gephi.project.impl
Class WorkspaceProviderImpl
- java.lang.Object
-
- org.gephi.project.impl.WorkspaceProviderImpl
-
- All Implemented Interfaces:
WorkspaceProvider
public class WorkspaceProviderImpl extends Object implements WorkspaceProvider
- Author:
- Mathieu Bastian
-
-
Field Summary
Fields Modifier and Type Field Description private WorkspaceImpl
currentWorkspace
private ProjectImpl
project
private List<Workspace>
workspaces
-
Constructor Summary
Constructors Constructor Description WorkspaceProviderImpl(ProjectImpl project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWorkspace(Workspace workspace)
WorkspaceImpl
getCurrentWorkspace()
Returns the current workspace or null if none.Workspace
getPrecedingWorkspace(Workspace workspace)
Workspace
getWorkspace(int id)
Retrieve a workspace based on its unique identifier.Workspace[]
getWorkspaces()
Returns all the workspaces.boolean
hasCurrentWorkspace()
Returns true if the project has a current workspace.WorkspaceImpl
newWorkspace()
WorkspaceImpl
newWorkspace(int id)
void
removeWorkspace(Workspace workspace)
void
setCurrentWorkspace(Workspace currentWorkspace)
-
-
-
Field Detail
-
project
private final transient ProjectImpl project
-
currentWorkspace
private transient WorkspaceImpl currentWorkspace
-
-
Constructor Detail
-
WorkspaceProviderImpl
public WorkspaceProviderImpl(ProjectImpl project)
-
-
Method Detail
-
newWorkspace
public WorkspaceImpl newWorkspace()
-
newWorkspace
public WorkspaceImpl newWorkspace(int id)
-
addWorkspace
public void addWorkspace(Workspace workspace)
-
removeWorkspace
public void removeWorkspace(Workspace workspace)
-
getCurrentWorkspace
public WorkspaceImpl getCurrentWorkspace()
Description copied from interface:WorkspaceProvider
Returns the current workspace or null if none.- Specified by:
getCurrentWorkspace
in interfaceWorkspaceProvider
- Returns:
- current workspace or null if missing
-
setCurrentWorkspace
public void setCurrentWorkspace(Workspace currentWorkspace)
-
getWorkspaces
public Workspace[] getWorkspaces()
Description copied from interface:WorkspaceProvider
Returns all the workspaces.Returns an empty array if no workspaces.
- Specified by:
getWorkspaces
in interfaceWorkspaceProvider
- Returns:
- an array of all workspaces
-
getWorkspace
public Workspace getWorkspace(int id)
Description copied from interface:WorkspaceProvider
Retrieve a workspace based on its unique identifier.- Specified by:
getWorkspace
in interfaceWorkspaceProvider
- Parameters:
id
- workspace's unique identifier- Returns:
- found workspace or null if not found
-
hasCurrentWorkspace
public boolean hasCurrentWorkspace()
Description copied from interface:WorkspaceProvider
Returns true if the project has a current workspace.- Specified by:
hasCurrentWorkspace
in interfaceWorkspaceProvider
- Returns:
- true if has a current workspace, false otherwise
-
-