Subversion Repositories svn.mios

Rev

Rev 213 | 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
 
21
package org.midibox.sidedit.gui.lead;
22
 
23
import java.awt.BorderLayout;
24
import java.awt.GridLayout;
25
import java.util.Vector;
628 adamjking 26
 
213 tk 27
import javax.swing.BorderFactory;
28
import javax.swing.BoxLayout;
29
import javax.swing.JPanel;
30
 
628 adamjking 31
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
32
 
33
public class ModulationGUI extends JPanel {
213 tk 34
    protected ModulationGUI(Vector modGUIv) {
35
        setLayout(new BorderLayout());
36
        this.setOpaque(false);
628 adamjking 37
 
213 tk 38
        JPanel panel1 = new JPanel();
628 adamjking 39
        panel1.setLayout(new GridLayout(1, 8));
40
        panel1.add(createMod(modGUIv, "Modulation path 1", 0));
41
        panel1.add(createMod(modGUIv, "Modulation path 2", 24));
42
        panel1.add(createMod(modGUIv, "Modulation path 3", 48));
43
        panel1.add(createMod(modGUIv, "Modulation path 4", 72));
44
        panel1.add(createMod(modGUIv, "Modulation path 5", 96));
45
        panel1.add(createMod(modGUIv, "Modulation path 6", 120));
46
        panel1.add(createMod(modGUIv, "Modulation path 7", 144));
47
        panel1.add(createMod(modGUIv, "Modulation path 8", 168));
48
 
213 tk 49
        panel1.setOpaque(false);
628 adamjking 50
        this.add(panel1, BorderLayout.NORTH);
213 tk 51
    }
628 adamjking 52
 
213 tk 53
    protected JPanel createMod(Vector midiParameterGUI, String s, int offset) {
54
        JPanel topPanel = new JPanel();
55
        topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS));
56
        topPanel.setBorder(BorderFactory.createEtchedBorder());
57
        topPanel.setBorder(BorderFactory.createTitledBorder(s));
58
        topPanel.setOpaque(false);
628 adamjking 59
 
213 tk 60
        JPanel modPanel = new JPanel();
61
        modPanel.setLayout(new BoxLayout(modPanel, BoxLayout.Y_AXIS));
628 adamjking 62
        modPanel.setOpaque(false);
63
 
64
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
65
                .elementAt(0 + offset));
66
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
67
                .elementAt(1 + offset));
68
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
69
                .elementAt(2 + offset));
70
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
71
                .elementAt(6 + offset));
72
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
73
                .elementAt(7 + offset));
74
        modPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
75
                .elementAt(5 + offset));
76
 
213 tk 77
        JPanel sub1Panel = new JPanel();
628 adamjking 78
        sub1Panel.setLayout(new GridLayout(1, 2));
213 tk 79
        sub1Panel.setOpaque(false);
628 adamjking 80
        sub1Panel.add((SIDSysexParameterControlGUI) midiParameterGUI
81
                .elementAt(3 + offset));
82
        sub1Panel.add((SIDSysexParameterControlGUI) midiParameterGUI
83
                .elementAt(4 + offset));
84
 
213 tk 85
        JPanel subPanel = new JPanel();
628 adamjking 86
        subPanel.setLayout(new GridLayout(8, 2));
213 tk 87
        subPanel.setBorder(BorderFactory.createEtchedBorder());
628 adamjking 88
        subPanel.setBorder(BorderFactory
89
                .createTitledBorder("Direct assign to:"));
213 tk 90
        subPanel.setOpaque(false);
628 adamjking 91
 
213 tk 92
        for (int c = 8; c < 16; c++) {
628 adamjking 93
            subPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
94
                    .elementAt(c + offset));
95
            subPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
96
                    .elementAt(c + offset + 8));
213 tk 97
        }
628 adamjking 98
 
213 tk 99
        topPanel.add(modPanel);
100
        topPanel.add(sub1Panel);
101
        topPanel.add(subPanel);
102
        return topPanel;
103
    }
104
}