private MooTrackView mtv;
private MooNote note;
- private int columns;
private boolean selected;
private Rectangle pitchRect, veloRect;
public static final Color bgColor = new Color(160, 218, 255);
mtv = parent;
note = mn;
calculateString();
- columns = mn.getDuration() / (Moosique.getSequence().getResolution() / 4);
setBorder(BorderFactory.createLineBorder(Color.black));
setBackground(bgColor);
addMouseListener(new MAdapter());
noteVelocity = ""+note.getVelocity();
}
+ public MooNote getNote(){
+ return note;
+ }
+
class MAdapter extends MouseAdapter {
public void mousePressed(MouseEvent e) {
if (e.isControlDown()) {
calculateString();
}
e.getComponent().repaint();
- }
- if (e.isPopupTrigger()) {
+ } else if (e.isPopupTrigger()) {
popup.show(e.getComponent(), e.getX(), e.getY());
}
}
if (source == popupProp) {
new MooDialog(note);
} else if (source == popupRemove) {
- mtv.remove((MooNoteElement)((JComponent)e.getSource()).getParent().getParent());
+ remove();
}
}
}
+
+ protected void remove(){
+ mtv.remove(this);
+ }
+
}