use of org.apache.airavata.xbaya.ui.widgets.XBayaLabel in project airavata by apache.
the class WorkflowInterpreterLaunchWindow method initGUI.
private void initGUI() {
this.parameterPanel = new GridPanel(true);
GridPanel infoPanel = new GridPanel();
this.instanceNameTextField = new XBayaTextField();
XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
infoPanel.add(instanceNameLabel);
infoPanel.add(this.instanceNameTextField);
token = new XBayaTextField("");
JLabel tokenLabel = new JLabel("Token Id: ");
infoPanel.add(tokenLabel);
infoPanel.add(token);
infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
GridPanel mainPanel = new GridPanel();
mainPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
mainPanel.add(infoPanel);
mainPanel.add(this.parameterPanel);
mainPanel.layout(2, 1, 0, 0);
JButton okButton = new JButton("Run");
okButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
try {
execute();
} catch (AiravataClientConnectException e1) {
e1.printStackTrace();
} catch (InvalidRequestException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (AiravataClientException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (AiravataSystemException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (TException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(okButton);
buttonPanel.add(cancelButton);
buttonPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
this.dialog = new XBayaDialog(this.engine.getGUI(), "Launch workflow", mainPanel, buttonPanel);
this.dialog.setDefaultButton(okButton);
}
use of org.apache.airavata.xbaya.ui.widgets.XBayaLabel in project airavata by apache.
the class WorkflowInterpreterLaunchWindow method show.
/**
* Shows the dialog.
*/
public void show() {
this.workflow = this.engine.getGUI().getWorkflow();
// Create input fields
Collection<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
for (InputNode node : inputNodes) {
String id = node.getID();
DataType parameterType = node.getParameterType();
JLabel nameLabel = new JLabel(id);
JLabel typeField = new JLabel(parameterType.toString());
XBayaTextField paramField = new XBayaTextField();
Object value = node.getDefaultValue();
String valueString;
if (value == null) {
valueString = "";
} else {
if (value instanceof XmlElement) {
XmlElement valueElement = (XmlElement) value;
valueString = XMLUtil.xmlElementToString(valueElement);
} else {
// Only string comes here for now.
valueString = value.toString();
}
}
paramField.setText(valueString);
this.parameterPanel.add(nameLabel);
this.parameterPanel.add(typeField);
this.parameterPanel.add(paramField);
this.parameterTextFields.add(paramField);
}
Map<String, String> hosts = null;
try {
hosts = airavataClient.getAllComputeResourceNames();
if (hosts.isEmpty()) {
JOptionPane.showMessageDialog(engine.getGUI().getFrame(), "No Compute Resources found", "Compute Resources", JOptionPane.ERROR_MESSAGE);
return;
}
} catch (InvalidRequestException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (AiravataClientException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (AiravataSystemException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (TException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
hostNames = new HashMap<String, String>();
Iterator it = hosts.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String key = (String) pairs.getKey();
String value = (String) pairs.getValue();
if (!hostNames.containsKey(value)) {
hostNames.put(value, key);
}
}
host = new JComboBox();
it = hostNames.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry) it.next();
String key = (String) pairs.getKey();
host.addItem(key);
}
host.setSelectedIndex(0);
XBayaLabel hostLabel = new XBayaLabel("Host", host);
this.parameterPanel.add(hostLabel);
this.parameterPanel.add(host);
this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
this.dialog.show();
}
use of org.apache.airavata.xbaya.ui.widgets.XBayaLabel in project airavata by apache.
the class NewRegistryUserDialog method initGUI.
/**
* Initializes the GUI.
*/
private void initGUI() {
// this.urlTextField = new XBayaTextField();
this.usernameTextField = new XBayaTextField();
this.passwordTextField = new JPasswordField();
this.confirmPasswordTextField = new JPasswordField();
// XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
XBayaLabel userLabel = new XBayaLabel("Username", this.usernameTextField);
XBayaLabel passLabel = new XBayaLabel("Password", this.passwordTextField);
XBayaLabel confirmPassLabel = new XBayaLabel("Confirm Password", this.confirmPasswordTextField);
GridPanel infoPanel = new GridPanel();
// infoPanel.add(urlLabel);
// infoPanel.add(this.urlTextField);
infoPanel.add(userLabel);
infoPanel.add(this.usernameTextField);
infoPanel.add(passLabel);
infoPanel.add(this.passwordTextField);
infoPanel.add(confirmPassLabel);
infoPanel.add(this.confirmPasswordTextField);
// infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
infoPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
// urlTextField.getSwingComponent().addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent event) {
// updateURL();
// updateStatus();
// }
//
// });
usernameTextField.getSwingComponent().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
updateUsername();
updateStatus();
}
});
passwordTextField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
updatePassword();
updateStatus();
}
});
confirmPasswordTextField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
updatePassword();
updateStatus();
}
});
okButton = new JButton("OK");
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ok();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(okButton);
buttonPanel.add(cancelButton);
this.dialog = new XBayaDialog(this.engine.getGUI(), "Registry New User", infoPanel, buttonPanel);
this.dialog.setDefaultButton(okButton);
updateControlData();
}
use of org.apache.airavata.xbaya.ui.widgets.XBayaLabel in project airavata by apache.
the class WorkflowPropertyWindow method initGui.
private void initGui() {
this.nameTextField = new XBayaTextField();
XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
this.descriptionTextArea = new XBayaTextArea();
XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
GridPanel mainPanel = new GridPanel();
mainPanel.add(nameLabel);
mainPanel.add(this.nameTextField);
mainPanel.add(descriptionLabel);
mainPanel.add(this.descriptionTextArea);
mainPanel.layout(new double[] { 0, 0.5 }, new double[] { 0, 1 });
this.okButton = new JButton("OK");
this.okButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
setToWorkflow();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(this.okButton);
buttonPanel.add(cancelButton);
this.dialog = new XBayaDialog(this.xbayaGUI, "Workflow Properties", mainPanel, buttonPanel);
this.dialog.setDefaultButton(this.okButton);
}
use of org.apache.airavata.xbaya.ui.widgets.XBayaLabel in project airavata by apache.
the class RegistryWorkflowPublisherWindow method initGUI.
/**
* Intialize UI
*/
private void initGUI() {
this.nameTextField = new XBayaTextField();
XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
this.descriptionTextArea = new XBayaTextArea();
XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
JPanel buttonPanel = new JPanel();
this.okButton = new JButton("OK");
this.okButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
ok();
}
});
buttonPanel.add(this.okButton);
GridPanel mainPanel = new GridPanel();
TitledBorder border = new TitledBorder(new EtchedBorder(), "Save Workflow to Registry");
mainPanel.getSwingComponent().setBorder(border);
mainPanel.add(nameLabel);
mainPanel.add(this.nameTextField);
mainPanel.add(descriptionLabel);
mainPanel.add(this.descriptionTextArea);
chkMakePublic = new JCheckBox("Make public");
mainPanel.add(chkMakePublic);
mainPanel.layout(2, 2, 0, 0);
this.dialog = new XBayaDialog(this.engine.getGUI(), "Save Workflow to Registry", mainPanel, buttonPanel);
this.dialog.setDefaultButton(this.okButton);
}
Aggregations