public interface ImageManager
ImageTypeDescriptor
can be
registered along with an ImageProvider
which is responsible for retrieving the full-size
(= unscaled) image.
On startup a set of built-in image types and providers are added automatically.
Modifier and Type | Method and Description |
---|---|
void |
defaultImageChanged(String typeName,
String providerIdentifier)
Inform the image manager that the default image of the given provider changed.
|
Image |
getImage(String typeName,
ImageDescriptor descriptor)
Get an image
|
Image |
getImage(String typeName,
Map<String,? extends Object> parameters,
ImageSizeType size)
Get an image
|
Image |
getImage(String typeName,
String imageIdentifier,
ImageSizeType size)
Get an image
|
ImageSize |
getImageSize(String typeName,
ImageSizeType sizeType)
Map the size type constant to the actual size.
|
String |
getImageVersionString(String typeName,
String imageIdentifier)
Return a string which represents the version of the image.
|
void |
imageChanged(String typeName,
String providerIdentifier,
String imageIdentifier)
Inform the image manager that an image was changed.
|
void |
registerImageProvider(String imageTypeName,
ImageProvider provider)
Register an image provider which can load images for the given image type.
|
void |
registerImageType(ImageTypeDescriptor imageType)
Register an image type.
|
void |
unregisterImageProvider(String imageTypeName,
ImageProvider provider)
Remove an image provider which was added for a given image type.
|
void |
unregisterImageType(ImageTypeDescriptor imageType)
Remove a previously registered image type.
|
void defaultImageChanged(String typeName, String providerIdentifier)
typeName
- the type of the image that changed. If there is no provider for the image type,
this call has no effect.providerIdentifier
- the ID of the ImageProvider
that loaded the changed image. If null, all
providers that are registered for that type are considered.Image getImage(String typeName, ImageDescriptor descriptor) throws AuthorizationException, IOException, ImageNotFoundException
typeName
- Name of the image typedescriptor
- the descriptor with image ID and details about scalingAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the descriptor and a default image doesn't exist
neitherImage getImage(String typeName, Map<String,? extends Object> parameters, ImageSizeType size) throws AuthorizationException, IOException, ImageNotFoundException
typeName
- the name of the type of the imageparameters
- the parameters as a key to value mapping which can contain the image identifier.
The ImageTypeDescriptor identified by the typeName will be used to extract the
identifier.size
- the size type constant which will be mapped to the actual sizeAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the extracted identifier and a default image
doesn't exist neitherImage getImage(String typeName, String imageIdentifier, ImageSizeType size) throws AuthorizationException, IOException, ImageNotFoundException
typeName
- the name of the type of the imageimageIdentifier
- the identifier of the imagesize
- the size type constant which will be mapped to the actual sizeAuthorizationException
- in case the current user has no access to the imageIOException
- in case retrieving or scaling the image failedImageNotFoundException
- in case the image type is not known or there is no provider for the image type or
the provider has no image for the identifier and a default image doesn't exist
neitherImageSize getImageSize(String typeName, ImageSizeType sizeType)
typeName
- the name of the image typesizeType
- the size type constant to mapString getImageVersionString(String typeName, String imageIdentifier) throws ImageNotFoundException, AuthorizationException
typeName
- Name of the image type.imageIdentifier
- identifier of the imageImageNotFoundException
- in case there is no provider for that image type or the image with the identifier
does not exist the provider has no default imageAuthorizationException
- in case the current user is not allowed to access the imagevoid imageChanged(String typeName, String providerIdentifier, String imageIdentifier)
typeName
- the type of the image that changed. If there is no provider for the image type,
this call has no effect.providerIdentifier
- the ID of the ImageProvider
that loaded the changed image. If null, all
providers that are registered for that type are considered.imageIdentifier
- the ID of the image that changed. If null, all images of the provider are treated
as having changed.void registerImageProvider(String imageTypeName, ImageProvider provider) throws ImageProviderManagerException, ImageTypeNotFoundException
imageTypeName
- the name of the type which must have been registered beforeprovider
- the provider to addImageProviderManagerException
- in case there is already a provider with the same identifierImageTypeNotFoundException
- in case the image type does not existvoid registerImageType(ImageTypeDescriptor imageType)
imageType
- the descriptor of the typeIllegalArgumentException
- in case the type has no namevoid unregisterImageProvider(String imageTypeName, ImageProvider provider) throws ImageProviderManagerException
imageTypeName
- the name of the typeprovider
- the provider to removeImageProviderManagerException
- in case the provider to remove is a built-in providervoid unregisterImageType(ImageTypeDescriptor imageType)
imageType
- the type to removeCopyright © 2019 Communote team. All rights reserved.