+ /**
+ * Deselects all notes.
+ */
+ public void selectNote(MooNoteElement elem) {
+ selected.add(elem);
+ }
+
+ /**
+ * Deselects all notes.
+ */
+ public void deselectNote(MooNoteElement elem) {
+ selected.remove(selected.indexOf(elem));
+ }
+
+ /**
+ * Deselects all notes.
+ */
+ public void deselectAllNotes() {
+ Iterator it = selected.iterator();
+ while(it.hasNext()) {
+ ((MooNoteElement)it.next()).deselect();
+ }
+ selected.clear();
+ }
+
+ /**
+ * Determines if the given MooNoteElement is the only one in the track view that is selected.
+ * @return if the given element is the only selected one
+ */
+ public boolean isTheOnlySelected(MooNoteElement elem) {
+ Iterator it = selected.iterator();
+ while(it.hasNext()) {
+ if (!it.next().equals(elem)) return false;
+ }
+ return true;
+ }
+
+ /**
+ * Shows a popup-menu with options for the current selection of note elements.
+ * @param c the component over which to display the menu
+ * @param x the x-coordinate in which to display the menu
+ * @param y the y-coordinate in which to display the menu
+ */
+ public void showSelectionPopup(Component c, int x, int y) {
+ selPopup.show(c, x, y);
+ }
+
+ /**
+ * Transposes all selected notes the given number of halftones.
+ */
+ private void transposeSelectedNotes(int halftones) {
+ Iterator it = selected.iterator();
+ while(it.hasNext()) {
+ MooNoteElement elem = (MooNoteElement)it.next();
+ elem.getNote().transpose(halftones);
+ elem.update();
+ }
+ }
+
+ /**
+ * Draws the grid that is on the background.
+ * @param g The Graphics object used to draw the grid.
+ */