From b4aba7e3fbf61b9f5d8f483c6b5d3967cd784a31 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Sun, 10 Nov 2024 21:58:17 -0500 Subject: [PATCH] code cleanup --- .../ui/advancedSearchMap/BoardTableModel.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java b/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java index 848c096e70b..60e2a872349 100644 --- a/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java +++ b/megamek/src/megamek/client/ui/advancedSearchMap/BoardTableModel.java @@ -42,7 +42,6 @@ class BoardTableModel extends AbstractTableModel { private List data; private List tags; - private List size; private List width; private List height; @@ -59,7 +58,6 @@ public int getRowCount() { public void clearData() { data = new ArrayList<>(); tags = new ArrayList<>(); - size = new ArrayList<>(); width = new ArrayList<>(); height = new ArrayList<>(); fireTableDataChanged(); @@ -81,14 +79,12 @@ public int getPreferredWidth(int col) { public void setData(BoardClassifier bc) { data = bc.getBoardPaths().values().stream().toList();; tags = new ArrayList<>(); - size = new ArrayList<>(); width = new ArrayList<>(); height = new ArrayList<>(); for (String path : data) { String key = Configuration.boardsDir() + path; tags.add(bc.getBoardTags().get(key)); - size.add(bc.getBoardWidth().get(key) + "x" + bc.getBoardHeigth().get(key)); width.add(bc.getBoardWidth().get(key)); height.add(bc.getBoardHeigth().get(key)); } @@ -121,20 +117,18 @@ public boolean isCellEditable(int row, int col) { @Override 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 "?"; } - String value = ""; if (col == COL_NAME) { value = path.substring(path.lastIndexOf("\\") + 1, path.length()); value = value.substring(0, value.lastIndexOf(".board")); - value = value.replace(size, "").trim(); + value = value.replace(width + "x" + height, "").trim(); } else if (col == COL_SIZE) { value = String.format("%03dx%03d", width, height); } @@ -150,14 +144,6 @@ public String getPathAt(int row) { return data.get(row); } - public String getSizeAt(int row) { - if (size.size() <= row) { - return null; - } - - return size.get(row); - } - public Integer getWidthAt(int row) { if (width.size() <= row) { return null;