From 6ae36ff42ce0813f38c7c12e9f556987e34742a2 Mon Sep 17 00:00:00 2001 From: Alexander McLean Date: Fri, 18 Apr 2025 10:17:26 -0400 Subject: [PATCH] fixed blue highlighting, updated version --- .../java/com/CDPrintable/ProgramWindow.java | 19 +++++++++---------- src/main/resources/version.properties | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/CDPrintable/ProgramWindow.java b/src/main/java/com/CDPrintable/ProgramWindow.java index e53f5e9..95e558f 100644 --- a/src/main/java/com/CDPrintable/ProgramWindow.java +++ b/src/main/java/com/CDPrintable/ProgramWindow.java @@ -129,7 +129,7 @@ public void mouseClicked(MouseEvent e) { selectedItem = ""; } - setSearchStatus("Preforming search...", "blue"); + setSearchStatus("Performing search...", "blue"); clearIdList(); String finalSelectedItem = selectedItem; Constants.THREAD_MANAGER.submit(() -> { @@ -138,7 +138,6 @@ public void mouseClicked(MouseEvent e) { switch (finalSelectedItem) { case "CDStub" -> { columnsToHighlight = new int[]{0, 1}; - // Get CDStubs and set the table model MusicBrainzCDStub[] cdStubs = reader.getCDStubs(); for (MusicBrainzCDStub cdStub : cdStubs) { addId(cdStub.getId()); @@ -147,7 +146,6 @@ public void mouseClicked(MouseEvent e) { searchTable.setModel(reader.getCDStubsAsTableModel(cdStubs)); } case "Artist" -> { - // Get Artists and set the table model MusicBrainzArtist[] artists = reader.getArtists(); for (MusicBrainzArtist artist : artists) { addId(artist.getId()); @@ -157,7 +155,6 @@ public void mouseClicked(MouseEvent e) { } case "Release" -> { columnsToHighlight = new int[]{0, 1}; - // Get Releases and set the table model MusicBrainzRelease[] releases = reader.getReleases(); for (MusicBrainzRelease release : releases) { addId(release.getId()); @@ -167,13 +164,15 @@ public void mouseClicked(MouseEvent e) { } default -> JOptionPane.showMessageDialog(panel, "Please select a search type."); } + + // Reapply the custom renderer after setting the new model if (columnsToHighlight != null) { for (int column : columnsToHighlight) { searchTable.getColumnModel().getColumn(column).setCellRenderer(new LightBlueColumnRenderer()); } } + resizeColumnWidths(searchTable); }); - resizeColumnWidths(searchTable); }); cdSearchPanel.setLayout(new FlowLayout()); @@ -343,7 +342,7 @@ public void changedUpdate(DocumentEvent e) {} // Not used userAgentPanel.add(fullAgentPanel, BorderLayout.NORTH); userAgentPanel.add(userAgentInputPanel, BorderLayout.CENTER); - // Add sub-panels to the main panel + // Add subpanels to the main panel panel.add(userAgentPanel); panel.add(fontPanel); @@ -455,13 +454,13 @@ private void createTrackDialog(String title, String artist, int trackCount, Stri panel.add(new JLabel("Date: " + date)); } - // Add label panel to main panel + // Add the label panel to the main panel mainPanel.add(panel, BorderLayout.NORTH); - // Add table to main panel + // Add table to the main panel JTable trackTable = new JTable(model); JScrollPane trackScrollPane = new JScrollPane(trackTable); mainPanel.add(trackScrollPane, BorderLayout.CENTER); - // Add bottom (question) label to main panel + // Add bottom (question) label to the main panel mainPanel.add(new JLabel("Would you like to add this record to your CD label?"), BorderLayout.SOUTH); setSearchStatus("All done!", "green"); @@ -470,7 +469,7 @@ private void createTrackDialog(String title, String artist, int trackCount, Stri if (result == JOptionPane.YES_OPTION) { System.out.println("ask her out"); } else if (result == JOptionPane.NO_OPTION) { - System.out.println("get rejected idiot"); + System.out.println("she rejected you..."); } } diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index ff29577..e10740d 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -1,4 +1,4 @@ # Application version. # MAJOR MINOR PATCH -version=1.10.7 \ No newline at end of file +version=1.10.8 \ No newline at end of file