]> ruin.nu Git - moosique.git/commitdiff
some restructuring..
authorMichael Andreen <harv@ruin.nu>
Sun, 11 May 2003 19:00:15 +0000 (19:00 +0000)
committerMichael Andreen <harv@ruin.nu>
Sun, 11 May 2003 19:00:15 +0000 (19:00 +0000)
MooGUI.java
MooView.java
To Do.txt

index ce67d69e7cb65db5daccde7fbb97fc6bce7bb101..7019828a67abbe19af427caa1432fb6b8d369c98 100644 (file)
@@ -39,7 +39,7 @@ public class MooGUI extends JFrame {
                pane.add(toolbar, BorderLayout.NORTH);
 
                // Adds main view.
-               view = new MooView(seq.getTracks());
+               view = new MooView(seq);
                pane.add(view, BorderLayout.CENTER);
 
                // Adds status bar.
@@ -81,7 +81,7 @@ public class MooGUI extends JFrame {
         */
        public void setSequence(Sequence sequence) {
                seq = sequence;
-               view.update(seq.getTracks());
+               view.setSequence(seq);
        }
 
        /** 
@@ -91,10 +91,19 @@ public class MooGUI extends JFrame {
        public void setStatus(String text) {
                statusBar.setText(text);
        }
+
+       /**
+        * Update the view.
+        */
+       public void update(){
+               view.update();
+               // Calls on the toolbar to update the progress indicator.
+               //toolbar.updateProgInd();
+       }
        
        class MooGUICloser extends WindowAdapter {
                public void windowClosing(WindowEvent e) {
                        Moosique.quit();
                }
        }
-}
\ No newline at end of file
+}
index 620478ca09b8857983b2cba25d4618e1612b21c1..4f36de3ce0a5d06e20b894cdfbac6d6035579a4f 100644 (file)
@@ -18,10 +18,10 @@ public class MooView extends JScrollPane {
        /** 
         * Creates the main view
         */
-       public MooView(Track[] tracks) {
+       public MooView(Sequence seq) {
                super(VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED);
+               tracks = seq.getTracks();
 
-               this.tracks = tracks;
 
                trackPanel = new JPanel(new GridLayout(1,3), true);
                createTrackViews();
@@ -42,11 +42,17 @@ public class MooView extends JScrollPane {
                trackPanel.validate();
        }
 
-       public void update(Track[] tracks) {
-               this.tracks = tracks;
+       public void setSequence(Sequence seq) {
+               tracks = seq.getTracks();
                createTrackViews();
        }
 
+       public void update() {
+               // Calls on each track view to update itself.
+               for (int i = 0; i < trackViews.length; i++) {
+                       //trackViews[i].update();
+               }
+       }
        /** 
         * Creates a view for the given track and adds it to the main view.
         * @param track         the track for which to add a view
@@ -62,4 +68,4 @@ public class MooView extends JScrollPane {
        public void removeTrackView(Track track) {
                
        }
-}
\ No newline at end of file
+}
index a43a56091f8688a06886aca01e726fa8e86ab82d..73c80d98d9bf6b54dbd3d3ad5443d03e81114d5d 100644 (file)
--- a/To Do.txt
+++ b/To Do.txt
@@ -14,15 +14,18 @@ VIKTIGT! Implementera playfunktionens beteende. N
                Moosique.getGUI().update();
        }
 
-       i GUI:
-       Bör vara i MooView.. MooGUI bör bara ha en update som kör MooView's
-       updatefunktion.. 
+       i View:
 
        public void update() {
                // Calls on each track view to update itself.
                for (int i = 0; i < trackViews.length; i++) {
                        trackViews[i].update();
                }
+       }
+
+       i GUI:
+       public void update(){
+               view.update();
                // Calls on the toolbar to update the progress indicator.
                toolbar.updateProgInd();
        }