X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosInfoTable.java;h=aa6a6d4e5d1ff7b55693ed240cf4dff6c922101b;hb=7be98836e69a222b2f9f4baacddcf12d168e2207;hp=8ebeaba10760c1de4fd98fda5898ab65caa311f5;hpb=8f80f5705d64469bcfb00ff11aee68364edb271b;p=fw%2Faltos diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 8ebeaba1..aa6a6d4e 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -27,31 +27,34 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; 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(); }