private void initGUI() {
setTitle("HPC Configuration Options");
setModal(true);
setBounds(100, 100, 500, 500);
setLocationRelativeTo(null);
GridPanel buttonPane = new GridPanel();
okButton = new JButton("Update");
okButton.setActionCommand("OK");
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
saveApplicationDescriptionAdvancedOptions();
close();
}
});
getRootPane().setDefaultButton(okButton);
JButton cancelButton = new JButton("Cancel");
cancelButton.setActionCommand("Cancel");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
close();
}
});
GridPanel panel = new GridPanel();
txtProjectAccountNumber = new XBayaTextField();
txtProjectAccountDescription = new XBayaTextField();
txtQueueType = new XBayaTextField();
txtMaxWallTime = new XBayaTextField();
txtMinMemory = new XBayaTextField();
txtMaxMemory = new XBayaTextField();
txtCpuCount = new XBayaTextField();
txtProcessorsPerNode = new XBayaTextField();
DefaultComboBoxModel cmbModelJobType = new DefaultComboBoxModel(getJobTypesAsStrings());
cmbJobType = new XBayaComboBox(cmbModelJobType);
cmbJobType.setEditable(false);
cmbJobType.getSwingComponent().addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
boolean disabled=cmbJobType.getText().equalsIgnoreCase(JobTypeType.SERIAL.toString()) || cmbJobType.getText().equalsIgnoreCase(JobTypeType.SINGLE.toString());
txtCpuCount.setEnabled(!disabled);
txtProcessorsPerNode.setEnabled(!disabled);
lblCpuCount.getSwingComponent().setEnabled(!disabled);
lblProcessorPerNode.getSwingComponent().setEnabled(!disabled);
}
});
XBayaLabel lbljobType = new XBayaLabel("Job Type",cmbJobType);
XBayaLabel lblProjectAccountNumber = new XBayaLabel("Project Account Number *",txtProjectAccountNumber);
XBayaLabel lblProjectAccountDescription = new XBayaLabel("Project Account Description",txtProjectAccountDescription);
XBayaLabel lblQueueType = new XBayaLabel("Queue Type *",txtQueueType);
XBayaLabel lblMaxWallTime = new XBayaLabel("Max Wall Time",txtMaxWallTime);
lblCpuCount = new XBayaLabel("CPU Count",txtCpuCount);
lblProcessorPerNode = new XBayaLabel("Processor Per Node", txtProcessorsPerNode);
XBayaLabel lblMinMemory = new XBayaLabel("Min Memory",txtMinMemory);
XBayaLabel lblMaxMemory = new XBayaLabel("Max Memory",txtMaxMemory);
panel.add(lbljobType);
panel.add(cmbJobType);
panel.add(lblProjectAccountNumber);
panel.add(txtProjectAccountNumber);
panel.add(lblProjectAccountDescription);
panel.add(txtProjectAccountDescription);
panel.add(lblQueueType);
panel.add(txtQueueType);
panel.add(lblMaxWallTime);
panel.add(txtMaxWallTime);
panel.add(lblCpuCount);
panel.add(txtCpuCount);
panel.add(lblProcessorPerNode);
panel.add(txtProcessorsPerNode);
panel.add(lblMinMemory);
panel.add(txtMinMemory);
panel.add(lblMaxMemory);
panel.add(txtMaxMemory);
panel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
SwingUtil.layoutToGrid(panel.getSwingComponent(), 9, 2, SwingUtil.WEIGHT_NONE, 1);
buttonPane.add(okButton);
buttonPane.add(cancelButton);
getContentPane().add(panel.getSwingComponent());
getContentPane().add(buttonPane.getSwingComponent());
SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
setResizable(true);
getRootPane().setDefaultButton(okButton);
}