Class XlsxImage

All Implemented Interfaces:
Serializable, XlsxElement, Identified

@Component public class XlsxImage extends XlsxComponent implements XlsxElement
This class extends XlsxComponent and implements XlsxElement.
See Also:
  • Field Details

    • _row

      protected int _row
    • _col

      protected int _col
    • _resizeMode

      protected int _resizeMode
    • _image

      protected String _image
    • _type

      protected int _type
    • _width

      protected double _width
    • _height

      protected double _height
  • Constructor Details

    • XlsxImage

      public XlsxImage()
  • Method Details

    • setCOL

      public void setCOL(String s)
      Sets the number of columns.
      Parameters:
      s - The number columns to set.
    • setROW

      public void setROW(String s)
      Sets the number of rows.
      Parameters:
      s - The number rows to set.
    • setRESIZEMODE

      public void setRESIZEMODE(String s)
    • setWIDTH

      public void setWIDTH(String s)
    • setHEIGHT

      public void setHEIGHT(String s)
    • setIMAGE

      public void setIMAGE(String s)
    • setTYPE

      public void setTYPE(String s)
    • getContent

      public void getContent(org.apache.poi.ss.usermodel.Sheet sheet, int startRow, int startCol) throws Exception
      Specified by:
      getContent in interface XlsxElement
      Throws:
      Exception
    • getOccupationRow

      public int getOccupationRow()
      Specified by:
      getOccupationRow in interface XlsxElement
    • getOccupationCol

      public int getOccupationCol()
      Specified by:
      getOccupationCol in interface XlsxElement
    • fitImageToColumns

      protected XlsxImage.ClientAnchorDetail fitImageToColumns(org.apache.poi.ss.usermodel.Sheet sheet, int colNumber, double reqImageWidthMM, int resizeBehaviour)
      Determines whether the sheets columns should be re-sized to accommodate the image, adjusts the columns width if necessary and creates then returns a ClientAnchorDetail object that facilitates construction of an ClientAnchor that will fix the image on the sheet and establish it's size.
      Parameters:
      sheet - A reference to the sheet that will 'contain' the image.
      colNumber - A primitive int that contains the index number of a column on the sheet.
      reqImageWidthMM - A primitive double that contains the required width of the image in millimetres
      resizeBehaviour - A primitive int whose value will indicate how the width of the column should be adjusted if the required width of the image is greater than the width of the column.
      Returns:
      An instance of the ClientAnchorDetail class that will contain the index number of the column containing the cell whose top left hand corner also defines the top left hand corner of the image, the index number column containing the cell whose top left hand corner also defines the bottom right hand corner of the image and an inset that determines how far the right hand edge of the image can protrude into the next column - expressed as a specific number of coordinate positions.
    • calculateColumnLocation

      protected XlsxImage.ClientAnchorDetail calculateColumnLocation(org.apache.poi.ss.usermodel.Sheet sheet, int startingColumn, double reqImageWidthMM)
    • calculateRowLocation

      protected XlsxImage.ClientAnchorDetail calculateRowLocation(org.apache.poi.ss.usermodel.Sheet sheet, int startingRow, double reqImageHeightMM)
      If the image is to overlie more than one rows, calculations need to be performed to determine how many rows and whether the image will overlie just a part of one row in order to be presented at the required size.
      Parameters:
      sheet - The sheet that will 'contain' the image.
      startingRow - A primitive int whose value is the index of the row that contains the cell whose top left hand corner should be aligned with the top left hand corner of the image.
      reqImageHeightMM - A primitive double whose value will indicate the required height of the image in millimetres.
      Returns:
      An instance of the ClientAnchorDetail class that will contain the index number of the row containing the cell whose top left hand corner also defines the top left hand corner of the image, the index number of the row containing the cell whose top left hand corner also defines the bottom right hand corner of the image and an inset that determines how far the bottom edge can protrude into the next (lower) row - expressed as a specific number of coordinate positions.
    • fitImageToRows

      protected XlsxImage.ClientAnchorDetail fitImageToRows(org.apache.poi.ss.usermodel.Sheet sheet, int rowNumber, double reqImageHeightMM, int resizeBehaviour)
      Determines whether the sheets row should be re-sized to accommodate the image, adjusts the rows height if necessary and creates then returns a ClientAnchorDetail object that facilitates construction of a ClientAnchor that will fix the image on the sheet and establish it's size.
      Parameters:
      sheet - A reference to the sheet that will 'contain' the image.
      rowNumber - A primitive int that contains the index number of a row on the sheet.
      reqImageHeightMM - A primitive double that contains the required height of the image in millimetres
      resizeBehaviour - A primitive int whose value will indicate how the height of the row should be adjusted if the required height of the image is greater than the height of the row.
      Returns:
      An instance of the ClientAnchorDetail class that will contain the index number of the row containing the cell whose top left hand corner also defines the top left hand corner of the image, the index number of the row containing the cell whose top left hand corner also defines the bottom right hand corner of the image and an inset that determines how far the bottom edge of the image can protrude into the next (lower) row - expressed as a specific number of coordinate positions.