X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooNoteElement.java;h=8b71b3cfb31e72caabf1edff3479f1dd930beecf;hb=b707e72e9ba0631a60460dd368019029954a7ec7;hp=60f153a15a950a42a04abb54e610916fd1a5cd66;hpb=1e06fcb34d222ef2017d4adf888568184dd63ab9;p=moosique.git diff --git a/MooNoteElement.java b/MooNoteElement.java index 60f153a..8b71b3c 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -1,25 +1,59 @@ 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 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 () { - + public void paintComponent(Graphics g) + { + super.paintComponent(g); + + if (!(g instanceof Graphics2D)) + return; + Graphics2D g2 = (Graphics2D)g; + + //Draw the note representation } + }