Author: [log in to unmask] Date: Tue Mar 10 19:29:56 2015 New Revision: 2400 Log: Add support for embedded remote AIDA server so plots are viewable in JAS3 Remote AIDA plugin. Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/Commands.java java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/JobSettingsPanel.java java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/MenuBar.java java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/model/ConfigurationModel.java Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/Commands.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/Commands.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/Commands.java Tue Mar 10 19:29:56 2015 @@ -49,6 +49,9 @@ static final String CONDITIONS_TAG_CHANGED = "conditionsTagChanged"; + static final String START_AIDA_SERVER = "startAIDAServer"; + static final String STOP_AIDA_SERVER = "stopAIDAServer"; + //////////////////////////////////////////// static final String BLOCKING_CHANGED = "blockingChanged"; static final String CHOOSE_COMPACT_FILE = "chooseCompactFile"; Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/JobSettingsPanel.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/JobSettingsPanel.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/JobSettingsPanel.java Tue Mar 10 19:29:56 2015 @@ -1,7 +1,4 @@ package org.hps.monitoring.application; - -import static org.hps.monitoring.application.Commands.*; -import static org.hps.monitoring.application.model.ConfigurationModel.*; import java.awt.GridBagLayout; import java.awt.Insets; @@ -21,10 +18,10 @@ import javax.swing.border.EmptyBorder; import javax.swing.filechooser.FileFilter; -import org.hps.conditions.database.DatabaseConditionsManager; import org.hps.monitoring.application.model.ConfigurationModel; import org.hps.monitoring.application.model.SteeringType; import org.hps.monitoring.application.util.ResourceUtil; +import org.hps.record.enums.ProcessingStage; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; @@ -34,11 +31,13 @@ * This is the GUI panel for setting job parameters. It is connected to the global configuration via * a {@link org.hps.monitoring.model.ConfigurationModel} object. */ +// FIXME: Combo boxes should use explicit types. class JobSettingsPanel extends AbstractFieldsPanel { private JComboBox<?> steeringResourcesComboBox; private JTextField steeringFileField; private JComboBox<?> steeringTypeComboBox; + private JComboBox<ProcessingStage> processingStageComboBox; private JComboBox<String> detectorNameComboBox; private JTextField detectorAliasField; private JComboBox<String> conditionsTagComboBox; @@ -51,6 +50,7 @@ private JComboBox<?> logLevelComboBox; private JCheckBox logToFileCheckbox; private JTextField logFileNameField; + private JTextField aidaServerNameField; // The package where steering resources must be located. static final String STEERING_PACKAGE = "org/hps/steering/monitoring/"; @@ -76,13 +76,14 @@ super(new Insets(5, 3, 3, 5), true); setBorder(new EmptyBorder(10, 10, 10, 10)); - + + setLayout(new GridBagLayout()); + + // Listen on changes to the configuration which will then be automatically pushed to the GUI. model.addPropertyChangeListener(this); - - setLayout(new GridBagLayout()); steeringResourcesComboBox = addComboBoxMultiline("Steering File Resource", ResourceUtil.findSteeringResources(STEERING_PACKAGE)); - steeringResourcesComboBox.setActionCommand(STEERING_RESOURCE_CHANGED); + steeringResourcesComboBox.setActionCommand(Commands.STEERING_RESOURCE_CHANGED); steeringResourcesComboBox.addActionListener(this); steeringFileField = addField("Steering File", 50); @@ -93,15 +94,20 @@ steeringFileButton.addActionListener(this); steeringTypeComboBox = addComboBox("Steering Type", new String[] { SteeringType.RESOURCE.name(), SteeringType.FILE.name() }); - steeringTypeComboBox.setActionCommand(STEERING_TYPE_CHANGED); + steeringTypeComboBox.setActionCommand(Commands.STEERING_TYPE_CHANGED); steeringTypeComboBox.addActionListener(this); + processingStageComboBox = new JComboBox<ProcessingStage>(ProcessingStage.values()); + addComponent("Processing Stage", processingStageComboBox); + processingStageComboBox.setActionCommand(Commands.PROCESSING_STAGE_CHANGED); + processingStageComboBox.addActionListener(this); + detectorNameComboBox = addComboBox("Detector Name", ResourceUtil.findDetectorNames()); - detectorNameComboBox.setActionCommand(DETECTOR_NAME_CHANGED); + detectorNameComboBox.setActionCommand(Commands.DETECTOR_NAME_CHANGED); detectorNameComboBox.addActionListener(this); detectorAliasField = addField("Detector Resources Directory", "", 35, true); - detectorAliasField.setActionCommand(DETECTOR_ALIAS_CHANGED); + detectorAliasField.setActionCommand(Commands.DETECTOR_ALIAS_CHANGED); detectorAliasField.addPropertyChangeListener("value", this); detectorAliasField.addActionListener(this); @@ -111,21 +117,21 @@ userRunNumberField = addField("User Run Number", "", 10, true); userRunNumberField.addPropertyChangeListener("value", this); - userRunNumberField.setActionCommand(USER_RUN_NUMBER_CHANGED); + userRunNumberField.setActionCommand(Commands.USER_RUN_NUMBER_CHANGED); userRunNumberField.setEnabled(true); userRunNumberField.setEditable(true); conditionsTagComboBox = addComboBox("Conditions Tag", ResourceUtil.getConditionsTags()); conditionsTagComboBox.addItem(""); conditionsTagComboBox.setSelectedItem(""); - conditionsTagComboBox.setActionCommand(CONDITIONS_TAG_CHANGED); + conditionsTagComboBox.setActionCommand(Commands.CONDITIONS_TAG_CHANGED); conditionsTagComboBox.addActionListener(this); conditionsTagComboBox.setEditable(false); conditionsTagComboBox.setEnabled(true); freezeConditionsCheckBox = addCheckBox("Freeze detector conditions", false, true); freezeConditionsCheckBox.addActionListener(this); - freezeConditionsCheckBox.setActionCommand(FREEZE_CONDITIONS_CHANGED); + freezeConditionsCheckBox.setActionCommand(Commands.FREEZE_CONDITIONS_CHANGED); maxEventsField = addField("Max Events", "-1", 10, false); maxEventsField.addPropertyChangeListener("value", this); @@ -134,15 +140,15 @@ eventBuilderComboBox = addComboBox("LCSim Event Builder", ResourceUtil.findEventBuilderClassNames()); eventBuilderComboBox.setSize(24, eventBuilderComboBox.getPreferredSize().height); - eventBuilderComboBox.setActionCommand(EVENT_BUILDER_CHANGED); + eventBuilderComboBox.setActionCommand(Commands.EVENT_BUILDER_CHANGED); eventBuilderComboBox.addActionListener(this); disconnectOnErrorCheckBox = addCheckBox("Disconnect on error", false, true); - disconnectOnErrorCheckBox.setActionCommand(DISCONNECT_ON_ERROR_CHANGED); + disconnectOnErrorCheckBox.setActionCommand(Commands.DISCONNECT_ON_ERROR_CHANGED); disconnectOnErrorCheckBox.addActionListener(this); disconnectOnEndRunCheckBox = addCheckBox("Disconnect on end run", false, true); - disconnectOnEndRunCheckBox.setActionCommand(DISCONNECT_ON_END_RUN_CHANGED); + disconnectOnEndRunCheckBox.setActionCommand(Commands.DISCONNECT_ON_END_RUN_CHANGED); disconnectOnEndRunCheckBox.addActionListener(this); logLevelComboBox = addComboBox("Log Level", LOG_LEVELS); @@ -152,8 +158,11 @@ logToFileCheckbox = addCheckBox("Log to File", false, false); logToFileCheckbox.setEnabled(false); - logFileNameField = addField("Log File Name", "", "Full path to log file.", 50, false); + logFileNameField = addField("Log File Name", "", "Full path to log file", 50, false); logFileNameField.setEditable(false); + + aidaServerNameField = addField("AIDA Server Name", "", "Name of AIDA server", 30, true); + aidaServerNameField.addPropertyChangeListener("value", this); } @Override @@ -248,39 +257,42 @@ public void actionPerformed(ActionEvent event) { try { configurationModel.removePropertyChangeListener(this); + String command = event.getActionCommand(); if (event.getActionCommand().equals(Commands.CHOOSE_STEERING_FILE)) { chooseSteeringFile(); } else if (event.getActionCommand().equals(Commands.CHOOSE_COMPACT_FILE)) { chooseCompactFile(); - } else if (DISCONNECT_ON_ERROR_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.DISCONNECT_ON_ERROR_CHANGED.equals(command)) { configurationModel.setDisconnectOnError(disconnectOnErrorCheckBox.isSelected()); - } else if (DISCONNECT_ON_END_RUN_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.DISCONNECT_ON_END_RUN_CHANGED.equals(command)) { configurationModel.setDisconnectOnEndRun(disconnectOnEndRunCheckBox.isSelected()); - } else if (STEERING_TYPE_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.STEERING_TYPE_CHANGED.equals(command)) { configurationModel.setSteeringType(SteeringType.valueOf((String) steeringTypeComboBox.getSelectedItem())); - } else if (STEERING_RESOURCE_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.STEERING_RESOURCE_CHANGED.equals(command)) { configurationModel.setSteeringResource((String) steeringResourcesComboBox.getSelectedItem()); - } else if (LOG_LEVEL_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.LOG_LEVEL_CHANGED.equals(command)) { configurationModel.setLogLevel(Level.parse((String) logLevelComboBox.getSelectedItem())); - } else if (EVENT_BUILDER_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.EVENT_BUILDER_CHANGED.equals(command)) { configurationModel.setEventBuilderClassName((String) eventBuilderComboBox.getSelectedItem()); - } else if (DETECTOR_NAME_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.DETECTOR_NAME_CHANGED.equals(command)) { try { configurationModel.setDetectorName((String) detectorNameComboBox.getSelectedItem()); } catch (Exception exception) { exception.printStackTrace(); } - } else if (FREEZE_CONDITIONS_CHANGED.equals(event.getActionCommand())) { - if (configurationModel.hasPropertyKey(USER_RUN_NUMBER_PROPERTY) && configurationModel.getUserRunNumber() != null) { + } else if (Commands.FREEZE_CONDITIONS_CHANGED.equals(command)) { + if (configurationModel.hasPropertyKey(ConfigurationModel.USER_RUN_NUMBER_PROPERTY) && configurationModel.getUserRunNumber() != null) { configurationModel.setFreezeConditions(freezeConditionsCheckBox.isSelected()); } else { throw new IllegalArgumentException("Conditions system may only be frozen if there is a valid user run number."); } - } else if (DETECTOR_ALIAS_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.DETECTOR_ALIAS_CHANGED.equals(command)) { configurationModel.setDetectorName(detectorAliasField.getText()); - } else if (CONDITIONS_TAG_CHANGED.equals(event.getActionCommand())) { + } else if (Commands.CONDITIONS_TAG_CHANGED.equals(command)) { configurationModel.setConditionsTag((String) conditionsTagComboBox.getSelectedItem()); - } + } else if (Commands.PROCESSING_STAGE_CHANGED.equals(command)) { + configurationModel.setProcessingStage((ProcessingStage) processingStageComboBox.getSelectedItem()); + } } finally { configurationModel.addPropertyChangeListener(this); } @@ -318,6 +330,8 @@ } else if (source == maxEventsField) { configurationModel.setMaxEvents(Long.parseLong(maxEventsField.getText())); //System.out.println("setMaxEvents - " + configurationModel.getMaxEvents()); + } else if (source == aidaServerNameField) { + configurationModel.setAIDAServerName(aidaServerNameField.getText()); } else if (evt.getPropertyName().equals(ConfigurationModel.LOG_TO_FILE_PROPERTY)) { // This is getting the log to file prop change from the ConfigurationModel to update a read only component. Boolean logToFile = (Boolean) evt.getNewValue(); @@ -334,7 +348,7 @@ } } else if (evt.getPropertyName().equals(ConfigurationModel.CONDITIONS_TAG_PROPERTY)) { conditionsTagComboBox.setSelectedItem(evt.getNewValue()); - } + } } finally { configurationModel.addPropertyChangeListener(this); } @@ -349,49 +363,54 @@ public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() instanceof ConfigurationModel) { Object value = evt.getNewValue(); + String property = evt.getPropertyName(); configurationModel.removePropertyChangeListener(this); try { - if (evt.getPropertyName().equals(DETECTOR_NAME_PROPERTY)) { + if (property.equals(ConfigurationModel.DETECTOR_NAME_PROPERTY)) { detectorNameComboBox.setSelectedItem((String) value); - } else if (evt.getPropertyName().equals(DETECTOR_ALIAS_PROPERTY)) { + } else if (property.equals(ConfigurationModel.DETECTOR_ALIAS_PROPERTY)) { detectorAliasField.setText((String) value); - } else if (evt.getPropertyName().equals(DISCONNECT_ON_ERROR_PROPERTY)) { + } else if (property.equals(ConfigurationModel.DISCONNECT_ON_ERROR_PROPERTY)) { disconnectOnErrorCheckBox.setSelected((Boolean) value); - } else if (evt.getPropertyName().equals(DISCONNECT_ON_END_RUN_PROPERTY)) { + } else if (property.equals(ConfigurationModel.DISCONNECT_ON_END_RUN_PROPERTY)) { disconnectOnEndRunCheckBox.setSelected((Boolean) value); - } else if (evt.getPropertyName().equals(EVENT_BUILDER_PROPERTY)) { + } else if (property.equals(ConfigurationModel.EVENT_BUILDER_PROPERTY)) { eventBuilderComboBox.setSelectedItem((String) value); - } else if (evt.getPropertyName().equals(LOG_FILE_NAME_PROPERTY)) { + } else if (property.equals(ConfigurationModel.LOG_FILE_NAME_PROPERTY)) { logFileNameField.setText((String) value); - } else if (evt.getPropertyName().equals(LOG_LEVEL_PROPERTY)) { + } else if (property.equals(ConfigurationModel.LOG_LEVEL_PROPERTY)) { logLevelComboBox.setSelectedItem(value.toString()); - } else if (evt.getPropertyName().equals(LOG_TO_FILE_PROPERTY)) { + } else if (property.equals(ConfigurationModel.LOG_TO_FILE_PROPERTY)) { logToFileCheckbox.setSelected((Boolean) value); - } else if (evt.getPropertyName().equals(STEERING_TYPE_PROPERTY)) { + } else if (property.equals(ConfigurationModel.STEERING_TYPE_PROPERTY)) { steeringTypeComboBox.setSelectedIndex(((SteeringType) value).ordinal()); - } else if (evt.getPropertyName().equals(STEERING_FILE_PROPERTY)) { + } else if (property.equals(ConfigurationModel.STEERING_FILE_PROPERTY)) { if (value != null) { steeringFileField.setText((String) evt.getNewValue()); } else { // A null value here is actually okay and means this field should be reset to have no value. steeringFileField.setText(null); } - } else if (evt.getPropertyName().equals(STEERING_RESOURCE_PROPERTY)) { + } else if (property.equals(ConfigurationModel.STEERING_RESOURCE_PROPERTY)) { steeringResourcesComboBox.setSelectedItem(value); - } else if (evt.getPropertyName().equals(USER_RUN_NUMBER_PROPERTY)) { + } else if (property.equals(ConfigurationModel.USER_RUN_NUMBER_PROPERTY)) { if (value != null) { userRunNumberField.setText(Integer.toString((int) value)); } else { userRunNumberField.setText(null); } - } else if (evt.getPropertyName().equals(FREEZE_CONDITIONS_PROPERTY)) { + } else if (property.equals(ConfigurationModel.FREEZE_CONDITIONS_PROPERTY)) { if (value != null) { freezeConditionsCheckBox.setSelected((Boolean) value); } - } else if (evt.getPropertyName().equals(MAX_EVENTS_PROPERTY)) { + } else if (property.equals(ConfigurationModel.MAX_EVENTS_PROPERTY)) { if (value != null) { maxEventsField.setText(value.toString()); } + } else if (property.equals(ConfigurationModel.PROCESSING_STAGE_PROPERTY)) { + processingStageComboBox.setSelectedItem(evt.getNewValue()); + } else if (property.equals(ConfigurationModel.AIDA_SERVER_NAME_PROPERTY)) { + aidaServerNameField.setText((String) evt.getNewValue()); } } finally { configurationModel.addPropertyChangeListener(this); Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/MenuBar.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/MenuBar.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/MenuBar.java Tue Mar 10 19:29:56 2015 @@ -1,18 +1,4 @@ package org.hps.monitoring.application; - -import static org.hps.monitoring.application.Commands.EXIT; -import static org.hps.monitoring.application.Commands.CLOSE_FILE; -import static org.hps.monitoring.application.Commands.OPEN_FILE; -import static org.hps.monitoring.application.Commands.CLEAR_PLOTS; -import static org.hps.monitoring.application.Commands.SAVE_PLOTS; -import static org.hps.monitoring.application.Commands.LOAD_SETTINGS; -import static org.hps.monitoring.application.Commands.LOAD_DEFAULT_SETTINGS; -import static org.hps.monitoring.application.Commands.SAVE_SCREENSHOT; -import static org.hps.monitoring.application.Commands.SAVE_SETTINGS; -import static org.hps.monitoring.application.Commands.SHOW_SETTINGS; -import static org.hps.monitoring.application.Commands.DEFAULT_WINDOW; -import static org.hps.monitoring.application.Commands.MAXIMIZE_WINDOW; -import static org.hps.monitoring.application.Commands.MINIMIZE_WINDOW; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -40,6 +26,7 @@ JMenuItem openFileItem; JMenu settingsMenu; JMenuItem logItem; + JMenuItem serverItem; ConfigurationModel configurationModel; MenuBar(ConfigurationModel configurationModel, ConnectionStatusModel connectionModel, ActionListener listener) { @@ -56,21 +43,21 @@ openFileItem = new JMenuItem("Open File ..."); openFileItem.setMnemonic(KeyEvent.VK_P); - openFileItem.setActionCommand(OPEN_FILE); + openFileItem.setActionCommand(Commands.OPEN_FILE); openFileItem.addActionListener(listener); openFileItem.setToolTipText("Open an EVIO or LCIO data file"); fileMenu.add(openFileItem); closeFileItem = new JMenuItem("Close File"); closeFileItem.setMnemonic(KeyEvent.VK_C); - closeFileItem.setActionCommand(CLOSE_FILE); + closeFileItem.setActionCommand(Commands.CLOSE_FILE); closeFileItem.addActionListener(listener); closeFileItem.setToolTipText("Close the current file data source"); fileMenu.add(closeFileItem); JMenuItem exitItem = new JMenuItem("Exit"); exitItem.setMnemonic(KeyEvent.VK_X); - exitItem.setActionCommand(EXIT); + exitItem.setActionCommand(Commands.EXIT); exitItem.addActionListener(listener); exitItem.setToolTipText("Exit from the application"); fileMenu.add(exitItem); @@ -81,7 +68,7 @@ JMenuItem settingsItem = new JMenuItem("Open Settings Window ..."); settingsItem.setMnemonic(KeyEvent.VK_O); - settingsItem.setActionCommand(SHOW_SETTINGS); + settingsItem.setActionCommand(Commands.SHOW_SETTINGS); settingsItem.addActionListener(listener); settingsItem.setToolTipText("Show settings dialog"); settingsMenu.add(settingsItem); @@ -89,21 +76,21 @@ JMenuItem loadConfigItem = new JMenuItem("Load Settings ..."); loadConfigItem.addActionListener(listener); loadConfigItem.setMnemonic(KeyEvent.VK_L); - loadConfigItem.setActionCommand(LOAD_SETTINGS); + loadConfigItem.setActionCommand(Commands.LOAD_SETTINGS); loadConfigItem.setToolTipText("Load settings from a properties file"); settingsMenu.add(loadConfigItem); JMenuItem saveConfigItem = new JMenuItem("Save Settings ..."); saveConfigItem.addActionListener(listener); saveConfigItem.setMnemonic(KeyEvent.VK_S); - saveConfigItem.setActionCommand(SAVE_SETTINGS); + saveConfigItem.setActionCommand(Commands.SAVE_SETTINGS); saveConfigItem.setToolTipText("Save configuration to a properties file"); settingsMenu.add(saveConfigItem); JMenuItem defaultSettingsItem = new JMenuItem("Load Default Settings"); defaultSettingsItem.addActionListener(listener); defaultSettingsItem.setMnemonic(KeyEvent.VK_D); - defaultSettingsItem.setActionCommand(LOAD_DEFAULT_SETTINGS); + defaultSettingsItem.setActionCommand(Commands.LOAD_DEFAULT_SETTINGS); defaultSettingsItem.setToolTipText("Load the default settings"); settingsMenu.add(defaultSettingsItem); @@ -113,7 +100,7 @@ JMenuItem savePlotsItem = new JMenuItem("Save Plots ..."); savePlotsItem.setMnemonic(KeyEvent.VK_S); - savePlotsItem.setActionCommand(SAVE_PLOTS); + savePlotsItem.setActionCommand(Commands.SAVE_PLOTS); savePlotsItem.addActionListener(listener); savePlotsItem.setEnabled(true); savePlotsItem.setToolTipText("Save plots to AIDA file"); @@ -121,7 +108,7 @@ JMenuItem clearPlotsItem = new JMenuItem("Clear plots"); clearPlotsItem.setMnemonic(KeyEvent.VK_C); - clearPlotsItem.setActionCommand(CLEAR_PLOTS); + clearPlotsItem.setActionCommand(Commands.CLEAR_PLOTS); clearPlotsItem.addActionListener(listener); clearPlotsItem.setEnabled(true); clearPlotsItem.setToolTipText("Clear the AIDA plots"); @@ -133,7 +120,7 @@ JMenuItem screenshotItem = new JMenuItem("Save Screenshot ..."); screenshotItem.setMnemonic(KeyEvent.VK_S); - screenshotItem.setActionCommand(SAVE_SCREENSHOT); + screenshotItem.setActionCommand(Commands.SAVE_SCREENSHOT); screenshotItem.addActionListener(listener); screenshotItem.setEnabled(true); screenshotItem.setToolTipText("Save a screenshot to a graphics file"); @@ -147,13 +134,21 @@ logItem.setToolTipText("Redirect System.out to a file instead of terminal"); toolsMenu.add(logItem); + serverItem = new JMenuItem("Start AIDA Server ..."); + serverItem.setMnemonic(KeyEvent.VK_A); + serverItem.setActionCommand(Commands.START_AIDA_SERVER); + serverItem.setEnabled(true); + serverItem.setToolTipText("Start AIDA RMI Server"); + serverItem.addActionListener(listener); + toolsMenu.add(serverItem); + JMenu windowMenu = new JMenu("Window"); windowMenu.setMnemonic(KeyEvent.VK_W); add(windowMenu); JMenuItem maximizeItem = new JMenuItem("Maximize"); maximizeItem.setMnemonic(KeyEvent.VK_M); - maximizeItem.setActionCommand(MAXIMIZE_WINDOW); + maximizeItem.setActionCommand(Commands.MAXIMIZE_WINDOW); maximizeItem.addActionListener(listener); maximizeItem.setEnabled(true); maximizeItem.setToolTipText("Maximize the application window"); @@ -161,7 +156,7 @@ JMenuItem minimizeItem = new JMenuItem("Minimize"); minimizeItem.setMnemonic(KeyEvent.VK_I); - minimizeItem.setActionCommand(MINIMIZE_WINDOW); + minimizeItem.setActionCommand(Commands.MINIMIZE_WINDOW); minimizeItem.addActionListener(listener); minimizeItem.setEnabled(true); minimizeItem.setToolTipText("Minimize the application window"); @@ -169,7 +164,7 @@ JMenuItem defaultsItem = new JMenuItem("Restore Defaults"); defaultsItem.setMnemonic(KeyEvent.VK_D); - defaultsItem.setActionCommand(DEFAULT_WINDOW); + defaultsItem.setActionCommand(Commands.DEFAULT_WINDOW); defaultsItem.addActionListener(listener); defaultsItem.setEnabled(true); defaultsItem.setToolTipText("Restore the window defaults"); @@ -214,4 +209,16 @@ } } } + + void startAIDAServer() { + serverItem.setActionCommand(Commands.STOP_AIDA_SERVER); + serverItem.setText("Stop AIDA Server"); + serverItem.setToolTipText("Stop the remote AIDA server"); + } + + void stopAIDAServer() { + serverItem.setActionCommand(Commands.START_AIDA_SERVER); + serverItem.setText("Start AIDA Server"); + serverItem.setToolTipText("Start the remote AIDA server"); + } } Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/model/ConfigurationModel.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/model/ConfigurationModel.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/model/ConfigurationModel.java Tue Mar 10 19:29:56 2015 @@ -1,6 +1,5 @@ package org.hps.monitoring.application.model; -import java.io.File; import java.util.logging.Level; import org.hps.record.enums.DataSourceType; @@ -16,6 +15,7 @@ Configuration configuration; // Job setting properties. + public static final String AIDA_SERVER_NAME_PROPERTY = "AIDAServerName"; public static final String CONDITIONS_TAG_PROPERTY = "ConditionsTag"; public static final String DETECTOR_NAME_PROPERTY = "DetectorName"; public static final String DETECTOR_ALIAS_PROPERTY = "DetectorAlias"; @@ -399,6 +399,16 @@ public String getConditionsTag() { return configuration.get(CONDITIONS_TAG_PROPERTY); } + + public void setAIDAServerName(String AIDAServerName) { + String oldValue = getAIDAServerName(); + configuration.set(AIDA_SERVER_NAME_PROPERTY, AIDAServerName); + firePropertyChange(AIDA_SERVER_NAME_PROPERTY, oldValue, getAIDAServerName()); + } + + public String getAIDAServerName() { + return configuration.get(AIDA_SERVER_NAME_PROPERTY); + } public void remove(String property) { if (hasPropertyKey(property)) {