}
private class SaveButtonListener implements ActionListener {
public void actionPerformed(ActionEvent ev) {
FreedbReadResult fdbrr = ManualFreedbPanel.this.freedbResult;
if (ManualFreedbPanel.this.audioFiles.getAudioFiles().size() == 0)
return;
if (ManualFreedbPanel.this.audioFiles.getAudioFiles().size() <= fdbrr
.getTracksNumber()) {
if (!handleNonMatchingFileNumber())
return;
} else {
JOptionPane
.showMessageDialog(
ManualFreedbPanel.this.tagEditorFrame,
"The number of tracks selected is greater than the number of tracks in the freedb result !",
"Error", JOptionPane.ERROR_MESSAGE);
return;
}
tagEditorFrame.getEditorSettings().prepareAudioProcessing();
boolean warning = false;
String warningMessage = LangageManager
.getProperty("freedbpanel.errors" + "\n");
Iterator it = new ArrayList(ManualFreedbPanel.this.audioFiles
.getAudioFiles()).iterator();
int i = 0;
while (it.hasNext()) {
AudioFile f = (AudioFile) it.next();
Tag tag = f.getTag();
tag.setTitle(fdbrr.getTrackTitle(i).trim());
tag.setAlbum(ManualFreedbPanel.this.album.getText());
tag.setGenre(ManualFreedbPanel.this.genre.getTextField()
.getText());
tag.setArtist(ManualFreedbPanel.this.artist.getText());
tag.setYear(ManualFreedbPanel.this.year.getText());
tag.setComment(ManualFreedbPanel.this.comment.getText());
tag.setTrack(new DecimalFormat("00").format(fdbrr
.getTrackNumber(i)));
if (tag instanceof Id3v2Tag)
tag.setEncoding(PreferencesManager
.get("entagged.tag.encoding"));