use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
StreamUtilImpl streamUtil = new StreamUtilImpl(serviceRegistrar);
BasicCyFileFilter expressionFilter = new BasicCyFileFilter(new String[] { "pvals" }, new String[] { "text/plain" }, "Cytoscape Expression Matrix", DataCategory.TABLE, streamUtil);
// Always register CYS filters from higher to lower version!
BasicCyFileFilter cys3Filter = new SessionFileFilter(new String[] { "cys" }, new String[] { "application/zip" }, "Cytoscape 3 Session", DataCategory.SESSION, "3.0.0", streamUtil);
BasicCyFileFilter cys2Filter = new SessionFileFilter(new String[] { "cys" }, new String[] { "application/zip" }, "Cytoscape 2 Session", DataCategory.SESSION, "2.0.0", streamUtil);
BasicCyFileFilter pngFilter = new BasicCyFileFilter(new String[] { "png" }, new String[] { "image/png" }, "PNG", DataCategory.IMAGE, streamUtil);
BasicCyFileFilter jpegFilter = new BasicCyFileFilter(new String[] { "jpg", "jpeg" }, new String[] { "image/jpeg" }, "JPEG", DataCategory.IMAGE, streamUtil);
BasicCyFileFilter pdfFilter = new BasicCyFileFilter(new String[] { "pdf" }, new String[] { "image/pdf" }, "PDF", DataCategory.IMAGE, streamUtil);
BasicCyFileFilter psFilter = new BasicCyFileFilter(new String[] { "ps" }, new String[] { "image/ps" }, "PostScript", DataCategory.IMAGE, streamUtil);
BasicCyFileFilter svgFilter = new BasicCyFileFilter(new String[] { "svg" }, new String[] { "image/svg" }, "SVG", DataCategory.IMAGE, streamUtil);
BasicCyFileFilter attrsFilter = new BasicCyFileFilter(new String[] { "attrs" }, new String[] { "text/plain" }, "Text", DataCategory.TABLE, streamUtil);
BasicCyFileFilter sifFilter = new BasicCyFileFilter(new String[] { "sif" }, new String[] { "text/sif" }, "SIF", DataCategory.NETWORK, streamUtil);
BasicCyFileFilter nnfFilter = new BasicCyFileFilter(new String[] { "nnf" }, new String[] { "text/nnf" }, "NNF", DataCategory.NETWORK, streamUtil);
BasicCyFileFilter csvFilter = new BasicCyFileFilter(new String[] { "csv" }, new String[] { "text/plain" }, "CSV", DataCategory.TABLE, streamUtil);
BasicCyFileFilter sessionTableFilter = new BasicCyFileFilter(new String[] { "cytable" }, new String[] { "text/plain" }, "Session Table", DataCategory.TABLE, streamUtil);
GenericXGMMLFileFilter xgmmlFilter = new GenericXGMMLFileFilter(new String[] { "xgmml", "xml" }, new String[] { "text/xgmml", "text/xgmml+xml" }, "XGMML", DataCategory.NETWORK, streamUtil);
SessionXGMMLFileFilter sessXgmmlFileFilter = new SessionXGMMLFileFilter(new String[] { "xgmml" }, new String[] { "text/xgmml", "text/xgmml+xml" }, "Cy3 Session XGMML", DataCategory.NETWORK, streamUtil);
SessionXGMMLNetworkFileFilter sessXgmmlNetFileFilter = new SessionXGMMLNetworkFileFilter(new String[] { "xgmml" }, new String[] { "text/xgmml", "text/xgmml+xml" }, "CYS Network XGMML", DataCategory.NETWORK, streamUtil);
SessionXGMMLNetworkViewFileFilter sessXgmmlViewFileFilter = new SessionXGMMLNetworkViewFileFilter(new String[] { "xgmml" }, new String[] { "text/xgmml", "text/xgmml+xml" }, "CYS View XGMML", DataCategory.NETWORK, streamUtil);
GMLFileFilter gmlFilter = new GMLFileFilter(new String[] { "gml" }, new String[] { "text/gml" }, "GML", DataCategory.NETWORK, streamUtil);
CysessionFileFilter cysessionFilter = new CysessionFileFilter(new String[] { "xml" }, new String[] {}, "Cysession XML", DataCategory.PROPERTIES, streamUtil);
BookmarkFileFilter bookmarksFilter = new BookmarkFileFilter(new String[] { "xml" }, new String[] {}, "Bookmark XML", DataCategory.PROPERTIES, streamUtil);
PropertiesFileFilter propertiesFilter = new PropertiesFileFilter(new String[] { "props", "properties" }, new String[] {}, "Java Properties", DataCategory.PROPERTIES, streamUtil);
VizmapXMLFileFilter vizmapXMLFilter = new VizmapXMLFileFilter(new String[] { "xml" }, new String[] {}, "Style XML", DataCategory.VIZMAP, streamUtil);
VizmapPropertiesFileFilter vizmapPropertiesFilter = new VizmapPropertiesFileFilter(new String[] { "props", "properties" }, new String[] {}, "Vizmap Java Properties", DataCategory.VIZMAP, streamUtil);
CyNetworkReaderManagerImpl networkReaderManager = new CyNetworkReaderManagerImpl(streamUtil);
CyTableReaderManagerImpl tableReaderManager = new CyTableReaderManagerImpl(streamUtil);
CySessionReaderManagerImpl sessionReaderManager = new CySessionReaderManagerImpl(streamUtil);
VizmapReaderManagerImpl vizmapReaderManager = new VizmapReaderManagerImpl(streamUtil);
CyPropertyReaderManagerImpl propertyReaderManager = new CyPropertyReaderManagerImpl(streamUtil);
PresentationWriterManagerImpl viewWriterManager = new PresentationWriterManagerImpl();
CyNetworkViewWriterManagerImpl networkViewWriterManager = new CyNetworkViewWriterManagerImpl();
SessionWriterManagerImpl sessionWriterManager = new SessionWriterManagerImpl();
PropertyWriterManagerImpl propertyWriterManager = new PropertyWriterManagerImpl();
CyTableWriterManagerImpl tableWriterManager = new CyTableWriterManagerImpl();
VizmapWriterManagerImpl vizmapWriterManager = new VizmapWriterManagerImpl();
CalculatorConverterFactory calculatorConverterFactory = new CalculatorConverterFactory();
ExpressionReaderFactory expressionReaderFactory = new ExpressionReaderFactory(expressionFilter, serviceRegistrar);
CyAttributesReaderFactory attrsDataReaderFactory = new CyAttributesReaderFactory(attrsFilter, serviceRegistrar);
SIFNetworkReaderFactory sifNetworkViewReaderFactory = new SIFNetworkReaderFactory(sifFilter, serviceRegistrar);
NNFNetworkReaderFactory nnfNetworkViewReaderFactory = new NNFNetworkReaderFactory(nnfFilter, serviceRegistrar);
UnrecognizedVisualPropertyManager unrecognizedVisualPropertyManager = new UnrecognizedVisualPropertyManager(serviceRegistrar);
GMLNetworkReaderFactory gmlNetworkViewReaderFactory = new GMLNetworkReaderFactory(gmlFilter, unrecognizedVisualPropertyManager, serviceRegistrar);
ReadCache readCache = new ReadCache(serviceRegistrar);
GroupUtil groupUtil = new GroupUtil(serviceRegistrar);
SUIDUpdater suidUpdater = new SUIDUpdater();
ReadDataManager readDataManager = new ReadDataManager(readCache, suidUpdater, groupUtil, serviceRegistrar);
HandlerFactory handlerFactory = new HandlerFactory(readDataManager);
XGMMLParser xgmmlParser = new XGMMLParser(handlerFactory, readDataManager);
GenericXGMMLReaderFactory xgmmlReaderFactory = new GenericXGMMLReaderFactory(xgmmlFilter, readDataManager, xgmmlParser, unrecognizedVisualPropertyManager, serviceRegistrar);
SessionXGMMLNetworkReaderFactory sessXgmmlNetReaderFactory = new SessionXGMMLNetworkReaderFactory(sessXgmmlNetFileFilter, readDataManager, xgmmlParser, unrecognizedVisualPropertyManager, serviceRegistrar);
SessionXGMMLNetworkViewReaderFactory sessXgmmlViewReaderFactory = new SessionXGMMLNetworkViewReaderFactory(sessXgmmlViewFileFilter, readDataManager, xgmmlParser, unrecognizedVisualPropertyManager, serviceRegistrar);
CSVCyReaderFactory sessionTableReaderFactory = new CSVCyReaderFactory(sessionTableFilter, true, true, serviceRegistrar);
Cy3SessionReaderFactoryImpl cy3SessionReaderFactory = new Cy3SessionReaderFactoryImpl(cys3Filter, readCache, groupUtil, suidUpdater, networkReaderManager, propertyReaderManager, vizmapReaderManager, sessionTableReaderFactory, serviceRegistrar);
Cy2SessionReaderFactoryImpl cy2SessionReaderFactory = new Cy2SessionReaderFactoryImpl(cys2Filter, readCache, groupUtil, networkReaderManager, propertyReaderManager, vizmapReaderManager, serviceRegistrar);
CysessionReaderFactory cysessionReaderFactory = new CysessionReaderFactory(cysessionFilter);
BookmarkReaderFactory bookmarkReaderFactory = new BookmarkReaderFactory(bookmarksFilter);
PropertiesReaderFactory propertiesReaderFactory = new PropertiesReaderFactory(propertiesFilter);
VisualStyleSerializer visualStyleSerializer = new VisualStyleSerializer(calculatorConverterFactory, serviceRegistrar);
VizmapXMLReaderFactory vizmapXMLReaderFactory = new VizmapXMLReaderFactory(vizmapXMLFilter, visualStyleSerializer);
VizmapPropertiesReaderFactory vizmapPropertiesReaderFactory = new VizmapPropertiesReaderFactory(vizmapPropertiesFilter, visualStyleSerializer);
BitmapWriterFactory pngWriterFactory = new BitmapWriterFactory(pngFilter);
BitmapWriterFactory jpegWriterFactory = new BitmapWriterFactory(jpegFilter);
PDFWriterFactory pdfWriterFactory = new PDFWriterFactory(pdfFilter);
PSWriterFactory psWriterFactory = new PSWriterFactory(psFilter);
SVGWriterFactory svgWriterFactory = new SVGWriterFactory(svgFilter);
SifNetworkWriterFactory sifNetworkViewWriterFactory = new SifNetworkWriterFactory(sifFilter);
NnfNetworkWriterFactory nnfNetworkViewWriterFactory = new NnfNetworkWriterFactory(nnfFilter, serviceRegistrar);
GenericXGMMLWriterFactory xgmmlWriterFactory = new GenericXGMMLWriterFactory(xgmmlFilter, unrecognizedVisualPropertyManager, groupUtil, serviceRegistrar);
SessionXGMMLWriterFactory sessionXgmmlWriterFactory = new SessionXGMMLWriterFactory(sessXgmmlFileFilter, unrecognizedVisualPropertyManager, serviceRegistrar);
CysessionWriterFactoryImpl cysessionWriterFactory = new CysessionWriterFactoryImpl(cysessionFilter);
BookmarksWriterFactoryImpl bookmarksWriterFactory = new BookmarksWriterFactoryImpl(bookmarksFilter);
PropertiesWriterFactoryImpl propertiesWriterFactory = new PropertiesWriterFactoryImpl(propertiesFilter);
CSVTableWriterFactory csvTableWriterFactory = new CSVTableWriterFactory(csvFilter, false, false, true);
CSVTableWriterFactory sessionTableWriterFactory = new CSVTableWriterFactory(sessionTableFilter, true, true, false);
VizmapWriterFactoryImpl vizmapWriterFactory = new VizmapWriterFactoryImpl(vizmapXMLFilter, visualStyleSerializer);
SessionWriterFactoryImpl sessionWriterFactory = new SessionWriterFactoryImpl(cys3Filter, bookmarksFilter, propertiesFilter, sessionTableFilter, vizmapXMLFilter, sessionXgmmlWriterFactory, propertyWriterManager, tableWriterManager, vizmapWriterManager, groupUtil, serviceRegistrar);
RecentlyOpenedTrackerImpl recentlyOpenedTracker = new RecentlyOpenedTrackerImpl(serviceRegistrar);
CyTransformerReaderImpl transformerReader = new CyTransformerReaderImpl();
CyTransformerWriterImpl transformerWriter = new CyTransformerWriterImpl();
registerService(bc, transformerReader, CyTransformerReader.class);
registerService(bc, transformerWriter, CyTransformerWriter.class);
registerServiceListener(bc, transformerReader::registerTransformerManager, transformerReader::unregisterTransformerManager, TransformerManager.class);
registerService(bc, networkReaderManager, CyNetworkReaderManager.class);
registerService(bc, tableReaderManager, CyTableReaderManager.class);
registerService(bc, vizmapReaderManager, VizmapReaderManager.class);
registerService(bc, viewWriterManager, PresentationWriterManager.class);
registerService(bc, sessionReaderManager, CySessionReaderManager.class);
registerService(bc, propertyReaderManager, CyPropertyReaderManager.class);
registerService(bc, networkViewWriterManager, CyNetworkViewWriterManager.class);
registerService(bc, sessionWriterManager, CySessionWriterManager.class);
registerService(bc, propertyWriterManager, CyPropertyWriterManager.class);
registerService(bc, tableWriterManager, CyTableWriterManager.class);
registerService(bc, vizmapWriterManager, VizmapWriterManager.class);
registerService(bc, sifNetworkViewReaderFactory, InputStreamTaskFactory.class);
registerService(bc, nnfNetworkViewReaderFactory, InputStreamTaskFactory.class);
registerService(bc, xgmmlReaderFactory, InputStreamTaskFactory.class);
registerService(bc, sessXgmmlNetReaderFactory, InputStreamTaskFactory.class);
registerService(bc, sessXgmmlViewReaderFactory, InputStreamTaskFactory.class);
registerService(bc, attrsDataReaderFactory, InputStreamTaskFactory.class);
registerService(bc, gmlNetworkViewReaderFactory, InputStreamTaskFactory.class);
registerService(bc, cy3SessionReaderFactory, InputStreamTaskFactory.class);
registerService(bc, cy2SessionReaderFactory, InputStreamTaskFactory.class);
registerService(bc, cysessionReaderFactory, InputStreamTaskFactory.class);
registerService(bc, bookmarkReaderFactory, InputStreamTaskFactory.class);
registerService(bc, propertiesReaderFactory, InputStreamTaskFactory.class);
registerService(bc, vizmapPropertiesReaderFactory, InputStreamTaskFactory.class);
registerService(bc, vizmapXMLReaderFactory, InputStreamTaskFactory.class);
registerService(bc, sessionTableReaderFactory, InputStreamTaskFactory.class);
registerService(bc, expressionReaderFactory, InputStreamTaskFactory.class);
registerService(bc, streamUtil, StreamUtil.class);
registerService(bc, unrecognizedVisualPropertyManager, NetworkViewAboutToBeDestroyedListener.class);
registerService(bc, recentlyOpenedTracker, RecentlyOpenedTracker.class);
registerServiceListener(bc, networkReaderManager::addInputStreamTaskFactory, networkReaderManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, tableReaderManager::addInputStreamTaskFactory, tableReaderManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, sessionReaderManager::addInputStreamTaskFactory, sessionReaderManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, propertyReaderManager::addInputStreamTaskFactory, propertyReaderManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, vizmapReaderManager::addInputStreamTaskFactory, vizmapReaderManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, viewWriterManager::addCyWriterFactory, viewWriterManager::removeCyWriterFactory, PresentationWriterFactory.class);
registerServiceListener(bc, networkViewWriterManager::addCyWriterFactory, networkViewWriterManager::removeCyWriterFactory, CyNetworkViewWriterFactory.class);
registerServiceListener(bc, sessionWriterManager::addCyWriterFactory, sessionWriterManager::removeCyWriterFactory, CySessionWriterFactory.class);
registerServiceListener(bc, propertyWriterManager::addCyWriterFactory, propertyWriterManager::removeCyWriterFactory, CyPropertyWriterFactory.class);
registerServiceListener(bc, tableWriterManager::addCyWriterFactory, tableWriterManager::removeCyWriterFactory, CyTableWriterFactory.class);
registerServiceListener(bc, vizmapWriterManager::addCyWriterFactory, vizmapWriterManager::removeCyWriterFactory, VizmapWriterFactory.class);
registerAllServices(bc, pngWriterFactory);
registerAllServices(bc, jpegWriterFactory);
registerAllServices(bc, pdfWriterFactory);
registerAllServices(bc, psWriterFactory);
registerAllServices(bc, svgWriterFactory);
registerAllServices(bc, sifNetworkViewWriterFactory);
registerAllServices(bc, nnfNetworkViewWriterFactory);
registerAllServices(bc, xgmmlWriterFactory);
registerAllServices(bc, cysessionWriterFactory);
registerAllServices(bc, bookmarksWriterFactory);
registerAllServices(bc, propertiesWriterFactory);
registerAllServices(bc, csvTableWriterFactory);
registerAllServices(bc, sessionTableWriterFactory);
registerAllServices(bc, vizmapWriterFactory);
registerAllServices(bc, sessionWriterFactory);
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
// See if we have a graphics console or not
ServiceReference ref = bc.getServiceReference("org.cytoscape.application.swing.CySwingApplication");
CyJobManagerImpl jobManager = new CyJobManagerImpl();
registerService(bc, jobManager, CyJobManager.class, new Properties());
final CyJobMonitor jobMonitor;
if (ref == null) {
// No GUI...
jobMonitor = new SimpleCyJobMonitor();
} else {
// So, if we have a GUI, create and register our status bar
JobStatusBar statusBar = new JobStatusBar(serviceRegistrar);
Properties statusBarProperties = new Properties();
statusBarProperties.setProperty("type", "JobStatus");
registerService(bc, statusBar, StatusBarPanelFactory.class, statusBarProperties);
// So, if we have a GUI, start up our jobs monitor
jobMonitor = new GUICyJobMonitor(serviceRegistrar, jobManager, statusBar);
Properties guiJobProperties = new Properties();
guiJobProperties.setProperty(TITLE, "Job Status Monitor");
guiJobProperties.setProperty(PREFERRED_MENU, "Tools");
registerService(bc, jobMonitor, TaskFactory.class, guiJobProperties);
}
// Our job manager also needs to handle the registration of jobs handlers and job session handlers
registerServiceListener(bc, jobManager::addJobMonitor, jobManager::removeJobMonitor, CyJobMonitor.class);
registerServiceListener(bc, jobManager::addExecutionService, jobManager::removeExecutionService, CyJobExecutionService.class);
// Our job manager also needs to know about session load and save
registerService(bc, jobManager, SessionAboutToBeSavedListener.class, new Properties());
registerService(bc, jobManager, SessionLoadedListener.class, new Properties());
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
CyApplicationConfiguration cyApplicationConfigurationRef = getService(bc, CyApplicationConfiguration.class);
CyApplicationManager cyApplicationManagerRef = getService(bc, CyApplicationManager.class);
CyEventHelper cyEventHelperRef = getService(bc, CyEventHelper.class);
CyGroupAggregationManager cyGroupAggregationManagerRef = getService(bc, CyGroupAggregationManager.class);
CyGroupFactory cyGroupFactoryRef = getService(bc, CyGroupFactory.class);
CyGroupManager cyGroupManagerRef = getService(bc, CyGroupManager.class);
CyLayoutAlgorithmManager cyLayoutAlgorithmManagerRef = getService(bc, CyLayoutAlgorithmManager.class);
CyNetworkFactory cyNetworkFactoryRef = getService(bc, CyNetworkFactory.class);
CyNetworkManager cyNetworkManagerRef = getService(bc, CyNetworkManager.class);
CyNetworkViewFactory cyNetworkViewFactoryRef = getService(bc, CyNetworkViewFactory.class);
CyNetworkViewManager cyNetworkViewManagerRef = getService(bc, CyNetworkViewManager.class);
CyNetworkReaderManager cyNetworkViewReaderManagerRef = getService(bc, CyNetworkReaderManager.class);
CyNetworkViewWriterManager cyNetworkViewWriterManagerRef = getService(bc, CyNetworkViewWriterManager.class);
CyProperty<Properties> cyPropertyRef = getService(bc, CyProperty.class, "(cyPropertyName=cytoscape3.props)");
CyPropertyReaderManager cyPropertyReaderManagerRef = getService(bc, CyPropertyReaderManager.class);
CyPropertyWriterManager cyPropertyWriterManagerRef = getService(bc, CyPropertyWriterManager.class);
CyRootNetworkManager cyRootNetworkFactoryRef = getService(bc, CyRootNetworkManager.class);
CySessionManager cySessionManagerRef = getService(bc, CySessionManager.class);
CySessionReaderManager cySessionReaderManagerRef = getService(bc, CySessionReaderManager.class);
CySessionWriterManager cySessionWriterManagerRef = getService(bc, CySessionWriterManager.class);
CySwingApplication cySwingApplicationRef = getService(bc, CySwingApplication.class);
CyTableFactory cyTableFactoryRef = getService(bc, CyTableFactory.class);
CyTableManager cyTableManagerRef = getService(bc, CyTableManager.class);
CyTableReaderManager cyTableReaderManagerRef = getService(bc, CyTableReaderManager.class);
CyTableWriterManager cyTableWriterManagerRef = getService(bc, CyTableWriterManager.class);
PanelTaskManager panelTaskManagerRef = getService(bc, PanelTaskManager.class);
DialogTaskManager dialogTaskManagerRef = getService(bc, DialogTaskManager.class);
PresentationWriterManager presentationWriterManagerRef = getService(bc, PresentationWriterManager.class);
RenderingEngineManager renderingEngineManagerRef = getService(bc, RenderingEngineManager.class);
TaskManager taskManagerRef = getService(bc, TaskManager.class);
UndoSupport undoSupportRef = getService(bc, UndoSupport.class);
TunablePropertySerializerFactory tunablePropertySerializerFactoryRef = getService(bc, TunablePropertySerializerFactory.class);
VisualMappingManager visualMappingManagerRef = getService(bc, VisualMappingManager.class);
VisualStyleFactory visualStyleFactoryRef = getService(bc, VisualStyleFactory.class);
CyVersion cytoscapeVersionService = getService(bc, CyVersion.class);
CyApplicationConfiguration cyApplicationConfigurationServiceRef = getService(bc, CyApplicationConfiguration.class);
VisualMappingFunctionFactory vmfFactoryC = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=continuous)");
VisualMappingFunctionFactory vmfFactoryD = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=discrete)");
VisualMappingFunctionFactory vmfFactoryP = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=passthrough)");
DataSourceManager dataSourceManager = getService(bc, DataSourceManager.class);
// Start of core-task services
LoadVizmapFileTaskFactory loadVizmapFileTaskFactory = getService(bc, LoadVizmapFileTaskFactory.class);
LoadNetworkFileTaskFactory loadNetworkFileTaskFactory = getService(bc, LoadNetworkFileTaskFactory.class);
LoadNetworkURLTaskFactory loadNetworkURLTaskFactory = getService(bc, LoadNetworkURLTaskFactory.class);
DeleteSelectedNodesAndEdgesTaskFactory deleteSelectedNodesAndEdgesTaskFactory = getService(bc, DeleteSelectedNodesAndEdgesTaskFactory.class);
SelectAllTaskFactory selectAllTaskFactory = getService(bc, SelectAllTaskFactory.class);
SelectAllEdgesTaskFactory selectAllEdgesTaskFactory = getService(bc, SelectAllEdgesTaskFactory.class);
SelectAllNodesTaskFactory selectAllNodesTaskFactory = getService(bc, SelectAllNodesTaskFactory.class);
SelectAdjacentEdgesTaskFactory selectAdjacentEdgesTaskFactory = getService(bc, SelectAdjacentEdgesTaskFactory.class);
SelectConnectedNodesTaskFactory selectConnectedNodesTaskFactory = getService(bc, SelectConnectedNodesTaskFactory.class);
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactory = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Undirected)");
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactoryInEdge = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Directed: Incoming)");
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactoryOutEdge = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Directed: Outgoing)");
DeselectAllTaskFactory deselectAllTaskFactory = getService(bc, DeselectAllTaskFactory.class);
DeselectAllEdgesTaskFactory deselectAllEdgesTaskFactory = getService(bc, DeselectAllEdgesTaskFactory.class);
DeselectAllNodesTaskFactory deselectAllNodesTaskFactory = getService(bc, DeselectAllNodesTaskFactory.class);
InvertSelectedEdgesTaskFactory invertSelectedEdgesTaskFactory = getService(bc, InvertSelectedEdgesTaskFactory.class);
InvertSelectedNodesTaskFactory invertSelectedNodesTaskFactory = getService(bc, InvertSelectedNodesTaskFactory.class);
SelectFromFileListTaskFactory selectFromFileListTaskFactory = getService(bc, SelectFromFileListTaskFactory.class);
SelectFirstNeighborsNodeViewTaskFactory selectFirstNeighborsNodeViewTaskFactory = getService(bc, SelectFirstNeighborsNodeViewTaskFactory.class);
HideSelectedTaskFactory hideSelectedTaskFactory = getService(bc, HideSelectedTaskFactory.class);
HideSelectedNodesTaskFactory hideSelectedNodesTaskFactory = getService(bc, HideSelectedNodesTaskFactory.class);
HideSelectedEdgesTaskFactory hideSelectedEdgesTaskFactory = getService(bc, HideSelectedEdgesTaskFactory.class);
UnHideAllTaskFactory unHideAllTaskFactory = getService(bc, UnHideAllTaskFactory.class);
UnHideAllNodesTaskFactory unHideAllNodesTaskFactory = getService(bc, UnHideAllNodesTaskFactory.class);
UnHideAllEdgesTaskFactory unHideAllEdgesTaskFactory = getService(bc, UnHideAllEdgesTaskFactory.class);
NewEmptyNetworkViewFactory newEmptyNetworkTaskFactory = getService(bc, NewEmptyNetworkViewFactory.class);
CloneNetworkTaskFactory cloneNetworkTaskFactory = getService(bc, CloneNetworkTaskFactory.class);
NewNetworkSelectedNodesAndEdgesTaskFactory newNetworkSelectedNodesEdgesTaskFactory = getService(bc, NewNetworkSelectedNodesAndEdgesTaskFactory.class);
NewNetworkSelectedNodesOnlyTaskFactory newNetworkSelectedNodesOnlyTaskFactory = getService(bc, NewNetworkSelectedNodesOnlyTaskFactory.class);
DestroyNetworkTaskFactory destroyNetworkTaskFactory = getService(bc, DestroyNetworkTaskFactory.class);
DestroyNetworkViewTaskFactory destroyNetworkViewTaskFactory = getService(bc, DestroyNetworkViewTaskFactory.class);
NewSessionTaskFactory newSessionTaskFactory = getService(bc, NewSessionTaskFactory.class);
OpenSessionTaskFactory openSessionTaskFactory = getService(bc, OpenSessionTaskFactory.class);
SaveSessionAsTaskFactory saveSessionAsTaskFactory = getService(bc, SaveSessionAsTaskFactory.class);
EditNetworkTitleTaskFactory editNetworkTitleTaskFactory = getService(bc, EditNetworkTitleTaskFactory.class);
CreateNetworkViewTaskFactory createNetworkViewTaskFactory = getService(bc, CreateNetworkViewTaskFactory.class);
ExportNetworkImageTaskFactory exportNetworkImageTaskFactory = getService(bc, ExportNetworkImageTaskFactory.class);
ExportNetworkViewTaskFactory exportNetworkViewTaskFactory = getService(bc, ExportNetworkViewTaskFactory.class);
ExportSelectedTableTaskFactory exportSelectedTableTaskFactory = getService(bc, ExportSelectedTableTaskFactory.class);
ExportTableTaskFactory exportTableTaskFactory = getService(bc, ExportTableTaskFactory.class);
ApplyPreferredLayoutTaskFactory applyPreferredLayoutTaskFactory = getService(bc, ApplyPreferredLayoutTaskFactory.class);
DeleteColumnTaskFactory deleteColumnTaskFactory = getService(bc, DeleteColumnTaskFactory.class);
RenameColumnTaskFactory renameColumnTaskFactory = getService(bc, RenameColumnTaskFactory.class);
DeleteTableTaskFactory deleteTableTaskFactory = getService(bc, DeleteTableTaskFactory.class);
ExportVizmapTaskFactory exportVizmapTaskFactory = getService(bc, ExportVizmapTaskFactory.class);
ConnectSelectedNodesTaskFactory connectSelectedNodesTaskFactory = getService(bc, ConnectSelectedNodesTaskFactory.class);
MapGlobalToLocalTableTaskFactory mapGlobal = getService(bc, MapGlobalToLocalTableTaskFactory.class);
ApplyVisualStyleTaskFactory applyVisualStyleTaskFactory = getService(bc, ApplyVisualStyleTaskFactory.class);
MapTableToNetworkTablesTaskFactory mapNetworkAttrTaskFactory = getService(bc, MapTableToNetworkTablesTaskFactory.class);
GroupNodesTaskFactory groupNodesTaskFactory = getService(bc, GroupNodesTaskFactory.class);
UnGroupTaskFactory unGroupTaskFactory = getService(bc, UnGroupTaskFactory.class);
CollapseGroupTaskFactory collapseGroupTaskFactory = getService(bc, CollapseGroupTaskFactory.class);
ExpandGroupTaskFactory expandGroupTaskFactory = getService(bc, ExpandGroupTaskFactory.class);
UnGroupNodesTaskFactory unGroupNodesTaskFactory = getService(bc, UnGroupNodesTaskFactory.class);
// End of core-task services
// Command execution services
CommandExecutorTaskFactory cyCommandExecutorTaskFactory = getService(bc, CommandExecutorTaskFactory.class);
AvailableCommands availableCommands = getService(bc, AvailableCommands.class);
StreamUtil streamUtilServiceRef = getService(bc, StreamUtil.class);
FileUtil fileUtilServiceRef = getService(bc, FileUtil.class);
CySwingAppAdapter cyAppAdapter = new CyAppAdapterImpl(cyApplicationConfigurationRef, cyApplicationManagerRef, cyEventHelperRef, cyGroupAggregationManagerRef, cyGroupFactoryRef, cyGroupManagerRef, cyLayoutAlgorithmManagerRef, cyNetworkFactoryRef, cyNetworkManagerRef, cyNetworkViewFactoryRef, cyNetworkViewManagerRef, cyNetworkViewReaderManagerRef, cyNetworkViewWriterManagerRef, cyPropertyRef, cyPropertyReaderManagerRef, cyPropertyWriterManagerRef, cyRootNetworkFactoryRef, serviceRegistrar, cySessionManagerRef, cySessionReaderManagerRef, cySessionWriterManagerRef, cySwingApplicationRef, cyTableFactoryRef, cyTableManagerRef, cyTableReaderManagerRef, cyTableWriterManagerRef, cytoscapeVersionService, dialogTaskManagerRef, panelTaskManagerRef, presentationWriterManagerRef, renderingEngineManagerRef, taskManagerRef, undoSupportRef, tunablePropertySerializerFactoryRef, vmfFactoryC, vmfFactoryD, vmfFactoryP, visualMappingManagerRef, visualStyleFactoryRef, dataSourceManager, // from core-task-api
loadVizmapFileTaskFactory, loadNetworkFileTaskFactory, loadNetworkURLTaskFactory, deleteSelectedNodesAndEdgesTaskFactory, selectAllTaskFactory, selectAllEdgesTaskFactory, selectAllNodesTaskFactory, selectAdjacentEdgesTaskFactory, selectConnectedNodesTaskFactory, selectFirstNeighborsTaskFactory, selectFirstNeighborsTaskFactoryInEdge, selectFirstNeighborsTaskFactoryOutEdge, deselectAllTaskFactory, deselectAllEdgesTaskFactory, deselectAllNodesTaskFactory, invertSelectedEdgesTaskFactory, invertSelectedNodesTaskFactory, selectFromFileListTaskFactory, selectFirstNeighborsNodeViewTaskFactory, hideSelectedTaskFactory, hideSelectedNodesTaskFactory, hideSelectedEdgesTaskFactory, unHideAllTaskFactory, unHideAllNodesTaskFactory, unHideAllEdgesTaskFactory, newEmptyNetworkTaskFactory, cloneNetworkTaskFactory, newNetworkSelectedNodesEdgesTaskFactory, newNetworkSelectedNodesOnlyTaskFactory, destroyNetworkTaskFactory, destroyNetworkViewTaskFactory, newSessionTaskFactory, openSessionTaskFactory, saveSessionAsTaskFactory, editNetworkTitleTaskFactory, createNetworkViewTaskFactory, exportNetworkImageTaskFactory, exportNetworkViewTaskFactory, exportSelectedTableTaskFactory, exportTableTaskFactory, applyPreferredLayoutTaskFactory, deleteColumnTaskFactory, renameColumnTaskFactory, deleteTableTaskFactory, exportVizmapTaskFactory, connectSelectedNodesTaskFactory, mapGlobal, applyVisualStyleTaskFactory, mapNetworkAttrTaskFactory, groupNodesTaskFactory, unGroupTaskFactory, collapseGroupTaskFactory, expandGroupTaskFactory, unGroupNodesTaskFactory, cyCommandExecutorTaskFactory, availableCommands);
registerService(bc, cyAppAdapter, CyAppAdapter.class);
registerService(bc, cyAppAdapter, CySwingAppAdapter.class);
WebQuerier webQuerier = new WebQuerier(streamUtilServiceRef, cytoscapeVersionService);
registerService(bc, webQuerier, WebQuerier.class);
StartLevel startLevel = getService(bc, StartLevel.class);
// Instantiate new manager
final AppManager appManager = new AppManager(cyAppAdapter, cyApplicationConfigurationServiceRef, cytoscapeVersionService, cyEventHelperRef, webQuerier, startLevel, bc);
registerService(bc, appManager, AppManager.class);
bc.addFrameworkListener(appManager);
final DownloadSitesManager downloadSitesManager = new DownloadSitesManager(cyPropertyRef);
final UpdateManager updateManager = new UpdateManager(appManager, downloadSitesManager);
registerService(bc, updateManager, AppsFinishedStartingListener.class);
final AppConflictHandlerFactory appConflictHandlerFactory = new AppConflictHandlerFactory();
registerService(bc, appConflictHandlerFactory, GUITunableHandlerFactory.class);
// AbstractCyAction implementation for updated app manager
AppManagerAction appManagerAction = new AppManagerAction(appManager, downloadSitesManager, updateManager, cySwingApplicationRef, fileUtilServiceRef, dialogTaskManagerRef, serviceRegistrar);
registerService(bc, appManagerAction, CyAction.class);
// Show citations dialog
final CitationsAction citationsAction = new CitationsAction(webQuerier, appManager, serviceRegistrar);
registerService(bc, citationsAction, CyAction.class);
// Start local server that reports app installation status to the app store when requested,
// also able to install an app when told by the app store
final AppGetResponder appGetResponder = new AppGetResponder(appManager, cytoscapeVersionService);
final CyHttpd httpd = (new CyHttpdFactoryImpl()).createHttpd(new LocalhostServerSocketFactory(2607));
httpd.addBeforeResponse(new ScreenOriginsBeforeResponse(WebQuerier.DEFAULT_APP_STORE_URL));
httpd.addBeforeResponse(new OriginOptionsBeforeResponse("x-csrftoken"));
httpd.addAfterResponse(new AddAllowOriginHeader());
httpd.addResponder(appGetResponder.new StatusResponder());
httpd.addResponder(appGetResponder.new InstallResponder());
httpd.start();
// Special case: handle yFiles app options
final OpenBrowser openBrowser = getService(bc, OpenBrowser.class);
YFilesChecker checker = new YFilesChecker(appManager, serviceRegistrar, openBrowser);
bc.addBundleListener(checker);
registerAllServices(bc, checker, new Properties());
{
AppStoreTaskFactory factory = new AppStoreTaskFactory(appManager, serviceRegistrar);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "open appstore");
props.setProperty(COMMAND_DESCRIPTION, "Open the app store page for an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Open the app store page for an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
{
DisableTaskFactory factory = new DisableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "disable");
props.setProperty(COMMAND_DESCRIPTION, "Disable an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Disable a currently installed app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
EnableTaskFactory factory = new EnableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "enable");
props.setProperty(COMMAND_DESCRIPTION, "Enable a disabled app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Enable a currently disabled app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
InformationTaskFactory factory = new InformationTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "information");
props.setProperty(COMMAND_DESCRIPTION, "Get app information");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Get information about an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"" + ", \"description\": \"App description\"" + ", \"version\": \"1.2.2\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
InstallTaskFactory factory = new InstallTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "install");
props.setProperty(COMMAND_DESCRIPTION, "Install an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Install an app given an app name or file.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAvailableTaskFactory factory = new ListAvailableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list available");
props.setProperty(COMMAND_DESCRIPTION, "List the available apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the available apps in the app store");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{\"appName\":\"name\", " + "\"description\":\"descriptions\", " + "\"details\":\"app details\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.DISABLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list disabled");
props.setProperty(COMMAND_DESCRIPTION, "List the disabled apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the disabled apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Disabled\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.INSTALLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list installed");
props.setProperty(COMMAND_DESCRIPTION, "List the installed apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the installed apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{\"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Installed\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.UNINSTALLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list uninstalled");
props.setProperty(COMMAND_DESCRIPTION, "List the uninstalled apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the uninstalled apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Uninstalled\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListUpdatesTaskFactory factory = new ListUpdatesTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list updates");
props.setProperty(COMMAND_DESCRIPTION, "List the apps available for updates");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the apps that have updates in the app store.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.10\"," + "\"information\": \"app information\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
StatusTaskFactory factory = new StatusTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "status");
props.setProperty(COMMAND_DESCRIPTION, "Get the status of an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Get the status of an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\", \"status\": \"Installed\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
UninstallTaskFactory factory = new UninstallTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "uninstall");
props.setProperty(COMMAND_DESCRIPTION, "Uninstall an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Uninstall a currently installed app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
UpdateTaskFactory factory = new UpdateTaskFactory(appManager, updateManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "update");
props.setProperty(COMMAND_DESCRIPTION, "Update an app or all apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Update an app or all apps.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
}
use of org.cytoscape.service.util.CyServiceRegistrar in project PhenomeScape by soulj.
the class PhenomeNetwork method initilise.
public CyNetwork initilise(ControlPanel controlPanel) {
CyServiceRegistrar cyServiceRegistar = controlPanel.cyServiceRegistrar;
CyNetworkFactory networkFactory = cyServiceRegistar.getService(CyNetworkFactory.class);
CyNetwork network = networkFactory.createNetwork();
network.getRow(network).set(CyNetwork.NAME, "PhenomeNetwork");
network.getDefaultEdgeTable().createColumn("SemanticSimilarity", Double.class, false);
try {
readIn(network);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
createSparseAdjMatrix(network);
return (network);
}
use of org.cytoscape.service.util.CyServiceRegistrar in project PhenomeScape by soulj.
the class ColumnChangedListener method updateComboOptions.
public void updateComboOptions() {
CyServiceRegistrar cyServiceRegistrar = controlPanel.cyServiceRegistrar;
if (controlPanel.getNetworkValue() != null) {
CommandExecutor.execute("network set current network=" + '"' + controlPanel.getNetworkValue() + '"', cyServiceRegistrar);
CyNetwork selectedNetwork = cyServiceRegistrar.getService(CyApplicationManager.class).getCurrentNetwork();
CyTable selectedTable = selectedNetwork.getDefaultNodeTable();
Collection<CyColumn> columns = selectedTable.getColumns();
DefaultComboBoxModel geneNameComboModel = new DefaultComboBoxModel();
DefaultComboBoxModel foldChangeComboModel = new DefaultComboBoxModel();
DefaultComboBoxModel pvalueComboModel = new DefaultComboBoxModel();
for (CyColumn column : columns) {
geneNameComboModel.addElement(column.getName());
foldChangeComboModel.addElement(column.getName());
pvalueComboModel.addElement(column.getName());
}
String geneName = controlPanel.getGeneNameValue();
String foldChange = controlPanel.getFoldChangeValue();
String pvalue = controlPanel.getpvalueValue();
if (geneNameComboModel.getIndexOf(geneName) >= 0) {
geneNameComboModel.setSelectedItem(geneName);
}
if (foldChangeComboModel.getIndexOf(foldChange) >= 0) {
foldChangeComboModel.setSelectedItem(foldChange);
}
if (pvalueComboModel.getIndexOf(pvalue) >= 0) {
pvalueComboModel.setSelectedItem(pvalue);
}
controlPanel.setGeneName(geneNameComboModel);
controlPanel.setFoldChange(foldChangeComboModel);
controlPanel.setPvalue(pvalueComboModel);
}
}
Aggregations