Class TableRowHeightController


  • public class TableRowHeightController
    extends java.lang.Object
    A controller to adjust JTable rowHeight based on sizing requirements of its renderers.
    • Field Detail

      • table

        private javax.swing.JTable table
      • tableModelListener

        private javax.swing.event.TableModelListener tableModelListener
      • tablePropertyListener

        private java.beans.PropertyChangeListener tablePropertyListener
      • LOG

        private static final java.util.logging.Logger LOG
    • 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 coordinates
        lastRow - 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: