]> ruin.nu Git - moosique.git/blob - MooNoteElement.java
Changed beginnings of comments from /* to /** which is necessary for the comments...
[moosique.git] / MooNoteElement.java
1 import javax.swing.*;
2 import java.awt.*;
3 import java.awt.event.*;
4
5 /**
6  * Graphical representation of a MIDI note.
7  * 
8  * @author  Andersson, Andreen, Lanneskog, Pehrson
9  * @version 1
10  */
11  
12 public class MooNoteElement extends JPanel{
13
14         private MooNote note;
15         /** 
16          * Creates a new note element.
17          * @param mn The note that will be graphically represented
18          */
19         public MooNoteElement (MooNote mn) {
20                 note = mn;
21                 setPreferredSize(new Dimension(20,20));
22
23                 class MouseList implements MouseListener{
24                         public void mouseClicked(MouseEvent event){
25                                 //Bring upp dialog to edit note.
26                         }
27
28                         public void mouseEntered(MouseEvent event){
29                                 //Show note props in statusbar?
30                         }
31
32                         public void mouseExited(MouseEvent event){
33                                 //Reset statusbar?
34                         }
35
36                         public void mousePressed(MouseEvent event){     }
37
38                         public void mouseReleased(MouseEvent event){}
39                 };
40                 MouseListener listener = new MouseList();
41                 addMouseListener(listener);
42                         
43         }
44
45         /***
46          *
47          */
48         public void paintComponent(Graphics g)
49         {
50                 super.paintComponent(g);
51
52                 if (!(g instanceof Graphics2D))
53                         return;
54                 Graphics2D g2 = (Graphics2D)g;
55
56                 //Draw the note representation
57         }
58                         
59 }