hps-java/src/main/java/org/lcsim/hps/monitoring
diff -u -r1.2 -r1.3
--- EventButtonsPanel.java 5 Jun 2013 20:49:38 -0000 1.2
+++ EventButtonsPanel.java 25 Oct 2013 23:15:23 -0000 1.3
@@ -9,16 +9,16 @@
import javax.swing.JPanel;
public class EventButtonsPanel extends JPanel {
-
+
JButton nextEventsButton;
JButton pauseButton;
JButton connectButton;
-
+
EventButtonsPanel() {
-
+
GridBagLayout layout = new GridBagLayout();
setLayout(layout);
-
+
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
@@ -27,8 +27,8 @@
connectButton.setEnabled(true);
connectButton.setActionCommand(MonitoringCommands.connectCmd);
add(connectButton, c);
-
- c = new GridBagConstraints();
+
+ c = new GridBagConstraints();
c.gridx = 1;
c.gridy = 0;
c.insets = new Insets(0, 0, 0, 10);
@@ -36,8 +36,8 @@
pauseButton.setActionCommand(MonitoringCommands.pauseCmd);
pauseButton.setEnabled(false);
add(pauseButton, c);
-
- c = new GridBagConstraints();
+
+ c = new GridBagConstraints();
c.gridx = 2;
c.gridy = 0;
nextEventsButton = new JButton("Next Event");
@@ -45,39 +45,37 @@
nextEventsButton.setActionCommand(MonitoringCommands.nextCmd);
add(nextEventsButton, c);
}
-
+
void toggleConnectButton() {
if (connectButton.getText().equals("Connect")) {
connectButton.setText("Disconnect");
connectButton.setActionCommand(MonitoringCommands.disconnectCmd);
- }
- else {
+ } else {
connectButton.setText("Connect");
connectButton.setActionCommand(MonitoringCommands.connectCmd);
}
}
-
+
void addActionListener(ActionListener listener) {
nextEventsButton.addActionListener(listener);
pauseButton.addActionListener(listener);
connectButton.addActionListener(listener);
}
-
+
void enablePauseButton(boolean e) {
this.pauseButton.setEnabled(e);
}
-
+
void enableNextEventsButton(boolean e) {
this.nextEventsButton.setEnabled(e);
}
-
+
void setPauseModeState(boolean enable) {
this.nextEventsButton.setEnabled(enable);
if (enable) {
pauseButton.setText("Resume");
pauseButton.setActionCommand(MonitoringCommands.resumeCmd);
- }
- else {
+ } else {
pauseButton.setText("Pause");
pauseButton.setActionCommand(MonitoringCommands.pauseCmd);
}