X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooNoteElement.java;h=c502b4d568cd47e6269e0fb79e0cd3ff1f753ec9;hb=fe67e0acf0d44c09dcfbbfd1a02a91f43d2cf60e;hp=beb5702b0467b663f102f2482e73cf75cbcb96fb;hpb=9becc0105a709c62132cc6ff111ba1943ebb32de;p=moosique.git diff --git a/MooNoteElement.java b/MooNoteElement.java index beb5702..c502b4d 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -12,14 +12,18 @@ import java.awt.event.*; public class MooNoteElement extends JPanel { private MooNote note; + private int columns; private boolean selected; /** * Creates a new note element. - * @param mn The note that will be graphically represented + * @param mn the note that will be graphically represented + * @param rows the number of rows that the note will occupy */ public MooNoteElement (MooNote mn) { note = mn; + columns = mn.getDuration() / 24; + setBorder(BorderFactory.createLineBorder(Color.black)); } /** @@ -64,6 +68,15 @@ public class MooNoteElement extends JPanel { case 10: n = "A#"; break; case 11: n = "B"; break; } + + /* + switch(columns) { + case 0: + case 1: + ... + } + */ + g2.setFont(new Font("Helvetica", Font.PLAIN, 8)); n = n +(pitch/12); g2.drawString(n + " "+ note.getVelocity(), 1, 9);