use of org.cytoscape.view.vizmap.gui.internal.task.ImportDefaultVizmapTask in project cytoscape-impl by cytoscape.
the class ImportDefaultVisualStylesCommand method execute.
@Override
public void execute(final INotification notification) {
final TaskIterator iterator = new TaskIterator(new ImportDefaultVizmapTask(servicesUtil));
final DialogTaskManager taskManager = servicesUtil.get(DialogTaskManager.class);
final VizMapperProxy proxy = (VizMapperProxy) getFacade().retrieveProxy(VizMapperProxy.NAME);
proxy.setIgnoreStyleEvents(true);
taskManager.execute(iterator, new TaskObserver() {
@Override
public void taskFinished(ObservableTask task) {
}
@Override
public void allFinished(FinishStatus finishStatus) {
proxy.setIgnoreStyleEvents(false);
proxy.loadVisualStyles();
proxy.setCurrentVisualStyle(servicesUtil.get(VisualMappingManager.class).getDefaultVisualStyle());
}
});
}
Aggregations