private final DreamboxAPI dbapi;
private JButton shutdownButton,rebootButton,standbyButton;
public ControlForm(final DreamboxAPI dba) {
dbapi = dba;
Status status;
try {
status = dba.getStatus();
}
catch (IOException e1) {
status = new Status();
}
JToolBar toolbar = new JToolBar(JToolBar.VERTICAL);
if (status.isStandby()) {
toolbar.add(standbyButton = new JButton("Wakeup",new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Information16.gif"))));
}
else {
toolbar.add(standbyButton = new JButton("Standby",new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Information16.gif"))));
}
standbyButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
Status status = dba.getStatus();
if (status.isStandby()) {
dbapi.command(Command.WAKEUP);
((JButton)arg0.getSource()).setText("Standby");
}
else {
dbapi.command(Command.STANDBY);