diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-24 19:13:03 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-24 19:35:11 -0700 |
commit | cbfbaabb39f9f7709d00cf3dc63cc1bc7563062e (patch) | |
tree | 418a3ab5f1bd9db5ff476bb5d70f076d23d0d852 /altosui/AltosInfoTable.java | |
parent | 9849883a754a73b861dd7be530753ff5c2abb499 (diff) |
altosui: Make flight monitor font size configurable
Tiny netbooks aren't tall enough for the 'usual' font size, so provide
a smaller option. Then provide a bigger option, just because.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosInfoTable.java')
-rw-r--r-- | altosui/AltosInfoTable.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 8ebeaba1..c023369e 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -31,27 +31,29 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosInfoTable extends JTable { private AltosFlightInfoTableModel model; - private Font infoLabelFont = new Font("SansSerif", Font.PLAIN, 14); - private Font infoValueFont = new Font("Monospaced", Font.PLAIN, 14); - static final int info_columns = 3; static final int info_rows = 17; int desired_row_height() { - FontMetrics infoValueMetrics = getFontMetrics(infoValueFont); + FontMetrics infoValueMetrics = getFontMetrics(Altos.table_value_font); return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 18 / 10; } public AltosInfoTable() { super(new AltosFlightInfoTableModel(info_rows, info_columns)); model = (AltosFlightInfoTableModel) getModel(); - setFont(infoValueFont); + setFont(Altos.table_value_font); setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); setShowGrid(true); setRowHeight(desired_row_height()); doLayout(); } + public void set_font() { + setFont(Altos.table_value_font); + doLayout(); + } + public Dimension getPreferredScrollableViewportSize() { return getPreferredSize(); } |