From 0f75f154c6485f6428617af221a282ba03ee20ae Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 11 May 2003 17:47:16 +0000 Subject: [PATCH] some changes --- MooNoteElement.java | 33 ++++++++++++++++++--------------- To Do.txt | 4 +++- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/MooNoteElement.java b/MooNoteElement.java index 3640113..c39d2b5 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -67,29 +67,32 @@ public class MooNoteElement extends JPanel{ { super.paintComponent(g); + if (note == null) + return; + if (!(g instanceof Graphics2D)) return; Graphics2D g2 = (Graphics2D)g; - String note = ""; //TODO: shoudl really change this name.. - int pitch = this.note.getPitch(); + String n = ""; + int pitch = 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; + 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; } - g2.drawString(note +" "+(pitch/12), 2, 2); + g2.drawString(n +" "+(pitch/12), 2, 2); } diff --git a/To Do.txt b/To Do.txt index 187541f..a43a560 100644 --- a/To Do.txt +++ b/To Do.txt @@ -15,6 +15,8 @@ VIKTIGT! Implementera playfunktionens beteende. N } i GUI: + Bör vara i MooView.. MooGUI bör bara ha en update som kör MooView's + updatefunktion.. public void update() { // Calls on each track view to update itself. @@ -140,4 +142,4 @@ Moosique * getPosition och setPosition - kvar? - \ No newline at end of file + -- 2.39.2