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;
}
Aggregations