Class RowAutoHeightXlsxHint
java.lang.Object
io.jmix.reports.yarg.formatters.impl.xlsx.hints.RowAutoHeightXlsxHint
- All Implemented Interfaces:
XlsxHint
Recalculates row heights depending on the cell values and fonts.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<RowAutoHeightXlsxHint.CellDataObject>protected static final intprotected static final Stringprotected Documentprotected FontRenderContextprotected static final org.slf4j.Loggerprotected static final doubleMax value of the row height in Excel (in points). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.xlsx4j.sml.Cell templateCell, org.xlsx4j.sml.Cell resultCell, BandData bandData, List<String> params) voidapply()protected doublecalculateCellHeight(StyleSheet.Font font, String cellValue, int cellWidthInPixels) protected intcalculateCellWidth(int columnWidthInPixels, org.xlsx4j.sml.Cell resultCell) protected doublecalculateCharsCount(double sourceColumnWidth, double defaultCharWidth) protected AttributedStringcreateAttributedString(StyleSheet.Font font, String value) protected intgetColumnWidthInPixels(double defaultCharCount) Calculates column width in pixels as a width of the string containing a provided count ofdefaultChar.protected IntegergetColumnWidthInPixels(CellReference cellReference, double defaultCharWidth, Map<Double, Integer> columnWidths) protected doublegetDefaultCharsWidth(int count) protected doubleprotected intgetIndentInPixels(int indent) protected RangegetMergedCell(CellReference cellReference, List<Range> mergedCells) protected IntegergetMergedCellWidthInPixels(Range range, double defaultCharWidth, Map<Double, Integer> columnWidths) getName()protected booleanisMaxHeight(Double rowHeight)
-
Field Details
-
log
protected static final org.slf4j.Logger log -
MAX_ROW_HEIGHT
protected static final double MAX_ROW_HEIGHTMax value of the row height in Excel (in points).- See Also:
-
defaultChar
- See Also:
-
DEFAULT_FONT_SIZE
protected static final int DEFAULT_FONT_SIZE- See Also:
-
document
-
fontRenderContext
-
data
-
-
Constructor Details
-
RowAutoHeightXlsxHint
-
-
Method Details
-
getName
-
add
-
apply
public void apply() -
getColumnWidthInPixels
@Nullable protected Integer getColumnWidthInPixels(CellReference cellReference, double defaultCharWidth, Map<Double, Integer> columnWidths) -
getMergedCellWidthInPixels
-
getMergedCells
-
calculateCellWidth
protected int calculateCellWidth(int columnWidthInPixels, org.xlsx4j.sml.Cell resultCell) -
getMergedCell
-
calculateCellHeight
-
getColumnWidthInPixels
protected int getColumnWidthInPixels(double defaultCharCount) Calculates column width in pixels as a width of the string containing a provided count ofdefaultChar.- Parameters:
defaultCharCount- number ofdefaultCharthat can be displayed in column.- Returns:
- column width in pixels
-
calculateCharsCount
protected double calculateCharsCount(double sourceColumnWidth, double defaultCharWidth) -
getDefaultCharWidth
protected double getDefaultCharWidth() -
getDefaultCharsWidth
protected double getDefaultCharsWidth(int count) -
getIndentInPixels
protected int getIndentInPixels(int indent) -
isMaxHeight
-
createAttributedString
-