X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooView.java;h=9bf83673048412345f35a1f5d812ae1c1c825a56;hp=a5ebf903d95a35537e84c409329cbbe95a27b4eb;hb=e49cbedbb512d2cbadb19f9b4b84c1b0ef39ff9c;hpb=22067aec9dd544828d90ff39a3a6d40cdfc7ea9f diff --git a/MooView.java b/MooView.java index a5ebf90..9bf8367 100644 --- a/MooView.java +++ b/MooView.java @@ -120,6 +120,19 @@ public class MooView extends JScrollPane { getViewport().setViewPosition(new Point((int)getViewport().getViewPosition().getX(), (int)(tickPosition / (Moosique.getSequence().getResolution() / 4)) * MooTrackView.NOTE_HEIGHT)); } + + /** + * Creates a view for the given track and adds it to the main view. + * @param track the track for which to find the view + */ + public MooTrackView getTrackView(Track track) { + for (int i = 0; i < trackPanel.getComponents().length; i++) { + MooTrackView mtv = (MooTrackView)(trackPanel.getComponents())[i]; + if(mtv.getTrack() == track) return mtv; + } + return null; + } + /** * Creates a view for the given track and adds it to the main view. * @param track the track for which to add a view