use of org.cytoscape.work.TunableSetter in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
CyEventHelper cyEventHelperRef = getService(bc, CyEventHelper.class);
CyNetworkNaming cyNetworkNamingServiceRef = getService(bc, CyNetworkNaming.class);
UndoSupport undoSupportServiceRef = getService(bc, UndoSupport.class);
CyNetworkViewFactory cyNetworkViewFactoryServiceRef = getService(bc, CyNetworkViewFactory.class);
CyNetworkFactory cyNetworkFactoryServiceRef = getService(bc, CyNetworkFactory.class);
CyRootNetworkManager cyRootNetworkFactoryServiceRef = getService(bc, CyRootNetworkManager.class);
VisualMappingManager visualMappingManagerServiceRef = getService(bc, VisualMappingManager.class);
CyNetworkViewWriterManager networkViewWriterManagerServiceRef = getService(bc, CyNetworkViewWriterManager.class);
CyNetworkManager cyNetworkManagerServiceRef = getService(bc, CyNetworkManager.class);
CyNetworkViewManager cyNetworkViewManagerServiceRef = getService(bc, CyNetworkViewManager.class);
CyApplicationManager cyApplicationManagerServiceRef = getService(bc, CyApplicationManager.class);
CySessionManager cySessionManagerServiceRef = getService(bc, CySessionManager.class);
CyTableFactory cyTableFactoryServiceRef = getService(bc, CyTableFactory.class);
CyTableManager cyTableManagerServiceRef = getService(bc, CyTableManager.class);
CyLayoutAlgorithmManager cyLayoutsServiceRef = getService(bc, CyLayoutAlgorithmManager.class);
CyTableWriterManager cyTableWriterManagerRef = getService(bc, CyTableWriterManager.class);
SynchronousTaskManager<?> synchronousTaskManagerServiceRef = getService(bc, SynchronousTaskManager.class);
TunableSetter tunableSetterServiceRef = getService(bc, TunableSetter.class);
CyRootNetworkManager rootNetworkManagerServiceRef = getService(bc, CyRootNetworkManager.class);
CyNetworkTableManager cyNetworkTableManagerServiceRef = getService(bc, CyNetworkTableManager.class);
RenderingEngineManager renderingEngineManagerServiceRef = getService(bc, RenderingEngineManager.class);
CyNetworkViewFactory nullNetworkViewFactory = getService(bc, CyNetworkViewFactory.class, "(id=NullCyNetworkViewFactory)");
CyGroupManager cyGroupManager = getService(bc, CyGroupManager.class);
CyGroupFactory cyGroupFactory = getService(bc, CyGroupFactory.class);
{
DynamicTaskFactoryProvisionerImpl factory = new DynamicTaskFactoryProvisionerImpl(serviceRegistrar);
registerAllServices(bc, factory);
}
createPreferencesTaskFactories(bc, serviceRegistrar);
createFilterTaskFactories(bc, serviceRegistrar);
createTableTaskFactories(bc, serviceRegistrar, undoSupportServiceRef, cyNetworkManagerServiceRef, cyApplicationManagerServiceRef, cyTableFactoryServiceRef, cyTableManagerServiceRef, cyTableWriterManagerRef, tunableSetterServiceRef, rootNetworkManagerServiceRef, cyNetworkTableManagerServiceRef);
createNetworkTaskFactories(bc, serviceRegistrar, cyEventHelperRef, cyNetworkNamingServiceRef, undoSupportServiceRef, cyNetworkViewFactoryServiceRef, cyNetworkFactoryServiceRef, cyRootNetworkFactoryServiceRef, visualMappingManagerServiceRef, cyNetworkManagerServiceRef, cyNetworkViewManagerServiceRef, cyApplicationManagerServiceRef, synchronousTaskManagerServiceRef, rootNetworkManagerServiceRef, cyNetworkTableManagerServiceRef, renderingEngineManagerServiceRef, nullNetworkViewFactory, cyGroupManager, cyGroupFactory, networkViewWriterManagerServiceRef, tunableSetterServiceRef);
createViewTaskFactories(bc, cyEventHelperRef, undoSupportServiceRef, visualMappingManagerServiceRef, networkViewWriterManagerServiceRef, cyNetworkViewManagerServiceRef, cyApplicationManagerServiceRef, cyLayoutsServiceRef, tunableSetterServiceRef, renderingEngineManagerServiceRef, cyNetworkManagerServiceRef, cySessionManagerServiceRef, serviceRegistrar);
createVizmapTaskFactories(bc, serviceRegistrar);
createSessionTaskFactories(bc, serviceRegistrar);
createGroupTaskFactories(bc, undoSupportServiceRef, cyApplicationManagerServiceRef, cyGroupManager, cyGroupFactory, serviceRegistrar);
createNodeEdgeTaskFactories(bc, serviceRegistrar, cyEventHelperRef, undoSupportServiceRef, cyNetworkViewManagerServiceRef, tunableSetterServiceRef, cyApplicationManagerServiceRef, cyTableManagerServiceRef, renderingEngineManagerServiceRef, visualMappingManagerServiceRef);
createLayoutTaskFactories(bc, serviceRegistrar);
createHelpTaskFactories(bc, serviceRegistrar);
}
use of org.cytoscape.work.TunableSetter in project cytoscape-impl by cytoscape.
the class OpenSessionTask method loadSession.
private void loadSession(AbstractTask currentTask) {
if (sessionFile == null) {
// Should use Tunables to show a file chooser and let the user select the file
getTaskIterator().insertTasksAfter(currentTask, new OpenSessionWithoutWarningTask());
} else {
// Should not show the Tunables dialog
final Map<String, Object> m = new HashMap<>();
m.put("file", sessionFile);
final TunableSetter tunableSetter = serviceRegistrar.getService(TunableSetter.class);
getTaskIterator().insertTasksAfter(currentTask, tunableSetter.createTaskIterator(new TaskIterator(new OpenSessionWithoutWarningTask()), m));
}
}
use of org.cytoscape.work.TunableSetter in project cytoscape-impl by cytoscape.
the class ExportVizmapTaskFactoryImpl method createTaskIterator.
@Override
public TaskIterator createTaskIterator(File file) {
final Map<String, Object> m = new HashMap<>();
m.put("OutputFile", file);
final VizmapWriterManager writerManager = serviceRegistrar.getService(VizmapWriterManager.class);
final CyApplicationManager cyApplicationManager = serviceRegistrar.getService(CyApplicationManager.class);
final VizmapWriter writer = new VizmapWriter(writerManager, cyApplicationManager, serviceRegistrar);
writer.setDefaultFileFormatUsingFileExt(file);
final TunableSetter tunableSetter = serviceRegistrar.getService(TunableSetter.class);
return tunableSetter.createTaskIterator(new TaskIterator(2, writer), m);
}
use of org.cytoscape.work.TunableSetter in project cytoscape-impl by cytoscape.
the class LoadVizmapFileTaskFactoryImpl method createTaskIterator.
@Override
public TaskIterator createTaskIterator(File file, TaskObserver observer) {
final Map<String, Object> m = new HashMap<>();
m.put("file", file);
TunableSetter tunableSetter = serviceRegistrar.getService(TunableSetter.class);
return tunableSetter.createTaskIterator(this.createTaskIterator(), m, observer);
}
use of org.cytoscape.work.TunableSetter in project cytoscape-impl by cytoscape.
the class ImportTableDataTaskFactoryImpl method createTaskIterator.
@Override
public TaskIterator createTaskIterator(final CyTable globalTable, final boolean selectedNetworksOnly, final boolean loadToUnassignedTable, final List<CyNetwork> networkList, final CyRootNetwork rootNetwork, final CyColumn targetJoinColumn, final Class<? extends CyIdentifiable> type) {
ListSingleSelection<String> chooser = new ListSingleSelection<String>(ImportTableDataTask.NETWORK_COLLECTION, ImportTableDataTask.NETWORK_SELECTION, ImportTableDataTask.UNASSIGNED_TABLE);
final Map<String, Object> m = new HashMap<>();
if (!loadToUnassignedTable) {
TableType tableType = getTableType(type);
if (tableType == null)
throw new IllegalArgumentException("The specified type " + type + " is not acceptable.");
ListSingleSelection<TableType> tableTypes = new ListSingleSelection<>(tableType);
tableTypes.setSelectedValue(tableType);
List<String> networkNames = new ArrayList<String>();
for (CyNetwork net : networkList) {
networkNames.add(net.getRow(net).get(CyNetwork.NAME, String.class));
}
ListMultipleSelection<String> networksListTunable = new ListMultipleSelection<>(networkNames);
networksListTunable.setSelectedValues(networkNames);
List<String> rootNetworkNames = new ArrayList<>();
ListSingleSelection<String> rootNetworkList = new ListSingleSelection<>();
if (rootNetwork != null) {
rootNetworkNames.add(rootNetwork.getRow(rootNetwork).get(CyNetwork.NAME, String.class));
rootNetworkList = new ListSingleSelection<String>(rootNetworkNames);
rootNetworkList.setSelectedValue(rootNetworkNames.get(0));
}
List<String> columnNames = new ArrayList<String>();
ListSingleSelection<String> columnNamesList = new ListSingleSelection<>();
if (targetJoinColumn != null) {
columnNames.add(targetJoinColumn.getName());
columnNamesList = new ListSingleSelection<>(columnNames);
columnNamesList.setSelectedValue(columnNames.get(0));
}
if (selectedNetworksOnly) {
m.put("DataTypeTargetForNetworkList", tableTypes);
chooser.setSelectedValue(ImportTableDataTask.NETWORK_SELECTION);
} else {
m.put("DataTypeTargetForNetworkCollection", tableTypes);
chooser.setSelectedValue(ImportTableDataTask.NETWORK_COLLECTION);
}
m.put("TargetNetworkList", networksListTunable);
m.put("KeyColumnForMapping", columnNamesList);
m.put("TargetNetworkCollection", rootNetworkList);
} else {
chooser.setSelectedValue(ImportTableDataTask.UNASSIGNED_TABLE);
}
m.put("WhereImportTable", chooser);
final TunableSetter tunableSetter = serviceRegistrar.getService(TunableSetter.class);
return tunableSetter.createTaskIterator(createTaskIterator(globalTable), m);
}
Aggregations