@@ -0,0 +1,3266 @@
+import javax.swing.JComponent;%0Aimport javax.swing.BoxLayout;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.JButton;%0Aimport javax.swing.ImageIcon;%0Aimport javax.swing.JLabel;%0Aimport javax.swing.JCheckBox;%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0A%0Aimport framework.editors.Editor;%0Aimport framework.Sound;%0Aimport framework.Player;%0Aimport framework.generators.GuitarGenerator;%0A%0A%0A/**%0A * Advanced implementation of the framework, as a Sound matrix.%0A */%0Apublic class MatrixEditor extends Editor %7B%0A    public MatrixEditor(Player pl) %7B%0A        super(pl, %22Matrix Editor%22);%0A    %7D%0A%0A    public JComponent createCentralComponent() %7B%0A        matrix = new HashMap%3CSound, JCheckBox%5B%5D%3E();%0A%0A        JPanel centralComponent = new JPanel();%0A        centralComponent.setLayout(new BoxLayout(%0A            centralComponent,%0A            BoxLayout.Y_AXIS));%0A%0A        // Play matrix button%0A        JButton playMatrixButton  = new JButton(new ImageIcon(%22framework/editors/icons/play.png%22));%0A        playMatrixButton.addActionListener(new ActionListener() %7B%0A            public void actionPerformed(ActionEvent e) %7B%0A                for(int i = 0; i %3C COLS; i++) %7B%0A                    ArrayList%3CSound%3E selection = new ArrayList%3CSound%3E();%0A                    for(Sound s : matrix.keySet()) %7B%0A                        // If the checkbox is checked%0A                        // Add to the selection%0A                        if(matrix.get(s)%5Bi%5D.isSelected())%0A                            selection.add(s);%0A                    %7D%0A                    player.playSelection(selection);%0A                %7D%0A            %7D%0A        %7D);%0A        add(playMatrixButton);%0A%0A        Double%5B%5D FREQS = new Double%5B%5D%7B82.4, 110., 146.8, 196., 246.9, 329.6%7D;%0A%0A        for(int i = 0; i %3C FREQS.length; i++) %7B%0A            GuitarGenerator g = new GuitarGenerator();%0A            Sound newSound = new Sound(g, FREQS%5Bi%5D, 1., 1.);%0A            player.addSound(newSound);%0A            centralComponent.add(createMatrixLine(newSound));%0A        %7D%0A%0A        return centralComponent;%0A    %7D%0A%0A    public JPanel createMatrixLine(Sound s) %7B%0A        final Sound sound = s;%0A        JPanel  matrixLine      = new JPanel();%0A%0A        // Play button%0A        JButton playButton  = new JButton(new ImageIcon(%22framework/editors/icons/play.png%22));%0A        playButton.addActionListener(new ActionListener() %7B%0A            public void actionPerformed(ActionEvent e) %7B%0A                player.play(sound);%0A            %7D%0A        %7D);%0A        matrixLine.add(playButton);%0A%0A        // Settings button%0A        JButton settingsButton  = new JButton(new ImageIcon(%22framework/editors/icons/settings.png%22));%0A        settingsButton.addActionListener(new ActionListener() %7B%0A            public void actionPerformed(ActionEvent e) %7B%0A                sound.attachEditor();%0A            %7D%0A        %7D);%0A        matrixLine.add(settingsButton);%0A%0A        // Checkboxes%0A        JCheckBox%5B%5D cbs = new JCheckBox%5BCOLS%5D;%0A        for(int i = 0; i %3C COLS; i++) %7B%0A            JCheckBox cb = new JCheckBox();%0A            cbs%5Bi%5D = cb;%0A            matrixLine.add(cb);%0A        %7D%0A%0A        matrix.put(sound, cbs);%0A%0A        return matrixLine;%0A    %7D%0A%0A    final int COLS = 12;%0A%0A    HashMap%3CSound, JCheckBox%5B%5D%3E matrix;%0A%7D

Create the MatrixEditor.