Subversion Repositories svn.mios

Rev

Rev 213 | Rev 666 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 213 Rev 628
Line 20... Line 20...
20
20
21
package org.midibox.sidlibr.gui;
21
package org.midibox.sidlibr.gui;
22
22
23
import java.util.Observable;
23
import java.util.Observable;
24
import java.util.Observer;
24
import java.util.Observer;
-
 
25
25
import javax.swing.JPanel;
26
import javax.swing.JPanel;
26
import javax.swing.JTabbedPane;
27
import javax.swing.JTabbedPane;
-
 
28
import javax.swing.event.ChangeListener;
-
 
29
27
import org.midibox.sidlibr.SIDLibController;
30
import org.midibox.sidlibr.SIDLibController;
28
import javax.swing.event.*;
-
 
29
31
30
public class LibraryGUI extends JPanel implements ChangeListener, Observer{
32
public class LibraryGUI extends JPanel implements ChangeListener, Observer {
31
    private SIDLibController sidLibController;
33
    private SIDLibController sidLibController;
32
    private JTabbedPane tabbedPane = new JTabbedPane();
34
    private JTabbedPane tabbedPane = new JTabbedPane();
33
    private BankTable[] bankTables = new BankTable[7];
35
    private BankTable[] bankTables = new BankTable[7];
34
    //private EnsBankTable ensBankTable;
36
    // private EnsBankTable ensBankTable;
35
    private static String[] bankNames = {"A","B","C","D","E","F","G"};
37
    private static String[] bankNames = { "A", "B", "C", "D", "E", "F", "G" };
-
 
38
36
    public LibraryGUI(SIDLibController sidLibController) { 
39
    public LibraryGUI(SIDLibController sidLibController) {
37
        this.sidLibController = sidLibController;
40
        this.sidLibController = sidLibController;
38
        //ensBankTable = new EnsBankTable(sidLibController);
41
        // ensBankTable = new EnsBankTable(sidLibController);
39
        //tabbedPane.addTab("ENS", ensBankTable);   
42
        // tabbedPane.addTab("ENS", ensBankTable);
40
        for (int c = 0; c < 7; c++) {
43
        for (int c = 0; c < 7; c++) {
Line 45... Line 48...
45
        tabbedPane.addChangeListener(this);
48
        tabbedPane.addChangeListener(this);
46
    }
49
    }
47
   
50
48
    public void stateChanged(javax.swing.event.ChangeEvent e) {
51
    public void stateChanged(javax.swing.event.ChangeEvent e) {
49
        sidLibController.setCurrentBankNumber(tabbedPane.getSelectedIndex());      
52
        sidLibController.setCurrentBankNumber(tabbedPane.getSelectedIndex());
50
        int patchNumber = bankTables[tabbedPane.getSelectedIndex()].getSelectedRow();
53
        int patchNumber = bankTables[tabbedPane.getSelectedIndex()]
-
 
54
                .getSelectedRow();
51
        if (patchNumber < 0) {
55
        if (patchNumber < 0) {
52
            patchNumber = 0;
56
            patchNumber = 0;
53
        }
57
        }
54
        sidLibController.setCurrentPatchNumber(patchNumber);
58
        sidLibController.setCurrentPatchNumber(patchNumber);
55
    }
59
    }