Package org.eclipse.imagen.registry
Class CRIFRegistry
Object
CRIFRegistry
Utility class to provide type-safe interaction with the
OperationRegistry for
ContextualRenderedImageFactory objects.
If the OperationRegistry is null, then
ImageN.getDefaultInstance().getOperationRegistry() will be used.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RenderedImagecreate(OperationRegistry registry, String operationName, RenderContext context, ParameterBlock paramBlock) Creates a rendering, given a RenderContext and a ParameterBlock containing the operation's sources and parameters.get(OperationRegistry registry, String operationName) Returns theContextualRenderedImageFactoryobject registered against the operation name.static PropertySourceConstructs and returns aPropertySourcesuitable for use by a givenRenderableOp.static voidregister(OperationRegistry registry, String operationName, ContextualRenderedImageFactory crif) Register a CRIF with a particular operation against a specified mode.static voidunregister(OperationRegistry registry, String operationName, ContextualRenderedImageFactory crif) Unregister a CRIF previously registered with an operation against the specified mode.
-
Constructor Details
-
CRIFRegistry
public CRIFRegistry()
-
-
Method Details
-
register
public static void register(OperationRegistry registry, String operationName, ContextualRenderedImageFactory crif) Register a CRIF with a particular operation against a specified mode. This is ImageN 1.0.x equivalent ofregistry.registerCRIF(...)- Parameters:
registry- theOperationRegistryto register with. if this isnull, thenImageN.getDefaultInstance().getOperationRegistry()will be used.operationName- the operation name as aStringcrif- theContextualRenderedImageFactoryto be registered- Throws:
IllegalArgumentException- if operationName or crif isnullIllegalArgumentException- if there is noOperationDescriptorregistered against theoperationName
-
unregister
public static void unregister(OperationRegistry registry, String operationName, ContextualRenderedImageFactory crif) Unregister a CRIF previously registered with an operation against the specified mode.- Parameters:
registry- theOperationRegistryto unregister from. if this isnull, thenImageN.getDefaultInstance().getOperationRegistry()will be used.operationName- the operation name as aStringcrif- theContextualRenderedImageFactoryto be unregistered- Throws:
IllegalArgumentException- if operationName or crif isnullIllegalArgumentException- if there is noOperationDescriptorregistered against theoperationNameIllegalArgumentException- if the crif was not previously registered against operationName
-
get
Returns theContextualRenderedImageFactoryobject registered against the operation name.- Parameters:
registry- theOperationRegistryto use. if this isnull, thenImageN.getDefaultInstance().getOperationRegistry()will be used.operationName- the operation name as aString- Returns:
- a registered
ContextualRenderedImageFactoryobject - Throws:
IllegalArgumentException- if operationName isnullIllegalArgumentException- if there is noOperationDescriptorregistered against theoperationName
-
create
public static RenderedImage create(OperationRegistry registry, String operationName, RenderContext context, ParameterBlock paramBlock) Creates a rendering, given a RenderContext and a ParameterBlock containing the operation's sources and parameters. The registry is used to determine the CRIF to be used to instantiate the operation.- Parameters:
registry- theOperationRegistryto use. if this isnull, thenImageN.getDefaultInstance().getOperationRegistry()will be used.operationName- the operation name as aStringcontext- aRenderContextobject containing the rendering context.paramBlock- the operation's ParameterBlock.- Throws:
IllegalArgumentException- if operationName isnullIllegalArgumentException- if there is noOperationDescriptorregistered against theoperationName
-
getPropertySource
Constructs and returns aPropertySourcesuitable for use by a givenRenderableOp. ThePropertySourceincludes properties copied from prior nodes as well as those generated at the node itself. Additionally, property suppression is taken into account. The actual implementation ofgetPropertySource()may make use of deferred execution and caching.- Parameters:
op- theRenderableOprequesting itsPropertySource.- Throws:
IllegalArgumentException- ifopisnull
-