V
- Type of data stored in each table cellComponentRenderer<V>
, InteractableRenderer<V>
, TableRenderer<V>
public class DefaultTableRenderer<V> extends Object implements TableRenderer<V>
TableRenderer
Constructor | Description |
---|---|
DefaultTableRenderer() |
Default constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
drawComponent(TextGUIGraphics graphics,
Table<V> table) |
Using the supplied graphics object, draws the component passed in.
|
TerminalPosition |
getCursorLocation(Table<V> component) |
|
TerminalSize |
getPreferredSize(Table<V> table) |
Given the supplied component, how large does this renderer want the component to be?
|
void |
setCellHorizontalBorderStyle(TableCellBorderStyle cellHorizontalBorderStyle) |
Sets the style to be used when horizontally separating table cells from each other.
|
void |
setCellVerticalBorderStyle(TableCellBorderStyle cellVerticalBorderStyle) |
Sets the style to be used when vertically separating table cells from each other.
|
void |
setExpandableColumns(Collection<Integer> expandableColumns) |
Sets the list of columns (by index, where 0 is the first column) that can be expanded, should the drawable area
be larger than the table is requesting.
|
void |
setHeaderHorizontalBorderStyle(TableCellBorderStyle headerHorizontalBorderStyle) |
Sets the style to be used when separating the table header labels from each other.
|
void |
setHeaderVerticalBorderStyle(TableCellBorderStyle headerVerticalBorderStyle) |
Sets the style to be used when separating the table header row from the actual "data" cells below.
|
public void setHeaderVerticalBorderStyle(TableCellBorderStyle headerVerticalBorderStyle)
TableCellBorderStyle.None
.headerVerticalBorderStyle
- Style to use to separate Table header from bodypublic void setHeaderHorizontalBorderStyle(TableCellBorderStyle headerHorizontalBorderStyle)
TableCellBorderStyle.None
.headerHorizontalBorderStyle
- Style to use when separating header columns horizontallypublic void setCellVerticalBorderStyle(TableCellBorderStyle cellVerticalBorderStyle)
TableCellBorderStyle.None
.cellVerticalBorderStyle
- Style to use to separate table cells verticallypublic void setCellHorizontalBorderStyle(TableCellBorderStyle cellHorizontalBorderStyle)
TableCellBorderStyle.None
.cellHorizontalBorderStyle
- Style to use to separate table cells horizontallypublic void setExpandableColumns(Collection<Integer> expandableColumns)
expandableColumns
- Collection of indexes for expandable columnspublic TerminalSize getPreferredSize(Table<V> table)
ComponentRenderer
getPreferredSize
in interface ComponentRenderer<V>
getPreferredSize
in interface TableRenderer<V>
table
- Component to calculate the preferred size ofpublic TerminalPosition getCursorLocation(Table<V> component)
getCursorLocation
in interface InteractableRenderer<V>
public void drawComponent(TextGUIGraphics graphics, Table<V> table)
ComponentRenderer
drawComponent
in interface ComponentRenderer<V>
drawComponent
in interface TableRenderer<V>
graphics
- Graphics object to use for drawingtable
- Component to drawCopyright © 2020. All rights reserved.