public class MooNoteElement extends JPanel {
private MooNote note;
+ private int columns;
private boolean selected;
+ public static final Color bgColor = new Color(160, 218, 255);
/**
* Creates a new note element.
* @param mn the note that will be graphically represented
* @param rows the number of rows that the note will occupy
*/
- public MooNoteElement (MooNote mn, int rows) {
+ public MooNoteElement (MooNote mn) {
note = mn;
+ columns = mn.getDuration() / 24;
+ setBorder(BorderFactory.createLineBorder(Color.black));
+ setBackground(bgColor);
}
/**
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);