Workspace interface that internally stores, through its
Lookup, various information and instances.
Workpace is a top concept in Gephi because all models that modules possesses are usually divided by workspace, for instance one GraphModel
per workspace. Therefore this class has a Lookup mechanism to let modules store their model in the workspace's lookup and query it when needed.
To know how you can manage loading and saving data in Gephi project files, see {@link WorkspacePersistenceProvider}.
How to associate new data model to the workspace
In your new module, listen to {@link WorkspaceListener} and call
add()
method when initialize:
public void initialize(Workspace workspace) { workspace.add(new MyDataModel()) }
When a workspace is selected, retrieve the workspace's data model:
public void select(Workspace workspace) { MyDataModel model = workspace.getLookup().lookup(MyDataModel.class); }
@author Mathieu Bastian