|
@@ -16,7 +16,7 @@ public class Controls extends JPanel implements Observer
|
|
|
private JButton clear;
|
|
|
|
|
|
// Bob the Builder this shit
|
|
|
- public Controls(Model model, Handler handler)
|
|
|
+ public Controls(Model model)
|
|
|
{
|
|
|
// Hook up this observer so that it will be notified when the model
|
|
|
// changes.
|
|
@@ -24,7 +24,6 @@ public class Controls extends JPanel implements Observer
|
|
|
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
|
|
|
this.setPreferredSize(new Dimension(1280,75));
|
|
|
this.setMinimumSize(new Dimension(320, 75));
|
|
|
- //ImageIcon icon1 = new ImageIcon("/src/main/resources/playbutton.jpg");
|
|
|
this.play = new JButton("Play");
|
|
|
play.addActionListener(new ActionListener()
|
|
|
{
|
|
@@ -46,7 +45,7 @@ public class Controls extends JPanel implements Observer
|
|
|
{
|
|
|
public void stateChanged(ChangeEvent e)
|
|
|
{
|
|
|
- if (!playback.getSettingLen() && playback.getValue() != model.getTotalVisibleLen())
|
|
|
+ if (!playback.getSettingLen())
|
|
|
{
|
|
|
}
|
|
|
}
|
|
@@ -78,15 +77,13 @@ public class Controls extends JPanel implements Observer
|
|
|
|
|
|
public void update(Object observable)
|
|
|
{
|
|
|
- int len = model.getTotalLen();
|
|
|
+ int len = 0;
|
|
|
if (len > 0)
|
|
|
{
|
|
|
playback.toggleSettingLen();
|
|
|
playback.setMaximum(len);
|
|
|
playback.toggleSettingLen();
|
|
|
- playback.setValue(model.getTotalVisibleLen());
|
|
|
}
|
|
|
- this.setBackground(model.controlColour);
|
|
|
revalidate();
|
|
|
repaint();
|
|
|
}
|