Class AbstractImageProvider
java.lang.Object
fr.opensagres.xdocreport.document.images.AbstractImageProvider
- All Implemented Interfaces:
IImageProvider
- Direct Known Subclasses:
AbstractInputStreamImageProvider,ByteArrayImageProvider
Base class for image provider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanfr.opensagres.xdocreport.template.formatter.NullImageBehaviourReturns the behaviour to use when the stream of the image is null.Returns the height image with pixel unit.Returns image info of the current image content.Returns the width image with pixel unit.booleanisResize()Returns true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.booleanReturns true if image size comes from the image and false otherwise.booleanisValid()Returns true if the image provider is valid (ex : input stream not null) and false otherwise.protected abstract IImageInfoLoad image info.voidReset image info.voidsetBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Set the behaviour to use when the stream of the image is null.voidSet the height image with pixel unit.voidsetResize(boolean resize) Set true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.voidSet the width and height image with pixel unit.voidsetUseImageSize(boolean useImageSize) Set true if image size comes from the image and false otherwise.voidSet the width image with pixel unit.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.opensagres.xdocreport.document.images.IImageProvider
getImageFormat, write
-
Constructor Details
-
AbstractImageProvider
public AbstractImageProvider(boolean useImageSize)
-
-
Method Details
-
isUseImageSize
public boolean isUseImageSize()Description copied from interface:IImageProviderReturns true if image size comes from the image and false otherwise.- Specified by:
isUseImageSizein interfaceIImageProvider- Returns:
-
setUseImageSize
public void setUseImageSize(boolean useImageSize) Description copied from interface:IImageProviderSet true if image size comes from the image and false otherwise.- Specified by:
setUseImageSizein interfaceIImageProvider
-
getWidth
Description copied from interface:IImageProviderReturns the width image with pixel unit.- Specified by:
getWidthin interfaceIImageProvider- Parameters:
defaultWidth- as pixel- Returns:
- Throws:
IOException
-
getHeight
Description copied from interface:IImageProviderReturns the height image with pixel unit.- Specified by:
getHeightin interfaceIImageProvider- Parameters:
defaultHeight- as pixel- Returns:
- Throws:
IOException
-
setWidth
Description copied from interface:IImageProviderSet the width image with pixel unit.- Specified by:
setWidthin interfaceIImageProvider
-
setHeight
Description copied from interface:IImageProviderSet the height image with pixel unit.- Specified by:
setHeightin interfaceIImageProvider
-
setSize
Description copied from interface:IImageProviderSet the width and height image with pixel unit.- Specified by:
setSizein interfaceIImageProvider
-
getImageInfo
Returns image info of the current image content.- Returns:
- Throws:
IOException
-
resetImageInfo
public void resetImageInfo()Reset image info. -
setResize
public void setResize(boolean resize) Description copied from interface:IImageProviderSet true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.- Specified by:
setResizein interfaceIImageProvider
-
isResize
public boolean isResize()Description copied from interface:IImageProviderReturns true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.- Specified by:
isResizein interfaceIImageProvider- Returns:
-
loadImageInfo
Load image info.- Returns:
- Throws:
IOException
-
getBehaviour
public fr.opensagres.xdocreport.template.formatter.NullImageBehaviour getBehaviour()Description copied from interface:IImageProviderReturns the behaviour to use when the stream of the image is null.- Specified by:
getBehaviourin interfaceIImageProvider- Returns:
-
setBehaviour
public void setBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Description copied from interface:IImageProviderSet the behaviour to use when the stream of the image is null.- Specified by:
setBehaviourin interfaceIImageProvider
-
isValid
public boolean isValid()Description copied from interface:IImageProviderReturns true if the image provider is valid (ex : input stream not null) and false otherwise.- Specified by:
isValidin interfaceIImageProvider- Returns:
-
doIsValid
protected abstract boolean doIsValid()
-