X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosInfoTable.java;h=c023369e55c3678bd0fad2fe00ab3864f092387b;hb=aad03e3cab4c328e53d3df47b6dac1d3f7a49229;hp=8ebeaba10760c1de4fd98fda5898ab65caa311f5;hpb=8f80f5705d64469bcfb00ff11aee68364edb271b;p=fw%2Faltos 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(); }