Class SheetChartWrapper

java.lang.Object
com.vaadin.flow.component.spreadsheet.SheetOverlayWrapper
com.vaadin.flow.component.spreadsheet.SheetChartWrapper
All Implemented Interfaces:
Serializable

public class SheetChartWrapper extends SheetOverlayWrapper implements Serializable
SheetChartWrapper is an utility class of the Spreadsheet component. In addition to the chart resource, this wrapper contains the chart's visibility state, position and size.
Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • SheetChartWrapper

      public SheetChartWrapper(org.apache.poi.xssf.usermodel.XSSFChart chartXml, Spreadsheet spreadsheet)
  • Method Details

    • setOverlayChangeListener

      public void setOverlayChangeListener(SheetOverlayWrapper.OverlayChangeListener listener)
      Description copied from class: SheetOverlayWrapper
      If this overlay's state can be dynamically changed (like minimizing), this method can inform the spreadsheet.
      Overrides:
      setOverlayChangeListener in class SheetOverlayWrapper
    • setChartCreator

      public static void setChartCreator(ChartCreator newChartCreator)
    • getId

      public String getId()
      Description copied from class: SheetOverlayWrapper
      Returns a unique ID of this overlay, used also as a resource key for images.
      Overrides:
      getId in class SheetOverlayWrapper
    • getComponent

      public com.vaadin.flow.component.Component getComponent(boolean init)
      Description copied from class: SheetOverlayWrapper
      Returns the component contained in this wrapper if there is one.
      Overrides:
      getComponent in class SheetOverlayWrapper
      Parameters:
      init - false if you don't want to initialize the component, calling with true after the first time has no effect.
    • getType

      public OverlayInfo.Type getType()
      Specified by:
      getType in class SheetOverlayWrapper
    • getHeight

      public float getHeight(org.apache.poi.ss.usermodel.Sheet sheet, float[] rowH)
      Description copied from class: SheetOverlayWrapper
      Calculates the height of the image. Might not be 100% correct because of bugs in POI (returns inconsistent values for Dx and Dy).

      If the image doesn't have a specified height and should be sized to image file size, -1 is returned.

      Overrides:
      getHeight in class SheetOverlayWrapper
      Parameters:
      sheet - The sheet this image belongs to
      rowH - Array of row heights in points
      Returns:
      Image height in points, or -1 if image file height should be used.
    • getWidth

      public float getWidth(org.apache.poi.ss.usermodel.Sheet sheet, int[] colW, int defaultColumnWidthPX)
      Description copied from class: SheetOverlayWrapper
      Calculates the width of the image. Might not be 100% correct because of bugs in POI (returns inconsistent values for Dx and Dy).

      If the image doesn't have a specified width and should be sized to image file size, -1 is returned.

      Overrides:
      getWidth in class SheetOverlayWrapper
      Parameters:
      sheet - The sheet this image belongs to
      colW - Array of column widths in pixels
      defaultColumnWidthPX - Default column width in pixels
      Returns:
      Width of the image in pixels, or -1 if image file width should be used