Search in sources :

Example 1 with StreamUtilImpl

use of org.cytoscape.io.internal.util.StreamUtilImpl in project cytoscape-impl by cytoscape.

the class GenericXGMMLFileFilterTest method setUp.

@Before
public void setUp() {
    Set<String> extensions = new HashSet<String>();
    Set<String> contentTypes = new HashSet<String>();
    String description = "XGMML";
    Properties props = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", props, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    filter = new GenericXGMMLFileFilter(extensions, contentTypes, description, DataCategory.NETWORK, new StreamUtilImpl(serviceRegistrar));
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 2 with StreamUtilImpl

use of org.cytoscape.io.internal.util.StreamUtilImpl in project cytoscape-impl by cytoscape.

the class GMLFileFilterTest method setUp.

@Before
public void setUp() {
    Set<String> extensions = new HashSet<String>();
    Set<String> contentTypes = new HashSet<String>();
    String description = "GML";
    Properties properties = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    filter = new GMLFileFilter(extensions, contentTypes, description, DataCategory.NETWORK, new StreamUtilImpl(serviceRegistrar));
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 3 with StreamUtilImpl

use of org.cytoscape.io.internal.util.StreamUtilImpl in project cytoscape-impl by cytoscape.

the class SessionFileFilterTest method setUp.

@Before
public void setUp() {
    extensions = new HashSet<String>();
    contentTypes = new HashSet<String>();
    Properties properties = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<Properties>("test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
    CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    streamUtil = new StreamUtilImpl(serviceRegistrar);
}
Also used : Properties(java.util.Properties) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) Before(org.junit.Before)

Example 4 with StreamUtilImpl

use of org.cytoscape.io.internal.util.StreamUtilImpl 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);
}
Also used : VizmapXMLFileFilter(org.cytoscape.io.internal.read.vizmap.VizmapXMLFileFilter) GMLNetworkReaderFactory(org.cytoscape.io.internal.read.gml.GMLNetworkReaderFactory) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) PropertiesWriterFactoryImpl(org.cytoscape.io.internal.write.properties.PropertiesWriterFactoryImpl) GroupUtil(org.cytoscape.io.internal.util.GroupUtil) PropertyWriterManagerImpl(org.cytoscape.io.internal.write.PropertyWriterManagerImpl) SIFNetworkReaderFactory(org.cytoscape.io.internal.read.sif.SIFNetworkReaderFactory) HandlerFactory(org.cytoscape.io.internal.read.xgmml.HandlerFactory) SUIDUpdater(org.cytoscape.io.internal.util.SUIDUpdater) SVGWriterFactory(org.cytoscape.io.internal.write.graphics.SVGWriterFactory) SessionXGMMLNetworkViewReaderFactory(org.cytoscape.io.internal.read.xgmml.SessionXGMMLNetworkViewReaderFactory) SifNetworkWriterFactory(org.cytoscape.io.internal.write.sif.SifNetworkWriterFactory) BasicCyFileFilter(org.cytoscape.io.BasicCyFileFilter) PresentationWriterManagerImpl(org.cytoscape.io.internal.write.PresentationWriterManagerImpl) PropertiesReaderFactory(org.cytoscape.io.internal.read.properties.PropertiesReaderFactory) VizmapPropertiesReaderFactory(org.cytoscape.io.internal.read.vizmap.VizmapPropertiesReaderFactory) GenericXGMMLWriterFactory(org.cytoscape.io.internal.write.xgmml.GenericXGMMLWriterFactory) SessionWriterManagerImpl(org.cytoscape.io.internal.write.SessionWriterManagerImpl) CyTransformerWriterImpl(org.cytoscape.io.internal.write.transformer.CyTransformerWriterImpl) SessionXGMMLFileFilter(org.cytoscape.io.internal.read.xgmml.SessionXGMMLFileFilter) BitmapWriterFactory(org.cytoscape.io.internal.write.graphics.BitmapWriterFactory) CySessionReaderManagerImpl(org.cytoscape.io.internal.read.CySessionReaderManagerImpl) VizmapXMLReaderFactory(org.cytoscape.io.internal.read.vizmap.VizmapXMLReaderFactory) Cy2SessionReaderFactoryImpl(org.cytoscape.io.internal.read.session.Cy2SessionReaderFactoryImpl) ReadDataManager(org.cytoscape.io.internal.read.xgmml.handler.ReadDataManager) CalculatorConverterFactory(org.cytoscape.io.internal.util.vizmap.CalculatorConverterFactory) RecentlyOpenedTrackerImpl(org.cytoscape.io.internal.util.RecentlyOpenedTrackerImpl) VizmapPropertiesFileFilter(org.cytoscape.io.internal.read.vizmap.VizmapPropertiesFileFilter) CyTransformerReaderImpl(org.cytoscape.io.internal.read.transformer.CyTransformerReaderImpl) ExpressionReaderFactory(org.cytoscape.io.internal.read.expression.ExpressionReaderFactory) VizmapReaderManagerImpl(org.cytoscape.io.internal.read.VizmapReaderManagerImpl) CysessionReaderFactory(org.cytoscape.io.internal.read.cysession.CysessionReaderFactory) PDFWriterFactory(org.cytoscape.io.internal.write.graphics.PDFWriterFactory) CysessionWriterFactoryImpl(org.cytoscape.io.internal.write.cysession.CysessionWriterFactoryImpl) GMLFileFilter(org.cytoscape.io.internal.read.gml.GMLFileFilter) NnfNetworkWriterFactory(org.cytoscape.io.internal.write.nnf.NnfNetworkWriterFactory) CyNetworkViewWriterManagerImpl(org.cytoscape.io.internal.write.CyNetworkViewWriterManagerImpl) CyTableWriterManagerImpl(org.cytoscape.io.internal.write.CyTableWriterManagerImpl) SessionWriterFactoryImpl(org.cytoscape.io.internal.write.session.SessionWriterFactoryImpl) CyPropertyReaderManagerImpl(org.cytoscape.io.internal.read.CyPropertyReaderManagerImpl) UnrecognizedVisualPropertyManager(org.cytoscape.io.internal.util.UnrecognizedVisualPropertyManager) PSWriterFactory(org.cytoscape.io.internal.write.graphics.PSWriterFactory) VizmapWriterFactoryImpl(org.cytoscape.io.internal.write.vizmap.VizmapWriterFactoryImpl) CyAttributesReaderFactory(org.cytoscape.io.internal.read.datatable.CyAttributesReaderFactory) BookmarkReaderFactory(org.cytoscape.io.internal.read.bookmarks.BookmarkReaderFactory) SessionXGMMLNetworkReaderFactory(org.cytoscape.io.internal.read.xgmml.SessionXGMMLNetworkReaderFactory) GenericXGMMLReaderFactory(org.cytoscape.io.internal.read.xgmml.GenericXGMMLReaderFactory) NNFNetworkReaderFactory(org.cytoscape.io.internal.read.nnf.NNFNetworkReaderFactory) SessionXGMMLNetworkViewFileFilter(org.cytoscape.io.internal.read.xgmml.SessionXGMMLNetworkViewFileFilter) Cy3SessionReaderFactoryImpl(org.cytoscape.io.internal.read.session.Cy3SessionReaderFactoryImpl) GenericXGMMLFileFilter(org.cytoscape.io.internal.read.xgmml.GenericXGMMLFileFilter) SessionFileFilter(org.cytoscape.io.internal.read.session.SessionFileFilter) XGMMLParser(org.cytoscape.io.internal.read.xgmml.XGMMLParser) VisualStyleSerializer(org.cytoscape.io.internal.util.vizmap.VisualStyleSerializer) SessionXGMMLWriterFactory(org.cytoscape.io.internal.write.xgmml.SessionXGMMLWriterFactory) CyTableReaderManagerImpl(org.cytoscape.io.internal.read.CyTableReaderManagerImpl) BookmarkFileFilter(org.cytoscape.io.internal.read.bookmarks.BookmarkFileFilter) VizmapWriterManagerImpl(org.cytoscape.io.internal.write.VizmapWriterManagerImpl) ReadCache(org.cytoscape.io.internal.util.ReadCache) CSVTableWriterFactory(org.cytoscape.io.internal.write.datatable.csv.CSVTableWriterFactory) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) CyNetworkReaderManagerImpl(org.cytoscape.io.internal.read.CyNetworkReaderManagerImpl) SessionXGMMLNetworkFileFilter(org.cytoscape.io.internal.read.xgmml.SessionXGMMLNetworkFileFilter) BookmarksWriterFactoryImpl(org.cytoscape.io.internal.write.bookmarks.BookmarksWriterFactoryImpl) PropertiesFileFilter(org.cytoscape.io.internal.read.properties.PropertiesFileFilter) VizmapPropertiesFileFilter(org.cytoscape.io.internal.read.vizmap.VizmapPropertiesFileFilter) CSVCyReaderFactory(org.cytoscape.io.internal.read.datatable.CSVCyReaderFactory) VizmapPropertiesReaderFactory(org.cytoscape.io.internal.read.vizmap.VizmapPropertiesReaderFactory) CysessionFileFilter(org.cytoscape.io.internal.read.cysession.CysessionFileFilter)

Example 5 with StreamUtilImpl

use of org.cytoscape.io.internal.util.StreamUtilImpl in project cytoscape-impl by cytoscape.

the class AbstractNetworkReaderTest method setUp.

@Before
public void setUp() throws Exception {
    taskMonitor = mock(TaskMonitor.class);
    CyLayoutAlgorithm def = mock(CyLayoutAlgorithm.class);
    Object context = new Object();
    when(def.createLayoutContext()).thenReturn(context);
    when(def.getDefaultLayoutContext()).thenReturn(context);
    when(def.createTaskIterator(Mockito.any(CyNetworkView.class), Mockito.any(Object.class), Mockito.anySet(), Mockito.any(String.class))).thenReturn(new TaskIterator(new SimpleTask()));
    layouts = mock(CyLayoutAlgorithmManager.class);
    when(layouts.getDefaultLayout()).thenReturn(def);
    NetworkTestSupport nts = new NetworkTestSupport();
    netFactory = nts.getNetworkFactory();
    netManager = nts.getNetworkManager();
    rootNetManager = nts.getRootNetworkFactory();
    netTableManager = nts.getNetworkTableManager();
    TableTestSupport tblTestSupport = new TableTestSupport();
    tableFactory = tblTestSupport.getTableFactory();
    tableManager = mock(CyTableManager.class);
    GroupTestSupport groupTestSupport = new GroupTestSupport();
    groupManager = groupTestSupport.getGroupManager();
    groupFactory = groupTestSupport.getGroupFactory();
    properties = new Properties();
    CyProperty<Properties> cyProperties = new SimpleCyProperty<>("Test", properties, Properties.class, SavePolicy.DO_NOT_SAVE);
    NetworkViewTestSupport nvts = new NetworkViewTestSupport();
    setViewThreshold(DEF_THRESHOLD);
    viewFactory = nvts.getNetworkViewFactory();
    readUtil = new ReadUtils(new StreamUtilImpl(serviceRegistrar));
    defRenderer = mock(NetworkViewRenderer.class);
    when(defRenderer.getNetworkViewFactory()).thenReturn(viewFactory);
    lexicon = new BasicVisualLexicon(new NullVisualProperty("MINIMAL_ROOT", "Minimal Root Visual Property"));
    renderingEngineManager = mock(RenderingEngineManager.class);
    when(renderingEngineManager.getDefaultVisualLexicon()).thenReturn(lexicon);
    applicationManager = mock(CyApplicationManager.class);
    when(applicationManager.getDefaultNetworkViewRenderer()).thenReturn(defRenderer);
    serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=cytoscape3.props)")).thenReturn(cyProperties);
    when(serviceRegistrar.getService(CyApplicationManager.class)).thenReturn(applicationManager);
    when(serviceRegistrar.getService(CyNetworkFactory.class)).thenReturn(netFactory);
    when(serviceRegistrar.getService(CyNetworkViewFactory.class)).thenReturn(viewFactory);
    when(serviceRegistrar.getService(CyNetworkManager.class)).thenReturn(netManager);
    when(serviceRegistrar.getService(CyNetworkTableManager.class)).thenReturn(netTableManager);
    when(serviceRegistrar.getService(CyRootNetworkManager.class)).thenReturn(rootNetManager);
    when(serviceRegistrar.getService(CyLayoutAlgorithmManager.class)).thenReturn(layouts);
    when(serviceRegistrar.getService(CyTableManager.class)).thenReturn(tableManager);
    when(serviceRegistrar.getService(CyTableFactory.class)).thenReturn(tableFactory);
    when(serviceRegistrar.getService(CyGroupManager.class)).thenReturn(groupManager);
    when(serviceRegistrar.getService(CyGroupFactory.class)).thenReturn(groupFactory);
    when(serviceRegistrar.getService(RenderingEngineManager.class)).thenReturn(renderingEngineManager);
}
Also used : NullVisualProperty(org.cytoscape.view.presentation.property.NullVisualProperty) RenderingEngineManager(org.cytoscape.view.presentation.RenderingEngineManager) NetworkTestSupport(org.cytoscape.model.NetworkTestSupport) Properties(java.util.Properties) NetworkViewTestSupport(org.cytoscape.ding.NetworkViewTestSupport) SimpleCyProperty(org.cytoscape.property.SimpleCyProperty) StreamUtilImpl(org.cytoscape.io.internal.util.StreamUtilImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) CyApplicationManager(org.cytoscape.application.CyApplicationManager) TaskIterator(org.cytoscape.work.TaskIterator) CyLayoutAlgorithmManager(org.cytoscape.view.layout.CyLayoutAlgorithmManager) CyTableManager(org.cytoscape.model.CyTableManager) TaskMonitor(org.cytoscape.work.TaskMonitor) TableTestSupport(org.cytoscape.model.TableTestSupport) CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) BasicVisualLexicon(org.cytoscape.view.presentation.property.BasicVisualLexicon) GroupTestSupport(org.cytoscape.group.GroupTestSupport) ReadUtils(org.cytoscape.io.internal.util.ReadUtils) CyNetworkView(org.cytoscape.view.model.CyNetworkView) NetworkViewRenderer(org.cytoscape.application.NetworkViewRenderer) Before(org.junit.Before)

Aggregations

StreamUtilImpl (org.cytoscape.io.internal.util.StreamUtilImpl)5 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)5 Properties (java.util.Properties)4 SimpleCyProperty (org.cytoscape.property.SimpleCyProperty)3 Before (org.junit.Before)3 HashSet (java.util.HashSet)2 CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 NetworkViewRenderer (org.cytoscape.application.NetworkViewRenderer)1 NetworkViewTestSupport (org.cytoscape.ding.NetworkViewTestSupport)1 GroupTestSupport (org.cytoscape.group.GroupTestSupport)1 BasicCyFileFilter (org.cytoscape.io.BasicCyFileFilter)1 CyNetworkReaderManagerImpl (org.cytoscape.io.internal.read.CyNetworkReaderManagerImpl)1 CyPropertyReaderManagerImpl (org.cytoscape.io.internal.read.CyPropertyReaderManagerImpl)1 CySessionReaderManagerImpl (org.cytoscape.io.internal.read.CySessionReaderManagerImpl)1 CyTableReaderManagerImpl (org.cytoscape.io.internal.read.CyTableReaderManagerImpl)1 VizmapReaderManagerImpl (org.cytoscape.io.internal.read.VizmapReaderManagerImpl)1 BookmarkFileFilter (org.cytoscape.io.internal.read.bookmarks.BookmarkFileFilter)1 BookmarkReaderFactory (org.cytoscape.io.internal.read.bookmarks.BookmarkReaderFactory)1 CysessionFileFilter (org.cytoscape.io.internal.read.cysession.CysessionFileFilter)1 CysessionReaderFactory (org.cytoscape.io.internal.read.cysession.CysessionReaderFactory)1