X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooTrackView.java;h=8eba152152198159e9d33ab49d3cb4bc4a5d3f31;hp=513792de17c09597de455aa3600e081bfd84cb07;hb=e31778837bee5cfbbaf643d17f1eaeb086d8e50c;hpb=a714980001770d23628599710a48260e12f09be4 diff --git a/MooTrackView.java b/MooTrackView.java index 513792d..8eba152 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -106,16 +106,20 @@ public class MooTrackView extends JPanel { } } + /** + * Returns the track of this view. + * @return the track of this view + */ public Track getTrack() { return track; } - /** - * Updates the track view. + * Returns the title of this view. + * @return the title of this view */ - public void update(long tickPosition) { - repaint(); + public MooTrackTitle getTitle() { + return title; } private boolean isOccupied(Rectangle r) { @@ -126,6 +130,10 @@ public class MooTrackView extends JPanel { return false; } + /** + * Adds the given note to the current track, and visualises it. + * @param mn the note to add + */ public void addNote(MooNote mn) { mn.addTo(track); MooNoteElement elem = new MooNoteElement(this, mn); @@ -135,8 +143,12 @@ public class MooTrackView extends JPanel { repaint(); } - public void removeNote(MooNoteElement elem, MooNote mn) { - mn.removeFrom(track); + /** + * Removes the given note element from the view and its note from the current track. + * @param elem the note element to remove + */ + public void removeNote(MooNoteElement elem) { + elem.getNote().removeFrom(track); remove(elem); elem.getNote().removeFrom(track); repaint();