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.
*/
public void setSequence(Sequence sequence) {
seq = sequence;
- view.update(seq.getTracks());
+ view.setSequence(seq);
}
/**
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
+}
/**
* 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();
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
public void removeTrackView(Track track) {
}
-}
\ No newline at end of file
+}
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();
}