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 class
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChangeWidthListener
(TableColumn column) void
debugInfo
(int row, int[] oldHeights, int[] newHeights) void
dispose()
void
fit
(Collection<TableColumn> targetColumns) void
fit
(Collection<TableColumn> targetColumns, IntPredicate rowUpdate) void
fitAll()
re-calculate heights of all rowsvoid
start fitting by events of columns only ifisEnabled()
int
fitCell
(int viewRow, TableColumn column) int
fitCellWithMargin
(int viewRow, TableColumn column) void
fitRow
(int viewRow, int row, Collection<TableColumn> targetColumns) creates a dummy graphics.boolean
boolean
protected void
void
void
void
scheduleFitColumn
(TableColumn column) void
setEnabled
(boolean enabled) protected List
<TableColumn> protected void
update 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
-