use of org.gephi.preview.api.PreviewProperty in project gephi by gephi.
the class PreviewUIControllerImpl method savePreset.
@Override
public void savePreset(String name) {
if (model != null) {
PreviewModel previewModel = previewController.getModel();
Map<String, Object> map = new HashMap<>();
for (PreviewProperty p : previewModel.getProperties().getProperties()) {
map.put(p.getName(), p.getValue());
}
for (Entry<String, Object> p : previewModel.getProperties().getSimpleValues()) {
map.put(p.getKey(), p.getValue());
}
PreviewPreset preset = new PreviewPreset(name, map);
presetUtils.savePreset(preset);
model.setCurrentPreset(preset);
}
}
use of org.gephi.preview.api.PreviewProperty in project gephi by gephi.
the class PreviewWorkspaceDuplicateProvider method duplicate.
@Override
public void duplicate(Workspace source, Workspace destination) {
PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);
PreviewModel sourceModel = previewController.getModel(source);
PreviewModel destModel = previewController.getModel(destination);
destModel.setManagedRenderers(sourceModel.getManagedRenderers());
for (PreviewProperty property : sourceModel.getProperties().getProperties()) {
destModel.getProperties().putValue(property.getName(), property.getValue());
}
for (Entry<String, Object> property : sourceModel.getProperties().getSimpleValues()) {
destModel.getProperties().putValue(property.getKey(), property.getValue());
}
}
Aggregations