configDevicePanel.add(getStatusPanel(), statusPanelConstraints);
scanInfoAndCommandsPanel = new JPanel(new GridBagLayout());
buttonPanel = new JPanel(new GridBagLayout());
startButton = new StringButton();
startButton.setIcon(Utilities.ICONS.getIcon("flyscan.start"));
startButton.setButtonLook(true);
startButton.setEnabled(false);
startButton.addButtonListener(new IButtonListener() {
@Override
public void actionPerformed(EventObject event) {
int index = tabbedPane.getSelectedIndex();
if (index > -1) {
String configName = tabbedPane.getTitleAt(index);
configName = configName.replace("*", "").trim();
if (!configName.isEmpty()) {
try {
// Write config
TangoAttribute attribute = new TangoAttribute(getModel() + "/configuration");
Configuration config = tabbedPane.getConfiguration(index);
String unparsedConfig = ConfigParser.getInstance().deParse(config, getPlugins());
attribute.write(unparsedConfig);
// Start scan
TangoCommand startCommand = new TangoCommand(getModel(), "Start");
startCommand.execute();
} catch (DevFailed e) {
String message = DevFailedUtils.toString(e);
LOGGER.log(Level.SEVERE, message);
// System.err.println(message);
}
}
}
}
});
GridBagConstraints startButtonGridBagConstraints = new GridBagConstraints();
startButtonGridBagConstraints.gridx = 0;
startButtonGridBagConstraints.gridy = 0;
startButtonGridBagConstraints.weightx = 0.25;
startButtonGridBagConstraints.weighty = 0;
startButtonGridBagConstraints.ipadx = 0;
startButtonGridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
startButtonGridBagConstraints.anchor = GridBagConstraints.EAST;
startButtonGridBagConstraints.insets = new Insets(5, 5, 5, 0);
buttonPanel.add(startButton, startButtonGridBagConstraints);
stopButton = new StringButton();
stopButton.setIcon(Utilities.ICONS.getIcon("flyscan.stop"));
stopButton.setButtonLook(true);
GridBagConstraints stopButtonGridBagConstraints = new GridBagConstraints();
stopButtonGridBagConstraints.gridx = 1;
stopButtonGridBagConstraints.gridy = 0;
stopButtonGridBagConstraints.weightx = 0.25;
stopButtonGridBagConstraints.weighty = 0;
stopButtonGridBagConstraints.ipadx = 0;
stopButtonGridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
stopButtonGridBagConstraints.anchor = GridBagConstraints.EAST;
stopButtonGridBagConstraints.insets = new Insets(5, 5, 5, 0);
buttonPanel.add(stopButton, stopButtonGridBagConstraints);
pauseButton = new StringButton();
pauseButton.setIcon(Utilities.ICONS.getIcon("flyscan.pause"));
pauseButton.setButtonLook(true);
GridBagConstraints pauseButtonGridBagConstraints = new GridBagConstraints();
pauseButtonGridBagConstraints.gridx = 2;
pauseButtonGridBagConstraints.gridy = 0;
pauseButtonGridBagConstraints.weightx = 0.25;
pauseButtonGridBagConstraints.weighty = 0;
pauseButtonGridBagConstraints.ipadx = 0;
pauseButtonGridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
pauseButtonGridBagConstraints.anchor = GridBagConstraints.EAST;
pauseButtonGridBagConstraints.insets = new Insets(5, 5, 5, 0);
buttonPanel.add(pauseButton, pauseButtonGridBagConstraints);
restartButton = new StringButton();
restartButton.setIcon(Utilities.ICONS.getIcon("flyscan.resume"));
restartButton.setButtonLook(true);
GridBagConstraints restartButtonGridBagConstraints = new GridBagConstraints();
restartButtonGridBagConstraints.gridx = 3;