+ * @param mn the note that will be graphically represented
+ * @param rows the number of rows that the note will occupy
+ */
+ public MooNoteElement (MooTrackView parent, MooNote mn) {
+ mtv = parent;
+ note = mn;
+ calculateString();
+ setBorder(BorderFactory.createLineBorder(Color.black));
+ setBackground(bgColor);
+ addMouseListener(new MAdapter());
+
+ // Defines coordinates.
+ pitchRect = new Rectangle(0, 0, 15, 10);
+ veloRect = new Rectangle(20, 0, 40, 10);
+
+ // Creates pop-up menu.
+ popup = new JPopupMenu();
+ PopupListener pList = new PopupListener();
+ popupProp = new JMenuItem("Preferences...");
+ popupProp.addActionListener(pList);
+ popup.add(popupProp);
+
+ popupRemove = new JMenuItem("Remove");
+ popupRemove.addActionListener(pList);
+ popup.add(popupRemove);
+
+ }
+
+ /**
+ * Returns true if the current NoteElement is selected, otherwise false.
+ * @return if the element is selected
+ */
+ public boolean isSelected() {
+ return selected;
+ }
+
+ /**
+ * Selects the current NoteElement.
+ * @param state if the element should be selected
+ */
+ public void setSelected(boolean state) {
+ selected = state;
+ }
+
+ /**
+ *