fr.opensagres.xdocreport.document.images
Class AbstractImageProvider

java.lang.Object
  extended by fr.opensagres.xdocreport.document.images.AbstractImageProvider
All Implemented Interfaces:
IImageProvider
Direct Known Subclasses:
AbstractInputStreamImageProvider, ByteArrayImageProvider

public abstract class AbstractImageProvider
extends Object
implements IImageProvider

Base class for image provider.


Constructor Summary
AbstractImageProvider(boolean useImageSize)
           
 
Method Summary
protected abstract  boolean doIsValid()
           
 NullImageBehaviour getBehaviour()
          Returns the behaviour to use when the stream of the image is null.
 Float getHeight()
          Returns the height image with pixel unit.
 SimpleImageInfo getImageInfo()
          Returns image info of the current image content.
 Float getWidth()
          Returns the width image with pixel unit.
 boolean isResize()
          Returns true if call of IImageProvider.setWidth(Float) must compute image height with ratio or if call of IImageProvider.setHeight(Float) must compute image with with ratio and false otherwise.
 boolean isUseImageSize()
          Returns true if image size comes from the image and false otherwise.
 boolean isValid()
          Returns true if the image provider is valid (ex : input stream not null) and false otherwise.
protected abstract  SimpleImageInfo loadImageInfo()
          Load image info.
 void resetImageInfo()
          Reset image info.
 void setBehaviour(NullImageBehaviour behaviour)
          Set the behaviour to use when the stream of the image is null.
 void setHeight(Float height)
          Set the height image with pixel unit.
 void setResize(boolean resize)
          Set true if call of IImageProvider.setWidth(Float) must compute image height with ratio or if call of IImageProvider.setHeight(Float) must compute image with with ratio and false otherwise.
 void setSize(Float width, Float height)
          Set the width and height image with pixel unit.
 void setUseImageSize(boolean useImageSize)
          Set true if image size comes from the image and false otherwise.
 void setWidth(Float width)
          Set the width image with pixel unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.opensagres.xdocreport.document.images.IImageProvider
getImageFormat, write
 

Constructor Detail

AbstractImageProvider

public AbstractImageProvider(boolean useImageSize)
Method Detail

isUseImageSize

public boolean isUseImageSize()
Description copied from interface: IImageProvider
Returns true if image size comes from the image and false otherwise.

Specified by:
isUseImageSize in interface IImageProvider
Returns:

setUseImageSize

public void setUseImageSize(boolean useImageSize)
Description copied from interface: IImageProvider
Set true if image size comes from the image and false otherwise.

Specified by:
setUseImageSize in interface IImageProvider

getWidth

public Float getWidth()
               throws IOException
Description copied from interface: IImageProvider
Returns the width image with pixel unit.

Specified by:
getWidth in interface IImageProvider
Returns:
Throws:
IOException

getHeight

public Float getHeight()
                throws IOException
Description copied from interface: IImageProvider
Returns the height image with pixel unit.

Specified by:
getHeight in interface IImageProvider
Returns:
Throws:
IOException

setWidth

public void setWidth(Float width)
Description copied from interface: IImageProvider
Set the width image with pixel unit.

Specified by:
setWidth in interface IImageProvider

setHeight

public void setHeight(Float height)
Description copied from interface: IImageProvider
Set the height image with pixel unit.

Specified by:
setHeight in interface IImageProvider

setSize

public void setSize(Float width,
                    Float height)
Description copied from interface: IImageProvider
Set the width and height image with pixel unit.

Specified by:
setSize in interface IImageProvider

getImageInfo

public SimpleImageInfo getImageInfo()
                             throws IOException
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: IImageProvider
Set true if call of IImageProvider.setWidth(Float) must compute image height with ratio or if call of IImageProvider.setHeight(Float) must compute image with with ratio and false otherwise.

Specified by:
setResize in interface IImageProvider

isResize

public boolean isResize()
Description copied from interface: IImageProvider
Returns true if call of IImageProvider.setWidth(Float) must compute image height with ratio or if call of IImageProvider.setHeight(Float) must compute image with with ratio and false otherwise.

Specified by:
isResize in interface IImageProvider
Returns:

loadImageInfo

protected abstract SimpleImageInfo loadImageInfo()
                                          throws IOException
Load image info.

Returns:
Throws:
IOException

getBehaviour

public NullImageBehaviour getBehaviour()
Description copied from interface: IImageProvider
Returns the behaviour to use when the stream of the image is null.

Specified by:
getBehaviour in interface IImageProvider
Returns:

setBehaviour

public void setBehaviour(NullImageBehaviour behaviour)
Description copied from interface: IImageProvider
Set the behaviour to use when the stream of the image is null.

Specified by:
setBehaviour in interface IImageProvider

isValid

public boolean isValid()
Description copied from interface: IImageProvider
Returns true if the image provider is valid (ex : input stream not null) and false otherwise.

Specified by:
isValid in interface IImageProvider
Returns:

doIsValid

protected abstract boolean doIsValid()


Copyright © 2013. All rights reserved.