Interface CyNetworkViewFactoryProvider


public interface CyNetworkViewFactoryProvider

A singleton factory that is used to create CyNetworkViewFactory objects.

Apps that contribute renderers (via NetworkViewRenderer) may provide their own implementation of CyNetworkViewFactory, or they may acquire a reusable instance of CyNetworkViewFactory from this service. The CyNetworkViewFactory provided by this service may be configured using a provided VisualLexicon and optionally via a CyNetworkViewFactoryConfig object.

The CyNetworkViewFactoryFactory is available as an OSGi service.

Example of creating a CyNetworkViewFactory for a standard 2D renderer without additional configuration:

 CyNetworkViewFactoryProvider provider = getService(bc, CyNetworkViewFactoryProvider.class);
 CyNetworkViewFactory netViewFactory = provider.createNetworkViewFactory(myLexicon, MyRenderer.ID);
 

Example of creating a CyNetworkViewFactory with additional configuration for 3D rendering:

 CyNetworkViewFactoryProvider provider = getService(bc, CyNetworkViewFactoryProvider.class);
 CyNetworkViewFactoryConfig config = provider.createConfig(lexicon);
 config.addNonClearableVisualProperty(BasicVisualLexicon.NODE_Z_LOCATION);
 config.addTrackedVisualProperty(MyVisualLexicon.SELECTED_NODES, BasicVisualLexicon.NODE_SELECTED, Boolean.TRUE);
 CyNetworkViewFactory netViewFactory = provider.createNetworkViewFactory(lexicon, MyRenderer.ID, config);
 

Since:
3.8

Module: viewmodel-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>viewmodel-api</artifactId>
</dependency>

Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.