001package net.kreatious.pianoleopard.painter.layout;
002
003import java.awt.Dimension;
004import java.awt.Rectangle;
005
006import net.kreatious.pianoleopard.midi.event.EventPair;
007import net.kreatious.pianoleopard.midi.event.NoteEvent;
008
009/**
010 * Provides the coordinates for drawing events played by the user.
011 *
012 * @author Jay-R Studer
013 */
014public class PlayedEventLayout extends DefaultEventLayout {
015    /**
016     * Constructs a new {@link PlayedEventLayout} with the initial specified
017     * component layout dimensions
018     *
019     * @param componentDimension
020     *            the inital component layout dimensions
021     */
022    public PlayedEventLayout(Dimension componentDimension) {
023        super(componentDimension);
024    }
025
026    @Override
027    public void layoutNote(long currentTime, EventPair<NoteEvent> event, Rectangle rect) {
028        super.layoutNote(currentTime, event, rect);
029        rect.x += rect.width / 4;
030        rect.width -= rect.width / 2;
031    }
032}