use of org.cytoscape.view.vizmap.gui.VizMapGUI in project cytoscape-impl by cytoscape.
the class RemoveVisualMappingsTaskFactory method createTaskIterator.
@Override
public TaskIterator createTaskIterator() {
final VisualStyle style = servicesUtil.get(VisualMappingManager.class).getCurrentVisualStyle();
final Set<VisualMappingFunction<?, ?>> mappings = new HashSet<VisualMappingFunction<?, ?>>();
final VizMapGUI gui = servicesUtil.get(VizMapGUI.class);
if (gui instanceof VizMapperMainPanel) {
final VisualPropertySheet vpSheet = ((VizMapperMainPanel) gui).getSelectedVisualPropertySheet();
final Set<VisualPropertySheetItem<?>> selectedItems = vpSheet.getSelectedItems();
for (VisualPropertySheetItem<?> item : selectedItems) {
if (item.getModel().getVisualMappingFunction() != null)
mappings.add(item.getModel().getVisualMappingFunction());
}
}
return new TaskIterator(new RemoveVisualMappingsTask(mappings, style, servicesUtil));
}
Aggregations