Search in sources :

Example 21 with GridPanel

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) HyperlinkEvent(javax.swing.event.HyperlinkEvent) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) URL(java.net.URL) StringSelection(java.awt.datatransfer.StringSelection) HyperlinkListener(javax.swing.event.HyperlinkListener) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) JEditorPane(javax.swing.JEditorPane) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction)

Example 22 with GridPanel

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);
}
Also used : XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 23 with GridPanel

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);
}
Also used : ActionEvent(java.awt.event.ActionEvent) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) XBayaList(org.apache.airavata.xbaya.ui.widgets.XBayaList) ListSelectionEvent(javax.swing.event.ListSelectionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) TitledBorder(javax.swing.border.TitledBorder) AbstractAction(javax.swing.AbstractAction) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 24 with GridPanel

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);
}
Also used : ApplicationSettingsException(org.apache.airavata.common.exception.ApplicationSettingsException) XBayaComboBox(org.apache.airavata.xbaya.ui.widgets.XBayaComboBox) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ThriftClientData(org.apache.airavata.xbaya.ThriftClientData) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 25 with GridPanel

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);
}
Also used : TException(org.apache.thrift.TException) JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) AiravataSystemException(org.apache.airavata.model.error.AiravataSystemException) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) AiravataClientConnectException(org.apache.airavata.model.error.AiravataClientConnectException) InvalidRequestException(org.apache.airavata.model.error.InvalidRequestException) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AiravataClientException(org.apache.airavata.model.error.AiravataClientException) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Aggregations

ActionEvent (java.awt.event.ActionEvent)36 GridPanel (org.apache.airavata.xbaya.ui.widgets.GridPanel)36 XBayaDialog (org.apache.airavata.xbaya.ui.dialogs.XBayaDialog)33 XBayaLabel (org.apache.airavata.xbaya.ui.widgets.XBayaLabel)31 XBayaTextField (org.apache.airavata.xbaya.ui.widgets.XBayaTextField)31 AbstractAction (javax.swing.AbstractAction)30 JButton (javax.swing.JButton)30 JPanel (javax.swing.JPanel)28 XBayaTextArea (org.apache.airavata.xbaya.ui.widgets.XBayaTextArea)11 JSpinner (javax.swing.JSpinner)8 SpinnerNumberModel (javax.swing.SpinnerNumberModel)8 JLabel (javax.swing.JLabel)5 TitledBorder (javax.swing.border.TitledBorder)4 ActionListener (java.awt.event.ActionListener)3 EtchedBorder (javax.swing.border.EtchedBorder)3 XBayaComboBox (org.apache.airavata.xbaya.ui.widgets.XBayaComboBox)3 StringSelection (java.awt.datatransfer.StringSelection)2 URL (java.net.URL)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 JCheckBox (javax.swing.JCheckBox)2