java.lang.Object
org.autogui.swing.util.TableRowHeightFitter
customizing table-rows based on their minimum-size.
var f = new TableRowHeightFitter(table);
f.addListenersToTable();
for customizing table-column width, you will need to call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChangeWidthListener(TableColumn column) voiddebugInfo(int row, int[] oldHeights, int[] newHeights) voiddispose()voidfit(Collection<TableColumn> targetColumns) voidfit(Collection<TableColumn> targetColumns, IntPredicate rowUpdate) voidfitAll()re-calculate heights of all rowsvoidstart fitting by events of columns only ifisEnabled()intfitCell(int viewRow, TableColumn column) intfitCellWithMargin(int viewRow, TableColumn column) voidfitRow(int viewRow, int row, Collection<TableColumn> targetColumns) creates a dummy graphics.booleanbooleanprotected voidvoidvoidvoidscheduleFitColumn(TableColumn column) voidsetEnabled(boolean enabled) protected List<TableColumn> protected voidupdate cell heights cache if needed
-
Field Details
-
table
-
cellHeights
protected int[][] cellHeights -
tester
-
enabled
protected boolean enabled -
DEBUG
public static boolean DEBUG -
columnEventHandler
-
-
Constructor Details
-
TableRowHeightFitter
-
-
Method Details
-
addListenersToTable
public void addListenersToTable() -
addListenerToTableModel
-
scheduleFitByEvent
-
addListenerToTableColumnModel
-
getColumnEventHandler
-
addChangeWidthListener
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
isTableColumnWidthChangeListenerFromThis
-
scheduleFitColumn
-
scheduleFitAll
public void scheduleFitAll() -
getGraphics
creates a dummy graphics. it can be released bydispose()- Returns:
- the created graphics
-
dispose
public void dispose() -
fitByEvent
start fitting by events of columns only ifisEnabled()- Parameters:
columns- collecting events : if it has aTableRowHeightFitter.RowHeightUpdate.isAllColumns()=true event, all others are ignored and dofitAll()
-
fitAll
public void fitAll()re-calculate heights of all rows -
tableAllColumns
-
updateCellHeightsBySizeChange
protected void updateCellHeightsBySizeChange()update cell heights cache if needed -
fit
-
fit
-
log
-
fitRow
-
debugInfo
-
fitCellWithMargin
-
fitCell
-