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
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<RowAutoHeightXlsxHint.CellDataObject>
protected static final int
protected static final String
protected Document
protected FontRenderContext
protected static final org.slf4j.Logger
protected static final double
Max value of the row height in Excel (in points). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.xlsx4j.sml.Cell templateCell, org.xlsx4j.sml.Cell resultCell, BandData bandData, List<String> params) void
apply()
protected double
calculateCellHeight
(StyleSheet.Font font, String cellValue, int cellWidthInPixels) protected int
calculateCellWidth
(int columnWidthInPixels, org.xlsx4j.sml.Cell resultCell) protected double
calculateCharsCount
(double sourceColumnWidth, double defaultCharWidth) protected AttributedString
createAttributedString
(StyleSheet.Font font, String value) protected int
getColumnWidthInPixels
(double defaultCharCount) Calculates column width in pixels as a width of the string containing a provided count ofdefaultChar
.protected Integer
getColumnWidthInPixels
(CellReference cellReference, double defaultCharWidth, Map<Double, Integer> columnWidths) protected double
getDefaultCharsWidth
(int count) protected double
protected int
getIndentInPixels
(int indent) protected Range
getMergedCell
(CellReference cellReference, List<Range> mergedCells) protected Integer
getMergedCellWidthInPixels
(Range range, double defaultCharWidth, Map<Double, Integer> columnWidths) getName()
protected boolean
isMaxHeight
(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 ofdefaultChar
that 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
-