com.vaadin.flow.component.spreadsheet.
Class SheetChartWrapper
- java.lang.Object
-
- com.vaadin.flow.component.spreadsheet.SheetOverlayWrapper
-
- com.vaadin.flow.component.spreadsheet.SheetChartWrapper
-
All Implemented Interfaces:
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:
-
-
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 Modifier and Type Method Description Component
getComponent(boolean init)
Returns the component contained in this wrapper if there is one.
float
getHeight(org.apache.poi.ss.usermodel.Sheet sheet, float[] rowH)
Calculates the height of the image.
String
getId()
Returns a unique ID of this overlay, used also as a resource key for images.
OverlayInfo.Type
getType()
float
getWidth(org.apache.poi.ss.usermodel.Sheet sheet, int[] colW, int defaultColumnWidthPX)
Calculates the width of the image.
static void
setChartCreator(ChartCreator newChartCreator)
void
setOverlayChangeListener(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:
SheetOverlayWrapper
If this overlay's state can be dynamically changed (like minimizing), this method can inform the spreadsheet.
Overrides:
-
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 classSheetOverlayWrapper
-
getComponent
public Component getComponent(boolean init)
Description copied from class:
SheetOverlayWrapper
Returns the component contained in this wrapper if there is one.
Overrides:
getComponent
in 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:
getType
in classSheetOverlayWrapper
-
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 classSheetOverlayWrapper
Parameters:
sheet
- The sheet this image belongs torowH
- Array of row heights in pointsReturns:
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 classSheetOverlayWrapper
Parameters:
sheet
- The sheet this image belongs tocolW
- Array of column widths in pixelsdefaultColumnWidthPX
- Default column width in pixelsReturns:
Width of the image in pixels, or -1 if image file width should be used
-
-