X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooTrackView.java;h=a9a41d9f127a9c6a8871b5b8515c46cfcd9d1aea;hb=c54c8150061571a2aaf4ea81e027498b6bc248a7;hp=5efb00238f5366180076fcc8b65a48d83b431a70;hpb=3895c924f1ebe07d2def43568dce002d9589f821;p=moosique.git diff --git a/MooTrackView.java b/MooTrackView.java index 5efb002..a9a41d9 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -23,6 +23,7 @@ public class MooTrackView extends JPanel implements ActionListener { public MooTrackView (Track track) { + super(true); this.track = track; //setPreferredSize(new Dimension(200, 9000)); setLayout(new BorderLayout()); @@ -70,6 +71,7 @@ public class MooTrackView extends JPanel implements ActionListener { public NoteArea(Track track) { // Configuring panel + super(true); setLayout(null); trackLength = 140; setPreferredSize(new Dimension(200, 140 * NOTE_HEIGHT)); @@ -87,14 +89,14 @@ public class MooTrackView extends JPanel implements ActionListener { if (note instanceof MooNote) { // Adds the note element to the note area. MooNote mn = (MooNote)note; - elem = new MooNoteElement(mn); + elem = new MooNoteElement(mn, mn.getDuration() / 24); add(elem); // Moves the note element to the appropriate place. x = insets.left; y = insets.top + (int)(mn.getTick() / 24) * NOTE_HEIGHT; - height = NOTE_HEIGHT; - // height = (mn.getDuration() / 24) * NOTE_HEIGHT; + height = (mn.getDuration() / 24) * NOTE_HEIGHT; + if (height == 0) height = NOTE_HEIGHT; Rectangle r = new Rectangle(x, y, NOTE_WIDTH, height); while(isOccupied(r)) r.translate(NOTE_WIDTH, 0); elem.setBounds(r); @@ -145,4 +147,4 @@ public class MooTrackView extends JPanel implements ActionListener { } } } -} \ No newline at end of file +}