public interface Workspace
extends org.openide.util.Lookup.Provider
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 WorkspacePersistenceProvider
.
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); }
Modifier and Type | Method and Description |
---|---|
void |
add(Object instance)
Adds an instance to this workspaces lookup.
|
int |
getId()
Returns the workspace unique identifier
|
org.openide.util.Lookup |
getLookup()
Get any instance in the current lookup.
|
Project |
getProject()
Returns the project this workspace belong to
|
void |
remove(Object instance)
Removes an instance from this workspaces lookup.
|
void add(Object instance)
instance
- the instance that is to be pushed to the lookupvoid remove(Object instance)
instance
- the instance that is to be removed from the lookuporg.openide.util.Lookup getLookup()
May contains:
GraphModel
LayoutModel
StatisticsModel
FiltersModel
PreviewModel
VizModel
getLookup
in interface org.openide.util.Lookup.Provider
Project getProject()
int getId()
Copyright © 2007–2015 Gephi Consortium. All rights reserved.