* Adds a standard note to this track.
*/
private void addStandardNote() {
- long timestamp = (long)(ticksPerSixteenth * (popupY - insets.top) / NOTE_HEIGHT);
+ int row = (popupY - insets.top) / NOTE_HEIGHT;
+ long timestamp = (long)(ticksPerSixteenth * row);
addNote(new MooNote(title.getChannel(), 60, 100, timestamp, Moosique.getSequence().getResolution() / 4));
}
* The adapter used to listen on mouse actions
*/
class MAdapter extends MouseAdapter {
+
/**
* Adds a standard note if doubleclicked.
*/
}
}
+ public void mousePressed(MouseEvent e) {
+ maybeShowPopup(e);
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ maybeShowPopup(e);
+ }
+
/**
- * Shows the menu if on standard poptriggers.
+ * Shows the menu if an OS-specific popup-trigger was activated.
*/
- public void mousePressed(MouseEvent e) {
+ private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
popupY = e.getY();
popup.show(e.getComponent(), e.getX(), e.getY());