|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TablePainterInterface
Defines an interface for doing custom painting of TableView's cells, columns, and rows.
The TableView only knows how to paint solid backgrounds, so if you want backgrounds that contain patterns or images, for example, you should define an Object that implements these methods. This object can be assigned to the background property of a CellStyle.
There is a separate method for each table element so that the implementation can make decisions about what to paint. For example, if you wanted cells in even numbered rows to have red backgrounds you could implement paintCell by testing the index property of the row for the specified cell.
Usually a given implementation of this interface will only be intended to paint cells, columns, rows, or the table; not all of them. Thus, the other methods will be stubs. This is fine, as they will never be called if the object is never assigned to a context that will call them.
TableView
,
Cell
,
Column
,
Row
,
CellStyle
,
ColumnStyle
,
RowStyle
Method Summary | |
---|---|
void |
paintCell(Cell cell,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the background of the given cell. |
void |
paintColumn(Column column,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the background of the given column. |
void |
paintRow(Row row,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the background of the given row. |
void |
paintTable(TableView table,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the background of the given table. |
Method Detail |
---|
void paintCell(Cell cell, java.awt.Graphics g, int x, int y, int width, int height)
cell
- The cell being painted.g
- The graphics context to use for painting.x
- The top-left x-coordinate of the rectangle to paint.y
- The top-left y-coordinate of the rectangle to paint.width
- The width of the rectangle to paint.height
- The height of the rectangle to paint.void paintColumn(Column column, java.awt.Graphics g, int x, int y, int width, int height)
column
- The column being painted.g
- The graphics context to use for painting.x
- The top-left x-coordinate of the rectangle to paint.y
- The top-left y-coordinate of the rectangle to paint.width
- The width of the rectangle to paint.height
- The height of the rectangle to paint.void paintRow(Row row, java.awt.Graphics g, int x, int y, int width, int height)
row
- The row being painted.g
- The graphics context to use for painting.x
- The top-left x-coordinate of the rectangle to paint.y
- The top-left y-coordinate of the rectangle to paint.width
- The width of the rectangle to paint.height
- The height of the rectangle to paint.void paintTable(TableView table, java.awt.Graphics g, int x, int y, int width, int height)
table
- The table being painted.g
- The graphics context to use for painting.x
- The top-left x-coordinate of the rectangle to paint.y
- The top-left y-coordinate of the rectangle to paint.width
- The width of the rectangle to paint.height
- The height of the rectangle to paint.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |