public class MooNoteElement extends JPanel{
private MooNote note;
+ private boolean selected;
+
/**
* Creates a new note element.
* @param mn The note that will be graphically represented
};
MouseListener listener = new MouseList();
addMouseListener(listener);
-
+ }
+
+ /**
+ * 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;
}
/**
}
-}
+}
\ No newline at end of file