public class CWC_LongestLine extends Object implements AT_ColumnWidthCalculator
Calculates the width of table columns using the longest line in a column.
Note: this can produce strange results, especially when cell content implements render interfaces or very long lines are found. In those cases use minimum and maximum column length.
| Constructor and Description |
|---|
CWC_LongestLine() |
| Modifier and Type | Method and Description |
|---|---|
CWC_LongestLine |
add(int minWidth,
int maxWidth)
Creates a new width object.
|
int[] |
calculateColumnWidths(LinkedList<AT_Row> rows,
int colNumbers,
int tableWidth)
Returns the width of each column in an array, column one being [0] and so on.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateColumnWidthspublic CWC_LongestLine add(int minWidth, int maxWidth)
Creates a new width object.
minWidth - minimum column width as number of charactersmaxWidth - maximum column width as number of characterspublic int[] calculateColumnWidths(LinkedList<AT_Row> rows, int colNumbers, int tableWidth)
AT_ColumnWidthCalculatorReturns the width of each column in an array, column one being [0] and so on.
calculateColumnWidths in interface AT_ColumnWidthCalculatorrows - the table rows with rules and contentcolNumbers - number of columns in the tabletableWidth - required overall table widthCopyright © 2014–2017. All rights reserved.