V
- Type of data stored in each table cellTableCellRenderer<V>
public class DefaultTableCellRenderer<V> extends Object implements TableCellRenderer<V>
TableCellRenderer
Constructor | Description |
---|---|
DefaultTableCellRenderer() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
afterRender(Table<V> table,
V cell,
int columnIndex,
int rowIndex,
boolean isSelected,
TextGUIGraphics textGUIGraphics) |
Called by the cell renderer after the cell content has been drawn into the assigned area.
|
protected void |
applyStyle(Table<V> table,
V cell,
int columnIndex,
int rowIndex,
boolean isSelected,
TextGUIGraphics textGUIGraphics) |
Called by the cell renderer to setup all the styling (colors and SGRs) before rendering the cell.
|
protected void |
beforeRender(Table<V> table,
V cell,
int columnIndex,
int rowIndex,
boolean isSelected,
TextGUIGraphics textGUIGraphics) |
Called by the cell renderer to prepare the cell area before rendering the cell.
|
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 . |
protected String[] |
getContent(V cell) |
Turns a cell into a multiline string, as an array.
|
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
|
protected void |
render(Table<V> table,
V cell,
int columnIndex,
int rowIndex,
boolean isSelected,
TextGUIGraphics textGUIGraphics) |
Called by the cell renderer to draw the content of the cell into the assigned area.
|
public TerminalSize getPreferredSize(Table<V> table, V cell, int columnIndex, int rowIndex)
TableCellRenderer
getPreferredSize
in interface TableCellRenderer<V>
table
- Table containing the cellcell
- Data stored in the cellcolumnIndex
- Column index of the cellrowIndex
- Row index of the cellpublic void drawCell(Table<V> table, V cell, int columnIndex, int rowIndex, TextGUIGraphics textGUIGraphics)
TableCellRenderer
textGUIGraphics
. The top-left position of the graphics object is the top-left position of this cell.drawCell
in interface TableCellRenderer<V>
table
- Table containing the cellcell
- Data stored in the cellcolumnIndex
- Column index of the cellrowIndex
- Row index of the celltextGUIGraphics
- Graphics object to draw withprotected void applyStyle(Table<V> table, V cell, int columnIndex, int rowIndex, boolean isSelected, TextGUIGraphics textGUIGraphics)
DefaultTableCellRenderer
. Unless
drawCell(Table, Object, int, int, TextGUIGraphics)
it overridden, it will be
called when the cell is rendered.table
- Table the cell belongs tocell
- Cell being renderedcolumnIndex
- Column index of the cell being renderedrowIndex
- Row index of the cell being renderedisSelected
- Set to true
if the cell is currently selected by the usertextGUIGraphics
- TextGUIGraphics
object to set the style on, this will be used in the rendering laterprotected void beforeRender(Table<V> table, V cell, int columnIndex, int rowIndex, boolean isSelected, TextGUIGraphics textGUIGraphics)
DefaultTableCellRenderer
. Unless
drawCell(Table, Object, int, int, TextGUIGraphics)
it overridden, it will be
called when the cell is rendered, after setting up the styling but before the cell content text is drawn.table
- Table the cell belongs tocell
- Cell being renderedcolumnIndex
- Column index of the cell being renderedrowIndex
- Row index of the cell being renderedisSelected
- Set to true
if the cell is currently selected by the usertextGUIGraphics
- TextGUIGraphics
object for the cell, already having been prepared with stylingprotected void render(Table<V> table, V cell, int columnIndex, int rowIndex, boolean isSelected, TextGUIGraphics textGUIGraphics)
DefaultTableCellRenderer
. Unless
drawCell(Table, Object, int, int, TextGUIGraphics)
it overridden, it will be
called when the cell is rendered, after setting up the styling and preparing the cell.table
- Table the cell belongs tocell
- Cell being renderedcolumnIndex
- Column index of the cell being renderedrowIndex
- Row index of the cell being renderedisSelected
- Set to true
if the cell is currently selected by the usertextGUIGraphics
- TextGUIGraphics
object for the cell, already having been prepared with stylingprotected void afterRender(Table<V> table, V cell, int columnIndex, int rowIndex, boolean isSelected, TextGUIGraphics textGUIGraphics)
DefaultTableCellRenderer
. Unless
drawCell(Table, Object, int, int, TextGUIGraphics)
it overridden, it will be
called after the cell has been rendered but before the table moves on to the next cell.table
- Table the cell belongs tocell
- Cell being renderedcolumnIndex
- Column index of the cell being renderedrowIndex
- Row index of the cell being renderedisSelected
- Set to true
if the cell is currently selected by the usertextGUIGraphics
- TextGUIGraphics
object for the cell, already having been prepared with stylingCopyright © 2020. All rights reserved.