]> ruin.nu Git - moosique.git/commitdiff
Started to work on MooNoteElement.
authorMichael Andreen <harv@ruin.nu>
Mon, 28 Apr 2003 00:14:04 +0000 (00:14 +0000)
committerMichael Andreen <harv@ruin.nu>
Mon, 28 Apr 2003 00:14:04 +0000 (00:14 +0000)
Initial commit of MooNotePref

MooNoteElement.java
MooNotePref.java [new file with mode: 0644]

index f3b8ad041d69788524d8c92898f7bf79067952ac..8b71b3cfb31e72caabf1edff3479f1dd930beecf 100644 (file)
@@ -1,4 +1,6 @@
 import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
 
 /*
  * Graphical representation of a MIDI note.
@@ -7,12 +9,51 @@ import javax.swing.*;
  * @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
        }
+                       
 }
diff --git a/MooNotePref.java b/MooNotePref.java
new file mode 100644 (file)
index 0000000..6a42fff
--- /dev/null
@@ -0,0 +1,26 @@
+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();
+       }
+
+                       
+}