From cf84c9683e07094300849494b1d9279be77f9b96 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Sun, 10 Nov 2024 21:47:58 -0500 Subject: [PATCH] 0 pad size to improve sort, add tooltips for range textfields --- .../client/ui/advancedSearchMap/AdvancedSearchMapDialog.java | 3 +++ .../megamek/client/ui/advancedSearchMap/BoardTableModel.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/client/ui/advancedSearchMap/AdvancedSearchMapDialog.java b/megamek/src/megamek/client/ui/advancedSearchMap/AdvancedSearchMapDialog.java index d7ef8ea3650..9a8d0c209f3 100644 --- a/megamek/src/megamek/client/ui/advancedSearchMap/AdvancedSearchMapDialog.java +++ b/megamek/src/megamek/client/ui/advancedSearchMap/AdvancedSearchMapDialog.java @@ -167,6 +167,7 @@ private JPanel createFilterRange(JTextField startTextField, JTextField endTextFi textBox.add(new JLabel(caption)); textBox.add(Box.createRigidArea( new Dimension(5, 0))); + startTextField.setToolTipText("start range, blank acts as wildcard"); startTextField.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { @@ -186,6 +187,8 @@ public void changedUpdate(DocumentEvent e) { textBox.add(startTextField); textBox.add(new JLabel(" - ")); + + endTextField.setToolTipText("end range, blank acts as wildcard"); endTextField.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { diff --git a/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java b/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java index c6ff31ce7aa..848c096e70b 100644 --- a/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java +++ b/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java @@ -122,6 +122,8 @@ public boolean isCellEditable(int row, int col) { public Object getValueAt(int row, int col) { String path = getPathAt(row); String size = getSizeAt(row); + Integer width = getWidthAt(row); + Integer height = getHeightAt(row); if (path== null) { return "?"; @@ -134,7 +136,7 @@ public Object getValueAt(int row, int col) { value = value.substring(0, value.lastIndexOf(".board")); value = value.replace(size, "").trim(); } else if (col == COL_SIZE) { - value = size; + value = String.format("%03dx%03d", width, height); } return value;