Subversion Repositories svn.mios

Rev

Rev 303 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
213 tk 1
/*
2
 * @(#)SIDV2librarian.java  beta1   2008/01/21
3
 *
4
 * Copyright (C) 2008    Rutger Vlek (rutgervlek@hotmail.com)
5
 *
6
 * This application is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This application is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this application; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
20
package org.midibox.sidedit.gui;
21
 
22
import java.awt.BorderLayout;
23
import java.awt.GridLayout;
24
import java.util.Vector;
628 adamjking 25
 
213 tk 26
import javax.swing.BorderFactory;
27
import javax.swing.JPanel;
28
import javax.swing.JToggleButton;
628 adamjking 29
 
30
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
31
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlToggleButton;
213 tk 32
import org.midibox.utils.gui.ImageLoader;
33
import org.midibox.utils.gui.MyButtonUI;
34
 
628 adamjking 35
public class FilterGUI extends JPanel {
36
 
37
    public FilterGUI(Vector filterGUIvL, Vector filterGUIvR) {
213 tk 38
        setLayout(new BorderLayout());
39
        this.setOpaque(false);
628 adamjking 40
 
213 tk 41
        JPanel panel1 = new JPanel();
628 adamjking 42
        panel1.setLayout(new GridLayout(1, 5));
43
        panel1.add(createFilter(filterGUIvL, "Filter Left"));
44
        panel1.add(createFilter(filterGUIvR, "Filter Right"));
213 tk 45
        JPanel panel2 = new JPanel();
46
        panel2.setOpaque(false);
47
        JPanel panel3 = new JPanel();
48
        panel3.setOpaque(false);
49
        JPanel panel4 = new JPanel();
50
        panel4.setOpaque(false);
51
        panel1.add(panel2);
52
        panel1.add(panel3);
53
        panel1.add(panel4);
54
        panel1.setOpaque(false);
628 adamjking 55
        this.add(panel1, BorderLayout.NORTH);
213 tk 56
    }
628 adamjking 57
 
213 tk 58
    protected JPanel createFilter(Vector midiParameterGUI, String s) {
59
        JPanel filterPanel = new JPanel();
628 adamjking 60
        filterPanel.setLayout(new GridLayout(4, 3));
213 tk 61
        filterPanel.setBorder(BorderFactory.createEtchedBorder());
62
        filterPanel.setBorder(BorderFactory.createTitledBorder(s));
628 adamjking 63
        filterPanel.setOpaque(false);
64
 
65
        JToggleButton b1 = ((JToggleButton) ((SIDSysexParameterControlToggleButton) midiParameterGUI
66
                .elementAt(7)).getToggleButton());
67
        JToggleButton b2 = ((JToggleButton) ((SIDSysexParameterControlToggleButton) midiParameterGUI
68
                .elementAt(8)).getToggleButton());
69
        JToggleButton b3 = ((JToggleButton) ((SIDSysexParameterControlToggleButton) midiParameterGUI
70
                .elementAt(9)).getToggleButton());
71
        b1.setUI(new MyButtonUI(ImageLoader.getImageIcon("lpf_on.png"),
72
                ImageLoader.getImageIcon("lpf.png")));
73
        b2.setUI(new MyButtonUI(ImageLoader.getImageIcon("bpf_on.png"),
74
                ImageLoader.getImageIcon("bpf.png")));
75
        b3.setUI(new MyButtonUI(ImageLoader.getImageIcon("hpf_on.png"),
76
                ImageLoader.getImageIcon("hpf.png")));
77
 
78
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
79
                .elementAt(7));
80
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
81
                .elementAt(8));
82
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
83
                .elementAt(9));
84
 
85
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
86
                .elementAt(0));
87
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
88
                .elementAt(1));
89
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
90
                .elementAt(2));
91
 
92
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
93
                .elementAt(3));
94
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
95
                .elementAt(4));
96
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
97
                .elementAt(5));
98
 
99
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
100
                .elementAt(6));
101
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
102
                .elementAt(10));
103
        filterPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
104
                .elementAt(11));
105
 
213 tk 106
        return filterPanel;
107
    }
108
}