com.sas.table
Interface TablePainterInterface


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.

See Also:
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

paintCell

void paintCell(Cell cell,
               java.awt.Graphics g,
               int x,
               int y,
               int width,
               int height)
Paints the background of the given cell. Called by Cell.paintBackground whenever the cell's effective CellStyle.background property is non-null. A call to this method overrides any normal cell background painting done by the framework.

Parameters:
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.

paintColumn

void paintColumn(Column column,
                 java.awt.Graphics g,
                 int x,
                 int y,
                 int width,
                 int height)
Paints the background of the given column. Not currently called; defined for potential future use.

Parameters:
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.

paintRow

void paintRow(Row row,
              java.awt.Graphics g,
              int x,
              int y,
              int width,
              int height)
Paints the background of the given row. Not currently called; defined for potential future use.

Parameters:
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.

paintTable

void paintTable(TableView table,
                java.awt.Graphics g,
                int x,
                int y,
                int width,
                int height)
Paints the background of the given table. Not currently called; defined for potential future use.

Parameters:
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.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.