]> ruin.nu Git - moosique.git/blobdiff - MooView.java
no message
[moosique.git] / MooView.java
index a5ebf903d95a35537e84c409329cbbe95a27b4eb..9bf83673048412345f35a1f5d812ae1c1c825a56 100644 (file)
@@ -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