Interface TableCellRenderer<V>

  • Type Parameters:
    V - Type of data in the table cells
    All Known Implementing Classes:
    DefaultTableCellRenderer

    public interface TableCellRenderer<V>
    The main interface to implement when you need to customize the way table cells are drawn
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void drawCell​(Table<V> table, V cell, int columnIndex, int rowIndex, TextGUIGraphics textGUIGraphics)
      Called by the table when it's time to draw a cell, you can see how much size is available by checking the size of the textGUIGraphics.
      TerminalSize getPreferredSize​(Table<V> table, V cell, int columnIndex, int rowIndex)
      Called by the table when it wants to know how big a particular table cell should be
    • Method Detail

      • getPreferredSize

        TerminalSize getPreferredSize​(Table<V> table,
                                      V cell,
                                      int columnIndex,
                                      int rowIndex)
        Called by the table when it wants to know how big a particular table cell should be
        Parameters:
        table - Table containing the cell
        cell - Data stored in the cell
        columnIndex - Column index of the cell
        rowIndex - Row index of the cell
        Returns:
        Size this renderer would like the cell to have
      • drawCell

        void drawCell​(Table<V> table,
                      V cell,
                      int columnIndex,
                      int rowIndex,
                      TextGUIGraphics textGUIGraphics)
        Called by the table when it's time to draw a cell, you can see how much size is available by checking the size of the textGUIGraphics. The top-left position of the graphics object is the top-left position of this cell.
        Parameters:
        table - Table containing the cell
        cell - Data stored in the cell
        columnIndex - Column index of the cell
        rowIndex - Row index of the cell
        textGUIGraphics - Graphics object to draw with