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.bassline;
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 {
213 tk 36
    protected ArpGUI(Vector V1GUIv, Vector V2GUIv) {
37
        setLayout(new BorderLayout());
38
        this.setOpaque(false);
628 adamjking 39
 
213 tk 40
        JPanel panel1 = new JPanel();
41
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
42
        panel1.setOpaque(false);
628 adamjking 43
 
213 tk 44
        JPanel panel2 = new JPanel();
45
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
46
        panel2.setOpaque(false);
628 adamjking 47
 
48
        panel2.add(createArp(V1GUIv, "ARP (voice1 - L)"));
49
 
213 tk 50
        JPanel panel3 = new JPanel();
51
        panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
52
        panel3.setOpaque(false);
628 adamjking 53
 
54
        panel3.add(createArp(V2GUIv, "ARP (voice2 - R)"));
55
 
213 tk 56
        panel1.add(panel2);
628 adamjking 57
        panel1.add(panel3);
58
 
59
        this.add(panel1, BorderLayout.NORTH);
213 tk 60
    }
61
 
628 adamjking 62
    protected JPanel createArp(Vector vGUI, String s) {
213 tk 63
        JPanel arpPanel = new JPanel();
64
        arpPanel.setLayout(new BoxLayout(arpPanel, BoxLayout.X_AXIS));
65
        arpPanel.setBorder(BorderFactory.createEtchedBorder());
66
        arpPanel.setBorder(BorderFactory.createTitledBorder(s));
67
        arpPanel.setOpaque(false);
628 adamjking 68
 
213 tk 69
        JPanel subPanel1 = new JPanel(new GridBagLayout());
70
        subPanel1.setOpaque(false);
628 adamjking 71
        GridBagConstraints c = new GridBagConstraints();
213 tk 72
        c.fill = GridBagConstraints.HORIZONTAL;
73
        c.ipadx = 10;
74
        // First row
628 adamjking 75
        c.gridx = 0;
76
        c.gridy = 0;
77
        c.gridwidth = 1;
213 tk 78
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(14), c);
628 adamjking 79
        c.gridx = 1;
80
        c.gridy = 0;
81
        c.gridwidth = 2;
213 tk 82
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(15), c);
628 adamjking 83
 
213 tk 84
        // Second row
628 adamjking 85
        c.gridx = 0;
86
        c.gridy = 1;
87
        c.gridwidth = 1;
213 tk 88
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(20), c);
628 adamjking 89
        c.gridx = 1;
90
        c.gridy = 1;
91
        c.gridwidth = 1;
213 tk 92
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(23), c);
628 adamjking 93
        c.gridx = 2;
94
        c.gridy = 1;
95
        c.gridwidth = 1;
213 tk 96
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(22), c);
628 adamjking 97
 
213 tk 98
        JPanel subPanel2 = new JPanel();
628 adamjking 99
        subPanel2.setLayout(new GridLayout(2, 3));
213 tk 100
        subPanel2.setOpaque(false);
628 adamjking 101
 
213 tk 102
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(16));
103
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(17));
104
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(18));
105
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(21));
106
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(19));
107
        arpPanel.add(subPanel1);
108
        arpPanel.add(subPanel2);
109
        return arpPanel;
628 adamjking 110
    }
213 tk 111
}