diff options
| author | Keith Packard <keithp@keithp.com> | 2014-05-29 14:03:58 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-05-29 14:03:58 -0700 |
| commit | f80075be4ebb9c5fe00c24b8c7638fad23267424 (patch) | |
| tree | a8badb211c002391b881109a9b7c0992e3099eaf /altosui/AltosCompanionInfo.java | |
| parent | 71715337eb532a1fbe1a753240e7417d5223489f (diff) | |
java: Refactor AltosFlightDisplay units and font update handling
Make AltosFlightDisplay explicitly implement AltosFontListener and
AltosUnitsListener interfaces to make everyone use the same API. Then,
actually go implement units listeners so that changing units updates
all of the active displays immediately
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosCompanionInfo.java')
| -rw-r--r-- | altosui/AltosCompanionInfo.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index f8d033a8..514ce611 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -33,18 +33,21 @@ public class AltosCompanionInfo extends JTable implements AltosFlightDisplay { return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 18 / 10; } - public void set_font() { + public void font_size_changed(int font_size) { setFont(Altos.table_value_font); setRowHeight(desired_row_height()); doLayout(); } + public void units_changed(boolean imperial_units) { + } + public AltosCompanionInfo() { super(new AltosFlightInfoTableModel(info_rows, info_columns)); model = (AltosFlightInfoTableModel) getModel(); setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); setShowGrid(true); - set_font(); + font_size_changed(AltosUIPreferences.font_size()); } public Dimension getPreferredScrollableViewportSize() { |
