Subversion Repositories svn.mios

Rev

Rev 213 | Go to most recent revision | 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.GridBagConstraints;
25
import java.awt.GridBagLayout;
26
import java.awt.GridLayout;
27
import java.util.Vector;
28
 
29
import javax.swing.BorderFactory;
30
import javax.swing.BoxLayout;
31
import javax.swing.JPanel;
32
 
628 adamjking 33
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
213 tk 34
 
628 adamjking 35
public class ArpGUI extends JPanel {
36
    protected ArpGUI(Vector V1GUIv, Vector V2GUIv, Vector V3GUIv,
37
            Vector V4GUIv, Vector V5GUIv, Vector V6GUIv) {
213 tk 38
        setLayout(new BorderLayout());
39
        this.setOpaque(false);
628 adamjking 40
 
213 tk 41
        JPanel panel1 = new JPanel();
42
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
43
        panel1.setOpaque(false);
628 adamjking 44
 
213 tk 45
        JPanel panel2 = new JPanel();
46
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
47
        panel2.setOpaque(false);
628 adamjking 48
 
49
        panel2.add(createArp(V1GUIv, "ARP (voice1 - L)"));
50
        panel2.add(createArp(V2GUIv, "ARP (voice2 - L)"));
51
        panel2.add(createArp(V3GUIv, "ARP (voice3 - L)"));
52
 
213 tk 53
        JPanel panel3 = new JPanel();
54
        panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
55
        panel3.setOpaque(false);
628 adamjking 56
 
57
        panel3.add(createArp(V4GUIv, "ARP (voice4 - R)"));
58
        panel3.add(createArp(V5GUIv, "ARP (voice5 - R)"));
59
        panel3.add(createArp(V6GUIv, "ARP (voice6 - R)"));
60
 
213 tk 61
        panel1.add(panel2);
628 adamjking 62
        panel1.add(panel3);
63
 
64
        this.add(panel1, BorderLayout.NORTH);
213 tk 65
    }
66
 
67
    protected JPanel createArp(Vector vGUI, String s) {
68
        JPanel arpPanel = new JPanel();
69
        arpPanel.setLayout(new BoxLayout(arpPanel, BoxLayout.X_AXIS));
70
        arpPanel.setBorder(BorderFactory.createEtchedBorder());
71
        arpPanel.setBorder(BorderFactory.createTitledBorder(s));
72
        arpPanel.setOpaque(false);
628 adamjking 73
 
213 tk 74
        JPanel subPanel1 = new JPanel(new GridBagLayout());
75
        subPanel1.setOpaque(false);
628 adamjking 76
        GridBagConstraints c = new GridBagConstraints();
213 tk 77
        c.fill = GridBagConstraints.HORIZONTAL;
78
        c.ipadx = 10;
79
        // First row
628 adamjking 80
        c.gridx = 0;
81
        c.gridy = 0;
82
        c.gridwidth = 1;
213 tk 83
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(14), c);
628 adamjking 84
        c.gridx = 1;
85
        c.gridy = 0;
86
        c.gridwidth = 2;
213 tk 87
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(15), c);
628 adamjking 88
 
213 tk 89
        // Second row
628 adamjking 90
        c.gridx = 0;
91
        c.gridy = 1;
92
        c.gridwidth = 1;
213 tk 93
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(20), c);
628 adamjking 94
        c.gridx = 1;
95
        c.gridy = 1;
96
        c.gridwidth = 1;
213 tk 97
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(23), c);
628 adamjking 98
        c.gridx = 2;
99
        c.gridy = 1;
100
        c.gridwidth = 1;
213 tk 101
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(22), c);
628 adamjking 102
 
213 tk 103
        JPanel subPanel2 = new JPanel();
628 adamjking 104
        subPanel2.setLayout(new GridLayout(2, 3));
213 tk 105
        subPanel2.setOpaque(false);
628 adamjking 106
 
213 tk 107
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(16));
108
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(17));
109
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(18));
110
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(21));
111
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(19));
112
        arpPanel.add(subPanel1);
113
        arpPanel.add(subPanel2);
628 adamjking 114
 
213 tk 115
        return arpPanel;
628 adamjking 116
    }
213 tk 117
}