X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosCompanionInfo.java;h=ebe1d1f9826612cf004d23d224010da50d515aef;hb=04d7d0f829ba953ffeca8ad9887a4b6b2b5d5087;hp=f287a8ea3348cb375b39d1595018c23467e446b9;hpb=c7f540330c040c521f9d7626009a406e704a5e41;p=fw%2Faltos diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index f287a8ea..ebe1d1f9 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -18,38 +18,32 @@ package altosui; import java.awt.*; -import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; -import java.io.*; -import java.util.*; -import java.text.*; -import java.util.prefs.*; -import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.altoslib_1.*; public class AltosCompanionInfo 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 = 2; 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 void set_font() { + setFont(Altos.table_value_font); + setRowHeight(desired_row_height()); + doLayout(); + } + public AltosCompanionInfo() { super(new AltosFlightInfoTableModel(info_rows, info_columns)); model = (AltosFlightInfoTableModel) getModel(); - setFont(infoValueFont); setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); setShowGrid(true); - setRowHeight(desired_row_height()); - doLayout(); + set_font(); } public Dimension getPreferredScrollableViewportSize() { @@ -89,7 +83,7 @@ public class AltosCompanionInfo extends JTable { } } - public void show(AltosState state, int crc_errors) { + public void show(AltosState state, AltosListenerState listener_state) { if (state == null) return; if (state.data.companion != null)