fr.opensagres.xdocreport.document.json
Class JSONImage

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by fr.opensagres.xdocreport.document.json.JSONObject
              extended by fr.opensagres.xdocreport.document.json.JSONImage
All Implemented Interfaces:
IImageProvider, IJSONNode, Serializable, Cloneable, Map

public class JSONImage
extends JSONObject
implements IImageProvider

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
 
Fields inherited from class fr.opensagres.xdocreport.document.json.JSONObject
DEFAULT_UPPER_CASE, NULL
 
Constructor Summary
JSONImage()
           
 
Method Summary
 NullImageBehaviour getBehaviour()
          Returns the behaviour to use when the stream of the image is null.
 Float getHeight()
          Returns the height image with pixel unit.
 ImageFormat getImageFormat()
          Returns the image format.
 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.
 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.
 void write(OutputStream outputStream)
          Write the binary data of the image in the given output stream.
 
Methods inherited from class fr.opensagres.xdocreport.document.json.JSONObject
accumulate, append, doubleToString, get, getBoolean, getDate, getDouble, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getString, has, increment, isDate, isImage, isNull, isUpperCaseFirstChar, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putOnce, putOpt, quote, remove, stringToValue, testValidity, toJSONArray, toString, toString, valueToString, wrap, write
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

JSONImage

public JSONImage()
Method Detail

write

public void write(OutputStream outputStream)
           throws IOException
Description copied from interface: IImageProvider
Write the binary data of the image in the given output stream.

Specified by:
write in interface IImageProvider
Throws:
IOException

getImageFormat

public ImageFormat getImageFormat()
Description copied from interface: IImageProvider
Returns the image format.

Specified by:
getImageFormat in interface IImageProvider
Returns:

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

setWidth

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

Specified by:
setWidth in interface IImageProvider

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

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

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

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:

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:


Copyright © 2013. All rights reserved.