Search in sources :

Example 1 with ContinuousMappingImpl

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

the class VisualStyleFactoryImpl method createContinuous.

@SuppressWarnings({ "unchecked", "rawtypes" })
private <K, V> VisualMappingFunction<K, V> createContinuous(final ContinuousMapping<K, V> originalMapping) {
    final String attrName = originalMapping.getMappingColumnName();
    final Class<?> colType = originalMapping.getMappingColumnType();
    final CyEventHelper eventHelper = serviceRegistrar.getService(CyEventHelper.class);
    final ContinuousMapping<K, V> copyMapping = new ContinuousMappingImpl(attrName, colType, originalMapping.getVisualProperty(), eventHelper);
    List<ContinuousMappingPoint<K, V>> points = originalMapping.getAllPoints();
    for (ContinuousMappingPoint<K, V> point : points) copyMapping.addPoint(point.getValue(), new BoundaryRangeValues<V>(point.getRange()));
    return copyMapping;
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) BoundaryRangeValues(org.cytoscape.view.vizmap.mappings.BoundaryRangeValues) ContinuousMappingPoint(org.cytoscape.view.vizmap.mappings.ContinuousMappingPoint) ContinuousMappingImpl(org.cytoscape.view.vizmap.internal.mappings.ContinuousMappingImpl)

Aggregations

CyEventHelper (org.cytoscape.event.CyEventHelper)1 ContinuousMappingImpl (org.cytoscape.view.vizmap.internal.mappings.ContinuousMappingImpl)1 BoundaryRangeValues (org.cytoscape.view.vizmap.mappings.BoundaryRangeValues)1 ContinuousMappingPoint (org.cytoscape.view.vizmap.mappings.ContinuousMappingPoint)1