From: Michael Andreen Date: Tue, 6 May 2003 01:05:48 +0000 (+0000) Subject: should now draw the text representation. X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=commitdiff_plain;h=f2a6b00defcf7804b30e8d167015500e33d6cedb should now draw the text representation. --- diff --git a/MooNoteElement.java b/MooNoteElement.java index 40ab0a4..969433f 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -52,6 +52,26 @@ public class MooNoteElement extends JPanel{ if (!(g instanceof Graphics2D)) return; Graphics2D g2 = (Graphics2D)g; + + String note = ""; //TODO: shoudl really change this name.. + int pitch = this.note.getPitch(); + switch( pitch % 12) + { + case 0: note = "C"; break; + case 1: note = "C#"; break; + case 2: note = "D"; break; + case 3: note = "D#"; break; + case 4: note = "E"; break; + case 5: note = "F"; break; + case 6: note = "F#"; break; + case 7: note = "G"; break; + case 8: note ="G#"; break; + case 9: note = "A"; break; + case 10: note = "A#"; break; + case 11: note = "B"; break; + } + + g2.drawString(note +" "+(pitch/12), 2, 2); }