public MooNoteElement (MooNote mn) {
note = mn;
setPreferredSize(new Dimension(20,20));
+ setFont(new Font("Helvetica", Font.PLAIN, 10));
class MouseList implements MouseListener{
public void mouseClicked(MouseEvent event){
if (!(g instanceof Graphics2D))
return;
Graphics2D g2 = (Graphics2D)g;
-
+
String note = ""; //TODO: shoudl really change this name..
int pitch = this.note.getPitch();
switch( pitch % 12)
case 10: note = "A#"; break;
case 11: note = "B"; break;
}
-
+
g2.drawString(note +" "+(pitch/12), 2, 2);
}
-
-}
\ No newline at end of file
+
+}