Search in sources :

Example 1 with GridPanel

use of org.apache.airavata.xbaya.ui.widgets.GridPanel 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);
}
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) JLabel(javax.swing.JLabel) 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)

Example 2 with GridPanel

use of org.apache.airavata.xbaya.ui.widgets.GridPanel 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();
}
Also used : XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ActionListener(java.awt.event.ActionListener) 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 3 with GridPanel

use of org.apache.airavata.xbaya.ui.widgets.GridPanel in project airavata by apache.

the class WorkflowImportWindow method initGUI.

/**
 * Initializes the GUI
 */
private void initGUI() {
    this.list = new XbayaEnhancedList<RegistrySearchResult>();
    this.list.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() >= 2) {
                // double click is same as cliking the OK button.
                WorkflowImportWindow.this.okButton.doClick();
            }
            if (WorkflowImportWindow.this.list.getSelectedIndex() == -1) {
                WorkflowImportWindow.this.okButton.setEnabled(false);
                WorkflowImportWindow.this.deleteButton.setEnabled(false);
            } else {
                WorkflowImportWindow.this.okButton.setEnabled(true);
                WorkflowImportWindow.this.deleteButton.setEnabled(true);
            }
        // if (WorkflowImportWindow.this.list.getSelectedIndex() == 2) {
        // WorkflowImportWindow.this.okButton.setEnabled(false);
        // WorkflowImportWindow.this.deleteButton.setEnabled(true);
        // } else if (WorkflowImportWindow.this.list.getSelectedIndex() != 1) {
        // WorkflowImportWindow.this.okButton.setEnabled(true);
        // WorkflowImportWindow.this.deleteButton.setEnabled(true);
        // } else {
        // WorkflowImportWindow.this.okButton.setEnabled(false);
        // WorkflowImportWindow.this.deleteButton.setEnabled(false);
        // }
        }
    });
    GridPanel mainPanel = new GridPanel();
    TitledBorder border = new TitledBorder(new EtchedBorder(), "Select a workflow to load");
    mainPanel.getSwingComponent().setBorder(border);
    mainPanel.add(this.list);
    mainPanel.layout(1, 1, 0, 0);
    JPanel buttonPanel = new JPanel();
    this.okButton = new JButton("Load");
    this.okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            ok();
        }
    });
    buttonPanel.add(this.okButton);
    this.deleteButton = new JButton("Delete");
    this.deleteButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            delete();
        }
    });
    buttonPanel.add(this.deleteButton);
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.engine.getGUI(), "Load a Workflow from the Registry", mainPanel, buttonPanel);
    this.dialog.setDefaultButton(this.okButton);
}
Also used : JPanel(javax.swing.JPanel) RegistrySearchResult(org.apache.airavata.xbaya.ui.experiment.RegistrySearchResult) MouseEvent(java.awt.event.MouseEvent) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ActionEvent(java.awt.event.ActionEvent) MouseAdapter(java.awt.event.MouseAdapter) JButton(javax.swing.JButton) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) AbstractAction(javax.swing.AbstractAction)

Example 4 with GridPanel

use of org.apache.airavata.xbaya.ui.widgets.GridPanel 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);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 5 with GridPanel

use of org.apache.airavata.xbaya.ui.widgets.GridPanel 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);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) EtchedBorder(javax.swing.border.EtchedBorder) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ActionEvent(java.awt.event.ActionEvent) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) JButton(javax.swing.JButton) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) TitledBorder(javax.swing.border.TitledBorder) 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