X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooNoteElement.java;h=beb5702b0467b663f102f2482e73cf75cbcb96fb;hp=bcf5a7ba1ffea13117b7c1f4aef60c7fc7bf9769;hb=9becc0105a709c62132cc6ff111ba1943ebb32de;hpb=ffc69c8cc2cc9cdfe3841c77c1e680dee2225c63 diff --git a/MooNoteElement.java b/MooNoteElement.java index bcf5a7b..beb5702 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -45,17 +45,12 @@ public class MooNoteElement extends JPanel { { super.paintComponent(g); - if (note == null) - return; - - if (!(g instanceof Graphics2D)) - return; + if (note == null || !(g instanceof Graphics2D)) return; Graphics2D g2 = (Graphics2D)g; String n = ""; int pitch = note.getPitch(); - switch( pitch % 12) - { + switch (pitch % 12) { case 0: n = "C"; break; case 1: n = "C#"; break; case 2: n = "D"; break; @@ -72,8 +67,5 @@ public class MooNoteElement extends JPanel { g2.setFont(new Font("Helvetica", Font.PLAIN, 8)); n = n +(pitch/12); g2.drawString(n + " "+ note.getVelocity(), 1, 9); - - } - -} +} \ No newline at end of file