Subversion Repositories svn.mios

Rev

Rev 213 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 213 Rev 628
1
/*
1
/*
2
 * @(#)SIDV2librarian.java  beta1   2008/01/21
2
 * @(#)SIDV2librarian.java  beta1   2008/01/21
3
 *
3
 *
4
 * Copyright (C) 2008    Rutger Vlek (rutgervlek@hotmail.com)
4
 * Copyright (C) 2008    Rutger Vlek (rutgervlek@hotmail.com)
5
 *
5
 *
6
 * This application is free software; you can redistribute it and/or modify
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
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
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
9
 * (at your option) any later version.
10
 *
10
 *
11
 * This application is distributed in the hope that it will be useful,
11
 * This application is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
14
 * GNU General Public License for more details.
15
 *
15
 *
16
 * You should have received a copy of the GNU General Public License
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
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
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
19
 */
20
20
21
package org.midibox.sidedit.gui.lead;
21
package org.midibox.sidedit.gui.lead;
22
22
23
import java.awt.BorderLayout;
23
import java.awt.BorderLayout;
24
import java.awt.GridBagConstraints;
24
import java.awt.GridBagConstraints;
25
import java.awt.GridBagLayout;
25
import java.awt.GridBagLayout;
26
import java.awt.GridLayout;
26
import java.awt.GridLayout;
27
import java.util.Vector;
27
import java.util.Vector;
28
28
29
import javax.swing.BorderFactory;
29
import javax.swing.BorderFactory;
30
import javax.swing.BoxLayout;
30
import javax.swing.BoxLayout;
31
import javax.swing.JPanel;
31
import javax.swing.JPanel;
32
32
33
import  org.midibox.sidedit.gui.controls.*;
33
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
34
34
35
public class ArpGUI extends JPanel{
35
public class ArpGUI extends JPanel {
36
    protected ArpGUI(Vector V1GUIv, Vector V2GUIv, Vector V3GUIv, Vector V4GUIv, Vector V5GUIv, Vector V6GUIv) {
36
    protected ArpGUI(Vector V1GUIv, Vector V2GUIv, Vector V3GUIv,
-
 
37
            Vector V4GUIv, Vector V5GUIv, Vector V6GUIv) {
37
        setLayout(new BorderLayout());
38
        setLayout(new BorderLayout());
38
        this.setOpaque(false);
39
        this.setOpaque(false);
39
       
40
40
        JPanel panel1 = new JPanel();
41
        JPanel panel1 = new JPanel();
41
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
42
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
42
        panel1.setOpaque(false);
43
        panel1.setOpaque(false);
43
       
44
44
        JPanel panel2 = new JPanel();
45
        JPanel panel2 = new JPanel();
45
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
46
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
46
        panel2.setOpaque(false);
47
        panel2.setOpaque(false);
47
       
48
48
        panel2.add(createArp(V1GUIv,"ARP (voice1 - L)"));
49
        panel2.add(createArp(V1GUIv, "ARP (voice1 - L)"));
49
        panel2.add(createArp(V2GUIv,"ARP (voice2 - L)"));
50
        panel2.add(createArp(V2GUIv, "ARP (voice2 - L)"));
50
        panel2.add(createArp(V3GUIv,"ARP (voice3 - L)"));
51
        panel2.add(createArp(V3GUIv, "ARP (voice3 - L)"));
51
       
52
52
        JPanel panel3 = new JPanel();
53
        JPanel panel3 = new JPanel();
53
        panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
54
        panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
54
        panel3.setOpaque(false);
55
        panel3.setOpaque(false);
55
       
56
56
        panel3.add(createArp(V4GUIv,"ARP (voice4 - R)"));
57
        panel3.add(createArp(V4GUIv, "ARP (voice4 - R)"));
57
        panel3.add(createArp(V5GUIv,"ARP (voice5 - R)"));
58
        panel3.add(createArp(V5GUIv, "ARP (voice5 - R)"));
58
        panel3.add(createArp(V6GUIv,"ARP (voice6 - R)"));
59
        panel3.add(createArp(V6GUIv, "ARP (voice6 - R)"));
59
       
60
60
        panel1.add(panel2);
61
        panel1.add(panel2);
61
        panel1.add(panel3);    
62
        panel1.add(panel3);
62
       
63
63
        this.add(panel1, BorderLayout.NORTH);
64
        this.add(panel1, BorderLayout.NORTH);
64
    }
65
    }
65
66
66
    protected JPanel createArp(Vector vGUI, String s) {
67
    protected JPanel createArp(Vector vGUI, String s) {
67
        JPanel arpPanel = new JPanel();
68
        JPanel arpPanel = new JPanel();
68
        arpPanel.setLayout(new BoxLayout(arpPanel, BoxLayout.X_AXIS));
69
        arpPanel.setLayout(new BoxLayout(arpPanel, BoxLayout.X_AXIS));
69
        arpPanel.setBorder(BorderFactory.createEtchedBorder());
70
        arpPanel.setBorder(BorderFactory.createEtchedBorder());
70
        arpPanel.setBorder(BorderFactory.createTitledBorder(s));
71
        arpPanel.setBorder(BorderFactory.createTitledBorder(s));
71
        arpPanel.setOpaque(false);
72
        arpPanel.setOpaque(false);
72
       
73
73
        JPanel subPanel1 = new JPanel(new GridBagLayout());
74
        JPanel subPanel1 = new JPanel(new GridBagLayout());
74
        subPanel1.setOpaque(false);
75
        subPanel1.setOpaque(false);
75
        GridBagConstraints c = new GridBagConstraints();       
76
        GridBagConstraints c = new GridBagConstraints();
76
        c.fill = GridBagConstraints.HORIZONTAL;
77
        c.fill = GridBagConstraints.HORIZONTAL;
77
        c.ipadx = 10;
78
        c.ipadx = 10;
78
        // First row
79
        // First row
-
 
80
        c.gridx = 0;
-
 
81
        c.gridy = 0;
79
        c.gridx = 0;c.gridy = 0;c.gridwidth=1;
82
        c.gridwidth = 1;
80
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(14), c);
83
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(14), c);
-
 
84
        c.gridx = 1;
-
 
85
        c.gridy = 0;
81
        c.gridx = 1;c.gridy = 0;c.gridwidth=2;
86
        c.gridwidth = 2;
82
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(15), c);
87
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(15), c);
83
           
88
84
        // Second row
89
        // Second row
-
 
90
        c.gridx = 0;
-
 
91
        c.gridy = 1;
85
        c.gridx = 0;c.gridy = 1;c.gridwidth=1;
92
        c.gridwidth = 1;
86
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(20), c);
93
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(20), c);
-
 
94
        c.gridx = 1;
-
 
95
        c.gridy = 1;
87
        c.gridx = 1;c.gridy = 1;c.gridwidth=1;
96
        c.gridwidth = 1;
88
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(23), c);
97
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(23), c);
-
 
98
        c.gridx = 2;
-
 
99
        c.gridy = 1;
89
        c.gridx = 2;c.gridy = 1;c.gridwidth=1;
100
        c.gridwidth = 1;
90
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(22), c);
101
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(22), c);
91
       
102
92
        JPanel subPanel2 = new JPanel();
103
        JPanel subPanel2 = new JPanel();
93
        subPanel2.setLayout(new GridLayout(2,3));
104
        subPanel2.setLayout(new GridLayout(2, 3));
94
        subPanel2.setOpaque(false);
105
        subPanel2.setOpaque(false);
95
       
106
96
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(16));
107
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(16));
97
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(17));
108
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(17));
98
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(18));
109
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(18));
99
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(21));
110
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(21));
100
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(19));
111
        subPanel2.add((SIDSysexParameterControlGUI) vGUI.elementAt(19));
101
        arpPanel.add(subPanel1);
112
        arpPanel.add(subPanel1);
102
        arpPanel.add(subPanel2);
113
        arpPanel.add(subPanel2);
103
       
114
104
        return arpPanel;
115
        return arpPanel;
105
    }  
116
    }
106
}
117
}
107
 
118