Class ColumnWidthCalculator


  • public class ColumnWidthCalculator
    extends Object
    Calculates the column width
    • Constructor Detail

      • ColumnWidthCalculator

        public ColumnWidthCalculator()
    • Method Detail

      • calculateColumnWidths

        public static DataRow calculateColumnWidths​(ResultSet rs,
                                                    float fontSize,
                                                    boolean calculateAllRows,
                                                    boolean useLabel)
        Calculates the column widths
        Parameters:
        rs - the result set which contains representative data rows
        fontSize - the font size that is used to calculate the column width
        calculateAllRows - indicator if the perfect column width should be calculated for all rows in the result set
        useLabel - indicates if the label instead of the field name should be used
        Returns:
        returns a data row which contains the width for each column (data field)
      • calculateColumnWidths

        public static DataRow calculateColumnWidths​(ResultSet rs,
                                                    float fontSize)
        Calculates the column widths
        Parameters:
        rs - the result set which contains representative data rows
        fontSize - the font size that is used to calculate the column width
        Returns:
        returns a data row which contains the width for each column (data field)
      • calculateColumnWidths

        public static DataRow calculateColumnWidths​(ResultSet rs,
                                                    float fontSize,
                                                    boolean useLabel)
        Calculates the column widths
        Parameters:
        rs - the result set which contains representative data rows
        fontSize - the font size that is used to calculate the column width
        useLabel - indicates if the label instead of the field name should be used
        Returns:
        returns a data row which contains the width for each column (data field)
      • calculateColumnWidths

        public static DataRow calculateColumnWidths​(ResultSet rs,
                                                    String fontResourcePath,
                                                    float fontSize,
                                                    int rowsToCheck,
                                                    boolean calculateAllRows,
                                                    boolean useLabel)
        Calculates the column widths
        Parameters:
        rs - the result set which contains representative data rows
        fontResourcePath - path leading to the font resource
        fontSize - the font size that is used to calculate the column width
        rowsToCheck - the number of rows that should be used to calculate the column width
        calculateAllRows - indicator if the perfect column width should be calculated for all rows in the result set
        useLabel - indicates if the label instead of the field name should be used
        Returns:
        returns a data row which contains the width for each column (data field)