Package org.jdesktop.swingx.table
Class TableRowHeightController
- java.lang.Object
-
- org.jdesktop.swingx.table.TableRowHeightController
-
public class TableRowHeightController extends java.lang.Object
A controller to adjust JTable rowHeight based on sizing requirements of its renderers.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOG
private javax.swing.JTable
table
private javax.swing.event.TableModelListener
tableModelListener
private java.beans.PropertyChangeListener
tablePropertyListener
-
Constructor Summary
Constructors Constructor Description TableRowHeightController()
Instantiates an unbound TableRowHeightController.TableRowHeightController(javax.swing.JTable table)
Instantiates a TableRowHeightController and installs itself to the given table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.event.TableModelListener
createTableModelListener()
protected java.beans.PropertyChangeListener
createTablePropertyListener()
protected java.beans.PropertyChangeListener
getPropertyChangeListener()
protected javax.swing.event.TableModelListener
getTableModelListener()
void
install(javax.swing.JTable table)
Installs this controller on the given table.private void
installListeners()
void
release()
Release this controller from its table.private void
uninstallListeners()
protected void
updateModel(javax.swing.table.TableModel oldValue)
protected void
updatePreferredRowHeights()
Sets the row heights of all rows.protected void
updatePreferredRowHeights(int firstRow, int lastRow)
Sets the row heights of the rows in the range of first- to lastRow, inclusive.
-
-
-
Constructor Detail
-
TableRowHeightController
public TableRowHeightController()
Instantiates an unbound TableRowHeightController.
-
TableRowHeightController
public TableRowHeightController(javax.swing.JTable table)
Instantiates a TableRowHeightController and installs itself to the given table. The row heights of all visible rows are automatically adjusted on model changes.- Parameters:
table
- the table to control.
-
-
Method Detail
-
install
public void install(javax.swing.JTable table)
Installs this controller on the given table. Releases control from previously installed table, if any.- Parameters:
table
- the table to install upon.
-
release
public void release()
Release this controller from its table. Does nothing if no table installed.
-
updatePreferredRowHeights
protected void updatePreferredRowHeights(int firstRow, int lastRow)
Sets the row heights of the rows in the range of first- to lastRow, inclusive. The coordinates are model indices.- Parameters:
firstRow
- the first row in model coordinateslastRow
- the last row in model coordinates
-
updatePreferredRowHeights
protected void updatePreferredRowHeights()
Sets the row heights of all rows.
-
updateModel
protected void updateModel(javax.swing.table.TableModel oldValue)
- Parameters:
oldValue
-
-
createTablePropertyListener
protected java.beans.PropertyChangeListener createTablePropertyListener()
- Returns:
-
createTableModelListener
protected javax.swing.event.TableModelListener createTableModelListener()
-
uninstallListeners
private void uninstallListeners()
-
installListeners
private void installListeners()
-
getTableModelListener
protected javax.swing.event.TableModelListener getTableModelListener()
- Returns:
-
getPropertyChangeListener
protected java.beans.PropertyChangeListener getPropertyChangeListener()
- Returns:
-
-