/** * Constructor for {@link BaseStatisticsOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. */ public BaseStatisticsOperationJAI(OperationDescriptor operationDescriptor) { super( operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
/** * Constructs a grid coverage operation backed by a JAI operation. The operation descriptor must * supports the {@code "rendered"} mode (which is the case for most JAI operations). * * @param operation The JAI operation descriptor. * @param descriptor The OGC parameters descriptor. */ protected OperationJAI( final OperationDescriptor operation, final ParameterDescriptorGroup descriptor) { super(descriptor); this.operation = operation; Utilities.ensureNonNull("operation", operation); /* * Check argument validity. */ ensureRenderedImage(operation.getDestClass(RENDERED_MODE)); final Class[] sourceClasses = operation.getSourceClasses(RENDERED_MODE); if (sourceClasses != null) { final int length = sourceClasses.length; assert length == operation.getNumSources(); for (int i = 0; i < length; i++) { ensureRenderedImage(sourceClasses[i]); } } assert super.getNumSources() == operation.getNumSources(); }
public OperationItem(OperationDescriptor op) { this.op = op; this.opName = op.getName(); this.vendor = op.getResourceBundle(null).getString(VENDOR_NAME); this.isMediaLibPreferred = false; }
if (operation instanceof OperationDescriptor) { final OperationDescriptor op = (OperationDescriptor) operation; final String[] names = op.getSourceNames(); final Class<?>[] types = op.getSourceClasses(registryMode); numSources = op.getNumSources(); desc = new ParameterDescriptor[numParameters + numSources]; for (int i = 0; i < numSources; i++) {
assertEquals("Scale", operationDescriptor.getName()); final ParameterListDescriptor parameterListDescriptor = operationDescriptor.getParameterListDescriptor("rendered"); assertNotNull(parameterListDescriptor); assertEquals(5, parameterListDescriptor.getNumParameters());
/** * Returns a string in the specified locale. * * @param locale The locale to look for, or {@code null} for the default locale. * @return The string in the specified locale, or in a default locale. * @throws MissingResourceException is the key given to the constructor is invalid. */ public String toString(Locale locale) throws MissingResourceException { if (locale == null) { locale = Locale.getDefault(); } final ResourceBundle resources = operation.getResourceBundle(locale); String name = resources.getString(key); if (prefixKey != null) { name = trimPrefix(name, resources.getString(prefixKey)); } return name; }
final String[] sourceNames = operation.getSourceNames(); final Collection<GridCoverage2D> sourceCollection = new ArrayList<GridCoverage2D>(); extractSources(parameters, sourceCollection, sourceNames);
final ResourceBundle bundle = op.getResourceBundle(Locale.getDefault()); String vendor = op.getResourceBundle(Locale.US).getString("Vendor"); Citation authority = null; if (vendor != null) {
(GridCoverage2D) parameters .parameter(operation.getSourceNames()[PRIMARY_SOURCE_INDEX]) .getValue(); final AffineTransform gridToWorldTransformCorrected =
/** * Constructor for {@link BaseMathOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. */ public BaseMathOperationJAI(OperationDescriptor operationDescriptor) { super( operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
public OperationItem(OperationDescriptor op) { this.op = op; this.opName = op.getName(); this.vendor = op.getResourceBundle(null).getString(VENDOR_NAME); this.isMediaLibPreferred = false; }
/** * Constructs a grid coverage operation backed by a JAI operation. The operation descriptor * must supports the {@code "rendered"} mode (which is the case for most JAI operations). * * @param operation The JAI operation descriptor. * @param descriptor The OGC parameters descriptor. */ protected OperationJAI(final OperationDescriptor operation, final ParameterDescriptorGroup descriptor) { super(descriptor); this.operation = operation; Utilities.ensureNonNull("operation", operation); /* * Check argument validity. */ ensureRenderedImage(operation.getDestClass(RENDERED_MODE)); final Class[] sourceClasses = operation.getSourceClasses(RENDERED_MODE); if (sourceClasses != null) { final int length = sourceClasses.length; assert length == operation.getNumSources(); for (int i=0; i<length; i++) { ensureRenderedImage(sourceClasses[i]); } } assert super.getNumSources() == operation.getNumSources(); }
/** * Returns the localized name for the given descriptor. The name will be fecth from the * "{@link OperationDescriptor#getResourceBundle LocalName}" resource, if available. * Otherwise, the {@linkplain RegistryElementDescriptor#getName non-localized name} is returned. */ private static String getName(final RegistryElementDescriptor descriptor, final Locale locale) { if (descriptor instanceof OperationDescriptor) { ResourceBundle resources = ((OperationDescriptor)descriptor).getResourceBundle(locale); if (resources != null) try { return resources.getString("LocalName"); } catch (MissingResourceException exception) { // No localized name. Fallback on the default (non-localized) descriptor name. // No warning to report here, this exception is really not a problem. } } return descriptor.getName(); }
(GridCoverage2D) parameters .parameter(operation.getSourceNames()[PRIMARY_SOURCE_INDEX]) .getValue(); final AffineTransform gridToWorldTransformCorrected =
/** * Applies the JAI operation. The operation name can be fetch from {@link #operation}. The JAI * instance to use can be fetch from {@link #getJAI}. The default implementation returns the * following: * * <blockquote> * * <pre> * {@linkplain #getJAI getJAI}(hints).{@linkplain JAI#createNS createNS}({@linkplain #operation}.getName(), parameters, hints) * </pre> * * </blockquote> * * Subclasses may override this method in order to invokes a different JAI operation according * the parameters. * * @param parameters The parameters to be given to JAI. * @param hints The rendering hints to be given to JAI. * @return The result of JAI operation using the given parameters and hints. */ protected RenderedImage createRenderedImage( final ParameterBlockJAI parameters, final RenderingHints hints) { return getJAI(hints).createNS(operation.getName(), parameters, hints); }
&& op.getResourceBundle(null) .getString(ConcurrentOperationRegistry.VENDOR_NAME) .equalsIgnoreCase(vendor) || op == null) { if (newFactory != null && registry.getFactory(RenderedRegistryMode.MODE_NAME, newItem.getDescriptor().getName()) == null) { registry.registerFactory(RenderedRegistryMode.MODE_NAME, descriptorName, newItem.getVendor(), newFactory);
/** * Constructs a grid coverage operation backed by a JAI operation. The operation descriptor * must supports the {@code "rendered"} mode (which is the case for most JAI operations). * * @param operation The JAI operation descriptor. * @param descriptor The OGC parameters descriptor. */ protected OperationJAI(final OperationDescriptor operation, final ParameterDescriptorGroup descriptor) { super(descriptor); this.operation = operation; ensureNonNull("operation", operation); /* * Check argument validity. */ ensureRenderedImage(operation.getDestClass(RENDERED_MODE)); final Class[] sourceClasses = operation.getSourceClasses(RENDERED_MODE); if (sourceClasses != null) { final int length = sourceClasses.length; assert length == operation.getNumSources(); for (int i=0; i<length; i++) { ensureRenderedImage(sourceClasses[i]); } } assert super.getNumSources() == operation.getNumSources(); }
final String key; final Locale locale = getLocale(); final ResourceBundle resources = operation.getResourceBundle(locale); if (param >= 0) { key = "arg"+param+"Desc";
.parameter(operation.getSourceNames()[PRIMARY_SOURCE_INDEX]) .getValue(); final AffineTransform gridToWorldTransformCorrected = new AffineTransform(
/** * Forcefully registers the specified rendered operation in the JAI registry * * @param descriptor * @param rif * @param productName * @return true if the registration succeded, false if the registration was not required as the * operation was already available in the registry */ public static boolean registerRIF( final JAI jai, OperationDescriptor descriptor, RenderedImageFactory rif, String productName) { final OperationRegistry registry = jai.getOperationRegistry(); try { // see if the operation is already registered, avoid registering it twice new ParameterBlockJAI(descriptor.getName()); return false; } catch (Exception e) { registry.registerDescriptor(descriptor); final String descName = descriptor.getName(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); return true; } }