use of org.gephi.project.api.ProjectController in project gephi by gephi.
the class ProjectPropertiesEditor method save.
public void save(Project project) {
ProjectInformation info = project.getLookup().lookup(ProjectInformation.class);
if (info != null) {
if (!nameTextField.getText().isEmpty() && !nameTextField.getText().equals(info.getName())) {
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.renameProject(project, nameTextField.getText());
}
}
ProjectMetaData metaData = project.getLookup().lookup(ProjectMetaData.class);
if (metaData != null) {
metaData.setTitle(titleTextField.getText());
metaData.setAuthor(authorTextField.getText());
metaData.setKeywords(keywordsTextField.getText());
metaData.setDescription(descriptionTextArea.getText());
}
}
use of org.gephi.project.api.ProjectController in project gephi by gephi.
the class WorkspacePanel method refreshModel.
private synchronized void refreshModel() {
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
if (pc.getCurrentProject() != null) {
WorkspaceProvider workspaceProvider = pc.getCurrentProject().getLookup().lookup(WorkspaceProvider.class);
Workspace[] workspaces = workspaceProvider.getWorkspaces();
if (workspaces.length > 0) {
for (Workspace workspace : workspaces) {
int index = tabDataModel.size();
WorkspaceInformation workspaceInformation = workspace.getLookup().lookup(WorkspaceInformation.class);
tabDataModel.addTab(index, new TabData(new WorkspaceComponent(workspace), null, workspaceInformation.getName(), workspaceInformation.getSource()));
if (workspaceProvider.getCurrentWorkspace() == workspace) {
tabbedContainer.getSelectionModel().setSelectedIndex(index);
workspace.getLookup().lookup(WorkspaceInformation.class).addChangeListener(this);
}
}
return;
}
}
// Clear
tabbedContainer.getSelectionModel().clearSelection();
if (tabDataModel.size() > 0) {
tabDataModel.removeTabs(0, tabDataModel.size() - 1);
}
}
use of org.gephi.project.api.ProjectController in project gephi by gephi.
the class Installer method initGephi.
private void initGephi() {
final ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
pc.startup();
DragNDropFrameAdapter.register();
}
});
}
use of org.gephi.project.api.ProjectController in project gephi by gephi.
the class RenameWorkspace method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
String name = "";
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
name = pc.getCurrentWorkspace().getLookup().lookup(WorkspaceInformation.class).getName();
DialogDescriptor.InputLine dd = new DialogDescriptor.InputLine("", NbBundle.getMessage(RenameWorkspace.class, "RenameWorkspace.dialog.title"));
dd.setInputText(name);
if (DialogDisplayer.getDefault().notify(dd).equals(DialogDescriptor.OK_OPTION) && !dd.getInputText().isEmpty()) {
Lookup.getDefault().lookup(ProjectControllerUI.class).renameWorkspace(dd.getInputText());
}
}
use of org.gephi.project.api.ProjectController in project gephi by gephi.
the class VizController method initInstances.
public void initInstances() {
vizConfig = new VizConfig();
graphIO = new StandardGraphIO();
engine = new CompatibilityEngine();
vizEventManager = new StandardVizEventManager();
scheduler = new CompatibilityScheduler();
limits = new GraphLimits();
dataBridge = new DataBridge();
textManager = new TextManager();
screenshotMaker = new ScreenshotMaker();
currentModel = new VizModel(true);
selectionManager = new SelectionManager();
if (vizConfig.isUseGLJPanel()) {
//No more supported
} else if (Utilities.isMac()) {
drawable = createCanvas();
} else {
drawable = createNewtCanvas();
}
drawable.initArchitecture();
engine.initArchitecture();
((CompatibilityScheduler) scheduler).initArchitecture();
((StandardGraphIO) graphIO).initArchitecture();
dataBridge.initArchitecture();
textManager.initArchitecture();
screenshotMaker.initArchitecture();
vizEventManager.initArchitecture();
selectionManager.initArchitecture();
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.addWorkspaceListener(new WorkspaceListener() {
@Override
public void initialize(Workspace workspace) {
if (workspace.getLookup().lookup(VizModel.class) == null) {
workspace.add(new VizModel(workspace));
}
}
@Override
public void select(Workspace workspace) {
engine.reinit();
}
@Override
public void unselect(Workspace workspace) {
}
@Override
public void close(Workspace workspace) {
}
@Override
public void disable() {
engine.reinit();
}
});
if (pc.getCurrentWorkspace() != null) {
engine.reinit();
}
}
Aggregations