public class MooNoteElement extends JPanel {
private MooNote note;
+ private int columns;
private boolean selected;
/**
*/
public MooNoteElement (MooNote mn, int rows) {
note = mn;
+ columns = mn.getDuration() / 24;
}
/**
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);
if (note instanceof MooNote) {
// Adds the note element to the note area.
MooNote mn = (MooNote)note;
- elem = new MooNoteElement(mn, mn.getDuration() / 24);
+ elem = new MooNoteElement(mn);
add(elem);
// Moves the note element to the appropriate place.