Source code: entagged/gui/tageditor/listeners/TagVersionButtonListener.java
1 /*
2 * ******************************************************************** **
3 * Copyright notice **
4 * ** **
5 * (c) 2003 Entagged Developpement Team **
6 * http://www.sourceforge.net/projects/entagged **
7 * ** **
8 * All rights reserved **
9 * ** **
10 * This script is part of the Entagged project. The Entagged **
11 * project is free software; you can redistribute it and/or modify **
12 * it under the terms of the GNU General Public License as published by **
13 * the Free Software Foundation; either version 2 of the License, or **
14 * (at your option) any later version. **
15 * ** **
16 * The GNU General Public License can be found at **
17 * http://www.gnu.org/copyleft/gpl.html. **
18 * ** **
19 * This copyright notice MUST APPEAR in all copies of the file! **
20 * ********************************************************************
21 */
22 package entagged.gui.tageditor.listeners;
23 import entagged.gui.*;
24 import entagged.gui.tageditor.*;
25 import entagged.gui.tageditor.models.*;
26 import java.awt.event.*;
27 import javax.swing.*;
28
29
30 /**
31 * Listener for the button that toggles the id3v1/2 view in the table $Id:
32 * TagVersionButtonListener.java,v 1.1 2003/09/22 14:44:29 kikidonk Exp $
33 *
34 * @author Raphael Slinckx (KiKiDonK)
35 * @version v0.06
36 */
37 public class TagVersionButtonListener implements ActionListener {
38
39 /** Parent Tag Editor Frame */
40 private TagEditorFrame tagEditor;
41
42
43 /**
44 * Constructor for the TagVersionButtonListener
45 *
46 * @param tagEditor Parent Tag Editor
47 */
48 public TagVersionButtonListener( TagEditorFrame tagEditor ) {
49 this.tagEditor = tagEditor;
50 }
51
52
53 /**
54 * Invoked when an action is Performed on the button
55 *
56 * @param e the event
57 */
58 public void actionPerformed( ActionEvent e ) {
59 switch ( tagEditor.getMP3AlbumTableModel().getID3TagVersionDisplayed() ) {
60 case MP3AlbumTableModel.ID3v1Tag:
61 tagEditor.getMP3AlbumTableModel().setID3TagVersionDisplayed( MP3AlbumTableModel.ID3v2Tag );
62 tagEditor.getTagEditorToolBar().getID3TagVersionButton().setText( Entagged.langage.getProperty( "tageditortoolbar.switchtoid3v1_button" ) );
63 break;
64 case MP3AlbumTableModel.ID3v2Tag:
65 tagEditor.getMP3AlbumTableModel().setID3TagVersionDisplayed( MP3AlbumTableModel.ID3v1Tag );
66 tagEditor.getTagEditorToolBar().getID3TagVersionButton().setText( Entagged.langage.getProperty( "tageditortoolbar.switchtoid3v2_button" ) );
67 break;
68 }
69 tagEditor.getMP3AlbumTableModel().setMP3Album();
70 Entagged.guiPrefs.putInt( "tageditor.mp3albumtablemodel.id3tagversiondisplayed", tagEditor.getMP3AlbumTableModel().getID3TagVersionDisplayed() );
71 }
72 }
73