Package org.apache.poi.xssf.streaming
Class SXSSFPicture
- java.lang.Object
-
- org.apache.poi.xssf.streaming.SXSSFPicture
-
public final class SXSSFPicture extends Object implements Picture
Streaming version of Picture. Most of the code is a copy of the non-streaming XSSFPicture code. This is necessary as a private method getRowHeightInPixels of that class needs to be changed, which is called by a method call chain nested several levels. The main change is to access the rows in the SXSSF sheet, not the always empty rows in the XSSF sheet when checking the row heights.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XSSFAnchorgetAnchor()XSSFClientAnchorgetClientAnchor()org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicturegetCTPicture()Return the underlying CTPicture bean that holds all properties for this pictureXSSFDrawinggetDrawing()DimensiongetImageDimension()protected static DimensiongetImageDimension(PackagePart part, int type)Return the dimension of this imageShapegetParent()XSSFPictureDatagetPictureData()Return picture data for this shapeXSSFClientAnchorgetPreferredSize()Calculate the preferred size for this picture.XSSFClientAnchorgetPreferredSize(double scale)Calculate the preferred size for this picture.XSSFClientAnchorgetPreferredSize(double scaleX, double scaleY)StringgetShapeName()protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapePropertiesgetShapeProperties()XSSFSheetgetSheet()booleanisNoFill()voidresize()Reset the image to the original size.voidresize(double scale)Reset the image to the original size.voidresize(double scaleX, double scaleY)voidsetFillColor(int red, int green, int blue)voidsetLineStyleColor(int red, int green, int blue)voidsetNoFill(boolean noFill)
-
-
-
Method Detail
-
getCTPicture
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()
Return the underlying CTPicture bean that holds all properties for this picture- Returns:
- the underlying CTPicture bean
-
resize
public void resize()
Reset the image to the original size.Please note, that this method works correctly only for workbooks with the default font size (Calibri 11pt for .xlsx). If the default font is changed the resized image can be streched vertically or horizontally.
-
resize
public void resize(double scale)
Reset the image to the original size.Please note, that this method works correctly only for workbooks with the default font size (Calibri 11pt for .xlsx). If the default font is changed the resized image can be streched vertically or horizontally.
-
getPreferredSize
public XSSFClientAnchor getPreferredSize()
Calculate the preferred size for this picture.- Specified by:
getPreferredSizein interfacePicture- Returns:
- XSSFClientAnchor with the preferred size for this image
-
getPreferredSize
public XSSFClientAnchor getPreferredSize(double scale)
Calculate the preferred size for this picture.- Parameters:
scale- the amount by which image dimensions are multiplied relative to the original size.- Returns:
- XSSFClientAnchor with the preferred size for this image
-
getImageDimension
protected static Dimension getImageDimension(PackagePart part, int type)
Return the dimension of this image- Parameters:
part- the package part holding raw picture datatype- type of the picture:Workbook.PICTURE_TYPE_JPEG,Workbook.PICTURE_TYPE_PNGorWorkbook.PICTURE_TYPE_DIB- Returns:
- image dimension in pixels
-
getPictureData
public XSSFPictureData getPictureData()
Return picture data for this shape- Specified by:
getPictureDatain interfacePicture- Returns:
- picture data for this shape
-
getShapeProperties
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
-
getAnchor
public XSSFAnchor getAnchor()
-
getPreferredSize
public XSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
- Specified by:
getPreferredSizein interfacePicture
-
getImageDimension
public Dimension getImageDimension()
- Specified by:
getImageDimensionin interfacePicture
-
getClientAnchor
public XSSFClientAnchor getClientAnchor()
- Specified by:
getClientAnchorin interfacePicture
-
getDrawing
public XSSFDrawing getDrawing()
-
getShapeName
public String getShapeName()
- Specified by:
getShapeNamein interfaceShape
-
setFillColor
public void setFillColor(int red, int green, int blue)- Specified by:
setFillColorin interfaceShape
-
setLineStyleColor
public void setLineStyleColor(int red, int green, int blue)- Specified by:
setLineStyleColorin interfaceShape
-
-