- public AltosInfoTable() {
- box = Box.createHorizontalBox();
- model = new AltosFlightInfoTableModel[info_columns];
- table = new JTable[info_columns];
- ibox = new Box[info_columns];
- for (int i = 0; i < info_columns; i++) {
- model[i] = new AltosFlightInfoTableModel();
- table[i] = new JTable(model[i]);
- ibox[i] = box.createVerticalBox();
-
- table[i].setFont(infoValueFont);
- table[i].setRowHeight(rowHeight());
- table[i].setShowGrid(true);
- ibox[i].add(table[i].getTableHeader());
- ibox[i].add(table[i]);
- box.add(ibox[i]);
- }
- }
-
- public int rowHeight() {
- FontMetrics infoValueMetrics = table[0].getFontMetrics(infoValueFont);
- return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 20 / 10;
- }
-
- public int columnWidth() {
- FontMetrics infoValueMetrics = table[0].getFontMetrics(infoValueFont);
- return infoValueMetrics.charWidth('0') * 20 * 2;
- }
-
- public int height() {
- return rowHeight() * info_rows;
+ int desired_row_height() {
+ FontMetrics infoValueMetrics = getFontMetrics(infoValueFont);
+ return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 18 / 10;