public MooTrackView (Track track) {
+ super(true);
this.track = track;
//setPreferredSize(new Dimension(200, 9000));
setLayout(new BorderLayout());
public NoteArea(Track track) {
// Configuring panel
+ super(true);
setLayout(null);
trackLength = 140;
setPreferredSize(new Dimension(200, 140 * NOTE_HEIGHT));
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);
}
}
}
-}
\ No newline at end of file
+}