import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
/*
* Graphical representation of a MIDI note.
* @version 1
*/
-public class MooNoteElement {
+public class MooNoteElement extends JPanel{
+ private MooNote note;
/*
* Creates a new note element.
+ * @param mn The note that will be graphically represented
*/
- public MooNoteElement () {
+ public MooNoteElement (MooNote mn) {
+ note = mn;
+ setPreferredSize(new Dimension(20,20));
+ class MouseList implements MouseListener{
+ public void mouseClicked(MouseEvent event){
+ //Bring upp dialog to edit note.
+ }
+
+ public void mouseEntered(MouseEvent event){
+ //Show note props in statusbar?
+ }
+
+ public void mouseExited(MouseEvent event){
+ //Reset statusbar?
+ }
+
+ public void mousePressed(MouseEvent event){ }
+
+ public void mouseReleased(MouseEvent event){}
+ };
+ MouseListener listener = new MouseList();
+ addMouseListener(listener);
+
+ }
+
+ /**
+ *
+ */
+ public void paintComponent(Graphics g)
+ {
+ super.paintComponent(g);
+
+ if (!(g instanceof Graphics2D))
+ return;
+ Graphics2D g2 = (Graphics2D)g;
+
+ //Draw the note representation
}
+
}
--- /dev/null
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+
+/*
+ * Graphical representation of a MIDI note.
+ *
+ * @author Andersson, Andreen, Lanneskog, Pehrson
+ * @version 1
+ */
+
+public class MooNotePref extends JFrame{
+
+ private MooNote note;
+ /*
+ * Creates a new note preference dialog.
+ * @param mn The note that will be graphically represented
+ */
+ public MooNotePref (MooNote mn) {
+ note = mn;
+
+ pack();
+ }
+
+
+}