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;
628 adamjking 24
import java.awt.Dimension;
25
import java.awt.Font;
26
import java.awt.GridBagConstraints;
213 tk 27
import java.awt.GridBagLayout;
28
import java.util.Vector;
628 adamjking 29
 
213 tk 30
import javax.swing.JLabel;
31
import javax.swing.JPanel;
628 adamjking 32
 
213 tk 33
import org.midibox.sidedit.SIDSysexInfo;
628 adamjking 34
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
213 tk 35
import org.midibox.utils.gui.JVertLabel;
628 adamjking 36
 
213 tk 37
public class TriggerGUI extends JPanel {
38
    protected TriggerGUI(Vector trigGUIv) {
39
        setLayout(new BorderLayout());
40
        this.setOpaque(false);
628 adamjking 41
 
213 tk 42
        JPanel topanel = new JPanel();
43
        topanel.setLayout(new BorderLayout());
44
        topanel.setOpaque(false);
628 adamjking 45
 
213 tk 46
        JPanel panel1 = new JPanel();
47
        panel1.setLayout(new GridBagLayout());
48
        panel1.setOpaque(false);
628 adamjking 49
        GridBagConstraints c = new GridBagConstraints();
213 tk 50
        c.fill = GridBagConstraints.HORIZONTAL;
628 adamjking 51
 
52
        for (int row = 0; row < 25; row++) {
53
            for (int col = 0; col < 15; col++) {
54
                if ((col == 0) && (row == 0)) {
213 tk 55
                    JLabel label = new JLabel();
56
                    label.setOpaque(false);
57
                    c.gridx = col;
58
                    c.gridy = row;
59
                    panel1.add(label, c);
628 adamjking 60
                } else if (row == 0) {
61
                    JLabel label = new JVertLabel(
62
                            SIDSysexInfo.trigColumnNames[col - 1]);
63
                    label.setFont(new Font("serif", Font.BOLD, 10));
213 tk 64
                    label.setOpaque(false);
65
                    c.gridx = col;
66
                    c.gridy = row;
67
                    panel1.add(label, c);
628 adamjking 68
                } else if (col == 0) {
69
                    JLabel label = new JLabel(
70
                            SIDSysexInfo.trigRowNames[row - 1]);
71
                    label.setFont(new Font("serif", Font.BOLD, 10));
213 tk 72
                    label.setOpaque(false);
628 adamjking 73
                    label.setPreferredSize(new Dimension(70, 10));
213 tk 74
                    c.gridx = col;
75
                    c.gridy = row;
76
                    panel1.add(label, c);
628 adamjking 77
                } else {
213 tk 78
                    c.gridx = col;
628 adamjking 79
                    c.gridy = row;
80
                    panel1.add((SIDSysexParameterControlGUI) trigGUIv
81
                            .elementAt((row - 1) + ((col - 1) * 24)), c);
213 tk 82
                }
83
            }
84
        }
628 adamjking 85
 
213 tk 86
        topanel.add(panel1, BorderLayout.WEST);
628 adamjking 87
        this.add(topanel, BorderLayout.NORTH);
213 tk 88
    }
89
}