+ g2.setFont(new Font("Helvetica", Font.PLAIN, 8));
+
+ String n = "";
+ int pitch = note.getPitch();
+ switch (pitch % 12) {
+ case 0: n = "C"; break;
+ case 1: n = "C#"; break;
+ case 2: n = "D"; break;
+ case 3: n = "D#"; break;
+ case 4: n = "E"; break;
+ case 5: n = "F"; break;
+ case 6: n = "F#"; break;
+ case 7: n = "G"; break;
+ case 8: n = "G#"; break;
+ case 9: n = "A"; break;
+ case 10: n = "A#"; break;
+ case 11: n = "B"; break;
+ }
+ n += pitch / 12;
+
+ /*
+ switch(columns) {
+ case 0:
+ case 1:
+ ...
+ }
+ */
+
+ g2.drawString(n, 1, 9);
+ g2.drawString("" + note.getVelocity(), 21, 9);
+ }
+
+ class MAdapter extends MouseAdapter {
+ public void mouseClicked(MouseEvent e) {
+ if (pitchRect.contains(e.getPoint())) {
+ if (SwingUtilities.isRightMouseButton(e)) {
+ note.setPitch(note.getPitch() + 1);
+ } else if (SwingUtilities.isLeftMouseButton(e)) {
+ note.setPitch(note.getPitch() - 1);
+ }
+ } else if (veloRect.contains(e.getPoint())) {
+ if (SwingUtilities.isRightMouseButton(e)) {
+ note.setVelocity(note.getVelocity() + 1);
+ } else if (SwingUtilities.isLeftMouseButton(e)) {
+ note.setVelocity(note.getVelocity() - 1);
+ }
+ }
+ e.getComponent().repaint();
+ }
+
+ public void mousePressed(MouseEvent e) {}