public class ImageScalerFactory {
public static ImageScaler createImageScaler(WGACore core) throws WGNotSupportedException, ModuleInstantiationException {
Iterator<ModuleDefinition> scalerModules = core.getModuleRegistry().getModulesForType(ImageScalerModuleType.class).values().iterator();
if (!scalerModules.hasNext()) {
throw new WGNotSupportedException("No image scaler implementation available");
}
ModuleDefinition scalerDef = scalerModules.next();
ImageScaler scaler = (ImageScaler) core.getModuleRegistry().instantiate(scalerDef);
return scaler;