Search in sources :

Example 1 with VizMapGUI

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));
}
Also used : VisualMappingFunction(org.cytoscape.view.vizmap.VisualMappingFunction) VisualPropertySheet(org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheet) VizMapGUI(org.cytoscape.view.vizmap.gui.VizMapGUI) TaskIterator(org.cytoscape.work.TaskIterator) VizMapperMainPanel(org.cytoscape.view.vizmap.gui.internal.view.VizMapperMainPanel) VisualStyle(org.cytoscape.view.vizmap.VisualStyle) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) VisualPropertySheetItem(org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 VisualMappingFunction (org.cytoscape.view.vizmap.VisualMappingFunction)1 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)1 VisualStyle (org.cytoscape.view.vizmap.VisualStyle)1 VizMapGUI (org.cytoscape.view.vizmap.gui.VizMapGUI)1 VisualPropertySheet (org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheet)1 VisualPropertySheetItem (org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem)1 VizMapperMainPanel (org.cytoscape.view.vizmap.gui.internal.view.VizMapperMainPanel)1 TaskIterator (org.cytoscape.work.TaskIterator)1