V
- Type of data stored in each table cellpublic class DefaultTableRenderer<V> extends Object implements TableRenderer<V>
TableRenderer
Constructor and Description |
---|
DefaultTableRenderer()
Default constructor
|
Modifier and Type | Method and 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? Notice that this is the
responsibility of the renderer and not the component itself, since the component has no idea what its visual
representation looks like.
|
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 |
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 TerminalSize getPreferredSize(Table<V> table)
ComponentRenderer
getPreferredSize
in interface ComponentRenderer<Table<V>>
getPreferredSize
in interface TableRenderer<V>
table
- Component to calculate the preferred size ofpublic TerminalPosition getCursorLocation(Table<V> component)
getCursorLocation
in interface InteractableRenderer<Table<V>>
public void drawComponent(TextGUIGraphics graphics, Table<V> table)
ComponentRenderer
drawComponent
in interface ComponentRenderer<Table<V>>
drawComponent
in interface TableRenderer<V>
graphics
- Graphics object to use for drawingtable
- Component to drawCopyright © 2016. All rights reserved.