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 WorkspaceImplcurrentWorkspaceprivate ProjectImplprojectprivate List<Workspace>workspaces
-
Constructor Summary
Constructors Constructor Description WorkspaceProviderImpl(ProjectImpl project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkspaceImplgetCurrentWorkspace()Returns the current workspace or null if none.protected WorkspacegetPrecedingWorkspace(Workspace workspace)WorkspacegetWorkspace(int id)Retrieve a workspace based on its unique identifier.Workspace[]getWorkspaces()Returns all the workspaces.booleanhasCurrentWorkspace()Returns true if the project has a current workspace.protected WorkspaceImplnewWorkspace()protected WorkspaceImplnewWorkspace(int id)protected voidpurge()protected voidremoveWorkspace(Workspace workspace)protected voidsetCurrentWorkspace(Workspace currentWorkspace)
-
-
-
Field Detail
-
project
private final ProjectImpl project
-
currentWorkspace
private WorkspaceImpl currentWorkspace
-
-
Constructor Detail
-
WorkspaceProviderImpl
public WorkspaceProviderImpl(ProjectImpl project)
-
-
Method Detail
-
newWorkspace
protected WorkspaceImpl newWorkspace()
-
newWorkspace
protected WorkspaceImpl newWorkspace(int id)
-
removeWorkspace
protected void removeWorkspace(Workspace workspace)
-
getCurrentWorkspace
public WorkspaceImpl getCurrentWorkspace()
Description copied from interface:WorkspaceProviderReturns the current workspace or null if none.- Specified by:
getCurrentWorkspacein interfaceWorkspaceProvider- Returns:
- current workspace or null if missing
-
purge
protected void purge()
-
setCurrentWorkspace
protected void setCurrentWorkspace(Workspace currentWorkspace)
-
getWorkspaces
public Workspace[] getWorkspaces()
Description copied from interface:WorkspaceProviderReturns all the workspaces.Returns an empty array if no workspaces.
- Specified by:
getWorkspacesin interfaceWorkspaceProvider- Returns:
- an array of all workspaces
-
getWorkspace
public Workspace getWorkspace(int id)
Description copied from interface:WorkspaceProviderRetrieve a workspace based on its unique identifier.- Specified by:
getWorkspacein interfaceWorkspaceProvider- Parameters:
id- workspace's unique identifier- Returns:
- found workspace or null if not found
-
hasCurrentWorkspace
public boolean hasCurrentWorkspace()
Description copied from interface:WorkspaceProviderReturns true if the project has a current workspace.- Specified by:
hasCurrentWorkspacein interfaceWorkspaceProvider- Returns:
- true if has a current workspace, false otherwise
-
-