Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/main/java/com/CDPrintable/ProgramWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(() -> {
Expand All @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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");

Expand All @@ -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...");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Application version.

# MAJOR MINOR PATCH
version=1.10.7
version=1.10.8