Search in sources :

Example 1 with ContinuousMappingFactory

use of org.cytoscape.view.vizmap.internal.mappings.ContinuousMappingFactory in project cytoscape-impl by cytoscape.

the class CyActivator method start.

@Override
public void start(BundleContext bc) {
    final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
    // Mapping Factories:
    final DiscreteMappingFactory dmFactory = new DiscreteMappingFactory(serviceRegistrar);
    {
        final Properties props = new Properties();
        props.setProperty("service.type", "factory");
        props.setProperty("mapping.type", "discrete");
        registerService(bc, dmFactory, VisualMappingFunctionFactory.class, props);
    }
    final ContinuousMappingFactory cmFactory = new ContinuousMappingFactory(serviceRegistrar);
    {
        final Properties props = new Properties();
        props.setProperty("service.type", "factory");
        props.setProperty("mapping.type", "continuous");
        registerService(bc, cmFactory, VisualMappingFunctionFactory.class, props);
    }
    final PassthroughMappingFactory pmFactory = new PassthroughMappingFactory(serviceRegistrar);
    {
        final Properties props = new Properties();
        props.setProperty("service.type", "factory");
        props.setProperty("mapping.type", "passthrough");
        registerService(bc, pmFactory, VisualMappingFunctionFactory.class, props);
        registerServiceListener(bc, pmFactory::addValueTranslator, pmFactory::removeValueTranslator, ValueTranslator.class);
    }
    final VisualStyleFactoryImpl visualStyleFactory = new VisualStyleFactoryImpl(serviceRegistrar, pmFactory);
    registerService(bc, visualStyleFactory, VisualStyleFactory.class);
    final VisualMappingManagerImpl visualMappingManager = new VisualMappingManagerImpl(visualStyleFactory, serviceRegistrar);
    registerAllServices(bc, visualMappingManager);
}
Also used : ContinuousMappingFactory(org.cytoscape.view.vizmap.internal.mappings.ContinuousMappingFactory) VisualMappingFunctionFactory(org.cytoscape.view.vizmap.VisualMappingFunctionFactory) PassthroughMappingFactory(org.cytoscape.view.vizmap.internal.mappings.PassthroughMappingFactory) DiscreteMappingFactory(org.cytoscape.view.vizmap.internal.mappings.DiscreteMappingFactory) ValueTranslator(org.cytoscape.view.vizmap.mappings.ValueTranslator) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Aggregations

Properties (java.util.Properties)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 VisualMappingFunctionFactory (org.cytoscape.view.vizmap.VisualMappingFunctionFactory)1 ContinuousMappingFactory (org.cytoscape.view.vizmap.internal.mappings.ContinuousMappingFactory)1 DiscreteMappingFactory (org.cytoscape.view.vizmap.internal.mappings.DiscreteMappingFactory)1 PassthroughMappingFactory (org.cytoscape.view.vizmap.internal.mappings.PassthroughMappingFactory)1 ValueTranslator (org.cytoscape.view.vizmap.mappings.ValueTranslator)1