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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.spreadsheet.SheetOverlayWrapper
SheetOverlayWrapper.OverlayChangeListener
-
-
Constructor Summary
Constructors Constructor Description SheetChartWrapper(org.apache.poi.xssf.usermodel.XSSFChart chartXml, Spreadsheet spreadsheet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.component.ComponentgetComponent(boolean init)Returns the component contained in this wrapper if there is one.floatgetHeight(org.apache.poi.ss.usermodel.Sheet sheet, float[] rowH)Calculates the height of the image.StringgetId()Returns a unique ID of this overlay, used also as a resource key for images.OverlayInfo.TypegetType()floatgetWidth(org.apache.poi.ss.usermodel.Sheet sheet, int[] colW, int defaultColumnWidthPX)Calculates the width of the image.static voidsetChartCreator(ChartCreator newChartCreator)voidsetOverlayChangeListener(SheetOverlayWrapper.OverlayChangeListener listener)If this overlay's state can be dynamically changed (like minimizing), this method can inform the spreadsheet.-
Methods inherited from class com.vaadin.flow.component.spreadsheet.SheetOverlayWrapper
equals, getAnchor, getResource, hashCode, isVisible, isVisible, setVisible, toString
-
-
-
-
Constructor Detail
-
SheetChartWrapper
public SheetChartWrapper(org.apache.poi.xssf.usermodel.XSSFChart chartXml, Spreadsheet spreadsheet)
-
-
Method Detail
-
setOverlayChangeListener
public void setOverlayChangeListener(SheetOverlayWrapper.OverlayChangeListener listener)
Description copied from class:SheetOverlayWrapperIf this overlay's state can be dynamically changed (like minimizing), this method can inform the spreadsheet.- Overrides:
setOverlayChangeListenerin classSheetOverlayWrapper
-
setChartCreator
public static void setChartCreator(ChartCreator newChartCreator)
-
getId
public String getId()
Description copied from class:SheetOverlayWrapperReturns a unique ID of this overlay, used also as a resource key for images.- Overrides:
getIdin classSheetOverlayWrapper
-
getComponent
public com.vaadin.flow.component.Component getComponent(boolean init)
Description copied from class:SheetOverlayWrapperReturns the component contained in this wrapper if there is one.- Overrides:
getComponentin classSheetOverlayWrapper- 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:
getTypein classSheetOverlayWrapper
-
getHeight
public float getHeight(org.apache.poi.ss.usermodel.Sheet sheet, float[] rowH)Description copied from class:SheetOverlayWrapperCalculates 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:
getHeightin classSheetOverlayWrapper- Parameters:
sheet- The sheet this image belongs torowH- 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:SheetOverlayWrapperCalculates 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:
getWidthin classSheetOverlayWrapper- Parameters:
sheet- The sheet this image belongs tocolW- Array of column widths in pixelsdefaultColumnWidthPX- Default column width in pixels- Returns:
- Width of the image in pixels, or -1 if image file width should be used
-
-