package com.traxel.lumbermill.log;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JToggleButton;
public final LogActiveStateView VIEW;
private final Log LOG;
private final JToggleButton PLAY;
private final JToggleButton PAUSE;
private final JToggleButton STOP;
private final JButton CLEAR;
VIEW = new LogActiveStateView(log);
LOG = log;
PLAY = VIEW.PLAY;
PAUSE = VIEW.PAUSE;
STOP = VIEW.STOP;
CLEAR = VIEW.CLEAR;
PLAY.addActionListener(this);
PAUSE.addActionListener(this);
STOP.addActionListener(this);
CLEAR.addActionListener(this);
}
@Override
final Object source = e.getSource();
if (PLAY.equals(source)) {
LOG.play();
} else if (PAUSE.equals(source)) {
LOG.pause();
} else if (STOP.equals(source)) {
LOG.stop();
} else if (CLEAR.equals(source)) {
LOG.clear();
}
}
}