Package org.jxls.command
Class ImageCommand
java.lang.Object
org.jxls.command.AbstractCommand
org.jxls.command.ImageCommand
- All Implemented Interfaces:
Command
Implements image rendering
Image is specified by providing image bytes and type.
- Author:
- Leonid Vysochyn
-
Field Summary
FieldsFields inherited from class org.jxls.command.AbstractCommand
areaListFields inherited from interface org.jxls.command.Command
ADJACENT_SHIFT_MODE, INNER_SHIFT_MODE -
Constructor Summary
ConstructorsConstructorDescriptionImageCommand(byte[] imageBytes, ImageType imageType) Creates the command from the image bytesImageCommand(String image, ImageType imageType) Creates the command from an image in the context -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopy(InputStream in, OutputStream out) getName()getSrc()voidsetImageType(String strType) voidsetImageType(ImageType imageType) voidvoidvoidstatic byte[]toByteArray(InputStream inputStream) Reads all the data from the input stream and returns the bytes read.Methods inherited from class org.jxls.command.AbstractCommand
getAreaList, getLogger, getShiftMode, getTransformer, reset, setLockRange, setLockRange, setShiftMode, transformToIterableObject
-
Field Details
-
COMMAND_NAME
- See Also:
-
-
Constructor Details
-
ImageCommand
public ImageCommand() -
ImageCommand
Creates the command from an image in the context- Parameters:
image- name of the context attribute with the image bytesimageType- type of the image
-
ImageCommand
Creates the command from the image bytes- Parameters:
imageBytes- the image byte arrayimageType- the type of the image to render (e.g. PNG, JPEG etc)
-
-
Method Details
-
getSrc
- Returns:
- src expression producing image byte array
-
setSrc
- Parameters:
src- expression resulting in image byte array
-
getImageType
-
setImageType
-
setImageType
- Parameters:
strType- "PNG", "JPEG" (not "JPG"), ...
-
getScaleX
-
setScaleX
-
getScaleY
-
setScaleY
-
getLockRange
- Specified by:
getLockRangein interfaceCommand- Overrides:
getLockRangein classAbstractCommand
-
addArea
- Specified by:
addAreain interfaceCommand- Overrides:
addAreain classAbstractCommand
-
getName
-
applyAt
-
toByteArray
Reads all the data from the input stream and returns the bytes read.- Parameters:
inputStream- -- Returns:
- byte array
- Throws:
IOException- -
-
copy
- Throws:
IOException
-