X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooView.java;h=9bf83673048412345f35a1f5d812ae1c1c825a56;hb=refs%2Fheads%2Forigin;hp=a5ebf903d95a35537e84c409329cbbe95a27b4eb;hpb=c31857b9fcb119f0d4c12b96222f66340b3dcc56;p=moosique.git 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