public void requestFocus() { }
public void draw(Toolkit toolkit) {
/* Get the absolute origin of this component.
*/
Point origin = getLocationOnScreen();
int columns = _model.getColumnCount();
int colorpair = getCursesColor();
/* Start by blanking out the table area and drawing the box
* around the table.
*/
toolkit.blankBox(origin, getSize(), colorpair);
toolkit.drawBox(origin, getSize(), colorpair);
/* Now fill in the table headings
*/
int x = 1;
int attr = Toolkit.A_BOLD;
for (int i=0; i<columns; i++) {
toolkit.setCursor(origin.addOffset(x, 0));
toolkit.addChar(' ', attr, colorpair);
toolkit.addString(_model.getColumnName(i), attr, colorpair);
toolkit.addChar(' ', attr, colorpair);
x += getColumnWidth(i) + 1;
}
/* Now draw the vertical lines that divide the columns.
*/
x = getColumnWidth(0) + 1;
for (int i=0; i<columns-1; i++) {
toolkit.setCursor(origin.addOffset(x, 0));
toolkit.addChar(Toolkit.ACS_TTEE, 0, colorpair); // top tee
x += getColumnWidth(i+1) + 1;
}
}