use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.
the class TextWindow method init.
@SuppressWarnings("serial")
private void init() {
final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, StringUtil.createHTMLUrlTaggedString(value));
editorPane.setEditable(false);
editorPane.setBackground(Color.WHITE);
editorPane.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent event) {
logger.debug("Event:" + event);
if (event.getEventType() == EventType.ACTIVATED) {
URL url = event.getURL();
try {
BrowserLauncher.openURL(url.toString());
} catch (Exception e) {
TextWindow.this.engine.getGUI().getErrorWindow().error(TextWindow.this.dialog.getDialog(), e.getMessage(), e);
}
}
}
});
JScrollPane pane = new JScrollPane(editorPane);
GridPanel gridPanel = new GridPanel();
XBayaTextField txtKey = new XBayaTextField(key);
txtKey.getTextField().setEditable(false);
gridPanel.add(txtKey);
gridPanel.add(pane);
gridPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
gridPanel.layout(2, 1, 1, 0);
JPanel buttonPanel = new JPanel();
JButton okButton = new JButton("Close");
okButton.setDefaultCapable(true);
okButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
JButton btnCopy = new JButton("Copy to clipboard");
btnCopy.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
}
});
buttonPanel.add(btnCopy);
buttonPanel.add(okButton);
buttonPanel.setBorder(BorderFactory.createEtchedBorder());
this.dialog = new XBayaDialog(this.engine.getGUI(), title, gridPanel, buttonPanel);
dialog.getDialog().setMinimumSize(new Dimension(400, 400));
this.dialog.setDefaultButton(okButton);
}
use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.
the class AmazonEC2InvokerWindow method initGUI.
@SuppressWarnings("serial")
protected void initGUI() {
this.accessKeyIDTextField = new XBayaTextField();
XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);
this.secretAccessKeyTextField = new XBayaTextField();
XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Access Key", this.secretAccessKeyTextField);
this.keyPairNameTextField = new XBayaTextField();
XBayaLabel keyPairNameLabel = new XBayaLabel("Key Pair Name", this.keyPairNameTextField);
this.numOfInstancesTextField = new XBayaTextField();
XBayaLabel numOfInstancesLabel = new XBayaLabel("Number of Instances", this.numOfInstancesTextField);
this.jobFlowNameTextField = new XBayaTextField();
XBayaLabel jobFlowNameLabel = new XBayaLabel("Job Flow Name", this.jobFlowNameTextField);
this.logLocationOnS3TextField = new XBayaTextField();
XBayaLabel logLocationOnS3Label = new XBayaLabel("Log Location(S3)", this.logLocationOnS3TextField);
this.inputLocationOnS3TextField = new XBayaTextField();
XBayaLabel inputLocationOnS3Label = new XBayaLabel("Input Location(S3)", this.inputLocationOnS3TextField);
this.outputLocationOnS3TextField = new XBayaTextField();
XBayaLabel outputLocationOnS3Label = new XBayaLabel("Output Location(S3)", this.outputLocationOnS3TextField);
this.jarFilePathOnS3TextField = new XBayaTextField();
XBayaLabel jarFilePathOnS3Label = new XBayaLabel("Jar File Location(S3)", this.jarFilePathOnS3TextField);
this.mainClassNameTextField = new XBayaTextField();
XBayaLabel mainClassNameLabel = new XBayaLabel("Main Class Name", this.mainClassNameTextField);
this.accessKeyIDTextField.setText("AKIAI3GNMQVYA5LSQNEQ");
this.secretAccessKeyTextField.setText("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");
this.keyPairNameTextField.setText("XbayaHadoopTest");
this.numOfInstancesTextField.setText("4");
this.jobFlowNameTextField.setText("Test-job-flow");
this.logLocationOnS3TextField.setText("s3n://xbaya-ec2-test/logs");
this.inputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/input/");
this.outputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/output/");
this.jarFilePathOnS3TextField.setText("s3n://xbaya-ec2-test/jars/Hadoopv400.jar");
this.mainClassNameTextField.setText("edu.indiana.extreme.HadoopRayTracer");
GridPanel infoPanel = new GridPanel();
infoPanel.add(accessKeyIDLabel);
infoPanel.add(this.accessKeyIDTextField);
infoPanel.add(secretAccessKeyLabel);
infoPanel.add(this.secretAccessKeyTextField);
infoPanel.add(keyPairNameLabel);
infoPanel.add(this.keyPairNameTextField);
infoPanel.add(numOfInstancesLabel);
infoPanel.add(this.numOfInstancesTextField);
infoPanel.add(jobFlowNameLabel);
infoPanel.add(this.jobFlowNameTextField);
infoPanel.add(logLocationOnS3Label);
infoPanel.add(this.logLocationOnS3TextField);
infoPanel.add(inputLocationOnS3Label);
infoPanel.add(this.inputLocationOnS3TextField);
infoPanel.add(outputLocationOnS3Label);
infoPanel.add(this.outputLocationOnS3TextField);
infoPanel.add(jarFilePathOnS3Label);
infoPanel.add(this.jarFilePathOnS3TextField);
infoPanel.add(mainClassNameLabel);
infoPanel.add(this.mainClassNameTextField);
infoPanel.layout(10, 2, GridPanel.WEIGHT_NONE, 1);
GridPanel mainPanel = new GridPanel();
mainPanel.add(infoPanel);
mainPanel.layout(1, 1, 0, 0);
JButton invokeButton = new JButton("Invoke");
invokeButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
execute();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(invokeButton);
buttonPanel.add(cancelButton);
this.dialog = new XBayaDialog(this.engine.getGUI(), "Deploy Workflow", mainPanel, buttonPanel);
}
use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.
the class ParameterPropertyPanel method initGUI.
private void initGUI() {
this.parameterList = new XBayaList();
this.parameterList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent event) {
selectionChanged();
}
});
this.upButton = new JButton("UP");
this.upButton.setEnabled(false);
this.upButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
up();
}
});
this.downButton = new JButton("DOWN");
this.downButton.setEnabled(false);
this.downButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
down();
}
});
GridPanel buttonPanel = new GridPanel();
buttonPanel.add(this.upButton);
buttonPanel.add(this.downButton);
buttonPanel.layout(2, 1, GridPanel.WEIGHT_NONE, 0);
GridPanel reorderingPanel = new GridPanel();
reorderingPanel.add(this.parameterList);
reorderingPanel.add(buttonPanel);
reorderingPanel.layout(1, 2, 0, 0);
this.metadataTextArea = new XBayaTextArea();
JLabel metadataLabel = new JLabel("Metadata");
metadataLabel.setLabelFor(this.metadataTextArea.getSwingComponent());
this.panel = new GridPanel();
this.panel.add(reorderingPanel);
this.panel.add(metadataLabel);
this.panel.add(this.metadataTextArea);
this.panel.layout(3, 1, 2, 0);
TitledBorder border = BorderFactory.createTitledBorder(this.title);
this.panel.getSwingComponent().setBorder(border);
}
use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.
the class RegistryWindow method initGUI.
/**
* Initializes the GUI.
*/
private void initGUI() {
this.serverTextField = new XBayaTextField();
this.portTextField = new XBayaTextField();
this.gatewayIdTextField = new XBayaTextField();
this.usernameTextField = new XBayaTextField();
this.serverTextField.setText("localhost");
this.portTextField.setText("8930");
this.gatewayIdTextField.setText("sample");
this.usernameTextField.setText("airavata");
ThriftClientData thriftClientData = engine.getConfiguration().getThriftClientData(ThriftServiceType.API_SERVICE);
if (thriftClientData != null) {
this.serverTextField.setText(thriftClientData.getServerAddress());
this.gatewayIdTextField.setText(thriftClientData.getGatewayId());
this.portTextField.setText(String.valueOf(thriftClientData.getServerPort()));
this.usernameTextField.setText(thriftClientData.getUsername());
}
try {
ClientSettings.initializeTrustStore();
} catch (ApplicationSettingsException e) {
throw new RuntimeException("An error occurred while initializing client configurations");
}
XBayaLabel serverAddressLabel = new XBayaLabel("Server Address", this.serverTextField);
XBayaLabel serverPortLabel = new XBayaLabel("Server Port", this.portTextField);
XBayaLabel gatewayNameLabel = new XBayaLabel("Gateway ID", this.gatewayIdTextField);
XBayaLabel gatewayUserLabel = new XBayaLabel("Gateway User", this.usernameTextField);
serviceTypeModel = new DefaultComboBoxModel(ThriftServiceType.values());
serviceTypeModel.setSelectedItem(getServiceType());
this.serviceTypeCombo = new XBayaComboBox(serviceTypeModel);
JLabel serviceTypeLabel = new JLabel("Airavata Service");
// serviceTypeCombo.addActionListener(new AbstractAction() {
// public void actionPerformed(ActionEvent e) {
// // createNewUser();
// }
// });
GridPanel infoPanel = new GridPanel();
infoPanel.add(serviceTypeLabel);
infoPanel.add(this.serviceTypeCombo);
infoPanel.add(serverAddressLabel);
infoPanel.add(this.serverTextField);
infoPanel.add(serverPortLabel);
infoPanel.add(this.portTextField);
infoPanel.add(gatewayNameLabel);
infoPanel.add(this.gatewayIdTextField);
infoPanel.add(gatewayUserLabel);
infoPanel.add(this.usernameTextField);
infoPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
// infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
JButton okButton = new JButton("OK");
okButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
ok();
}
});
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
hide();
}
});
GridPanel buttonPanel = new GridPanel();
buttonPanel.add(okButton);
buttonPanel.add(cancelButton);
buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
this.dialog = new XBayaDialog(this.engine.getGUI(), "Configure Airavata Thrift Service", infoPanel, buttonPanel);
this.dialog.setDefaultButton(okButton);
}
use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.
the class LaunchApplicationWindow method initGUI.
private void initGUI() {
this.parameterPanel = new GridPanel(true);
this.instanceNameTextField = new XBayaTextField();
XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
GridPanel infoPanel = new GridPanel();
infoPanel.add(instanceNameLabel);
infoPanel.add(this.instanceNameTextField);
infoPanel.layout(1, 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 event) {
try {
execute();
} catch (AiravataClientConnectException e) {
logger.error(e.getMessage(), e);
} catch (InvalidRequestException e) {
logger.error(e.getMessage(), e);
} catch (AiravataClientException e) {
logger.error(e.getMessage(), e);
} catch (AiravataSystemException e) {
logger.error(e.getMessage(), e);
} catch (TException e) {
logger.error(e.getMessage(), e);
}
}
});
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);
}
Aggregations