Search in sources :

Example 6 with XBayaTextField

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextField 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)

Example 7 with XBayaTextField

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

the class InputConfigurationDialog method initGui.

/**
 * Initializes the GUI.
 */
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);
    // for string
    this.valueTextField = new XBayaTextField();
    this.valueLabel = new XBayaLabel("Value", this.valueTextField);
    this.dataTypeTextField = new XBayaTextField();
    this.dataTypeTextField.setEditable(false);
    this.dataTypeLabel = new XBayaLabel("Type", this.dataTypeTextField);
    this.gridPanel = new GridPanel();
    this.gridPanel.add(nameLabel);
    this.gridPanel.add(this.nameTextField);
    this.gridPanel.add(this.valueLabel);
    this.gridPanel.add(this.valueTextField);
    this.gridPanel.add(this.dataTypeLabel);
    this.gridPanel.add(this.dataTypeTextField);
    this.gridPanel.add(descriptionLabel);
    this.gridPanel.add(this.descriptionTextArea);
    this.gridPanel.layout(4, 2, 3, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setInput();
        }
    });
    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);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Input Parameter Configuration", this.gridPanel, buttonPanel);
    this.dialog.setDefaultButton(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 8 with XBayaTextField

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

the class ReceiveConfigurationDialog method initGui.

/**
 * Initializes the GUI.
 */
private void initGui() {
    this.nameTextField = new XBayaTextField();
    this.nameTextField.setEditable(false);
    XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
    this.idTextField = new XBayaTextField();
    this.idTextField.setEditable(false);
    XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
    SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
    this.numPorts = new JSpinner(model);
    XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
    GridPanel gridPanel = new GridPanel();
    gridPanel.add(nameLabel);
    gridPanel.add(this.nameTextField);
    gridPanel.add(idLabel);
    gridPanel.add(this.idTextField);
    gridPanel.add(numPortLabel);
    gridPanel.add(this.numPorts);
    gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setInput();
        }
    });
    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);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Receive Configuration", gridPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : SpinnerNumberModel(javax.swing.SpinnerNumberModel) 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) JSpinner(javax.swing.JSpinner) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 9 with XBayaTextField

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

the class MonitorConfigurationWindow method initGui.

private void initGui() {
    this.brokerTextField = new XBayaTextField();
    XBayaLabel brokerLabel = new XBayaLabel("Broker URL", this.brokerTextField);
    this.topicTextField = new XBayaTextField();
    XBayaLabel topicLabel = new XBayaLabel("Topic", this.topicTextField);
    this.pullCheckBox = new JCheckBox("Pull Mode");
    JLabel dummyLabel = new JLabel();
    this.messageBoxTextField = new XBayaTextField();
    XBayaLabel msgBoxLabel = new XBayaLabel("Message Box URL", this.messageBoxTextField);
    this.messageBoxTextField.setEnabled(false);
    this.pullCheckBox.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent event) {
            int stateChange = event.getStateChange();
            if (stateChange == ItemEvent.SELECTED) {
                MonitorConfigurationWindow.this.messageBoxTextField.setEnabled(true);
            } else if (stateChange == ItemEvent.DESELECTED) {
                MonitorConfigurationWindow.this.messageBoxTextField.setEnabled(false);
            }
        }
    });
    GridPanel infoPanel = new GridPanel();
    infoPanel.add(brokerLabel);
    infoPanel.add(this.brokerTextField);
    infoPanel.add(topicLabel);
    infoPanel.add(this.topicTextField);
    infoPanel.add(dummyLabel);
    infoPanel.add(this.pullCheckBox);
    infoPanel.add(msgBoxLabel);
    infoPanel.add(this.messageBoxTextField);
    infoPanel.layout(4, 2, SwingUtil.WEIGHT_NONE, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setConfiguration();
        }
    });
    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);
    this.dialog = new XBayaDialog(this.engine.getGUI(), "Notification Configuration", infoPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) ItemEvent(java.awt.event.ItemEvent) 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) JLabel(javax.swing.JLabel) ItemListener(java.awt.event.ItemListener) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 10 with XBayaTextField

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

the class MonitorWindow method init.

private void init() {
    this.timeTextField = new XBayaTextField();
    this.timeTextField.setEditable(false);
    XBayaLabel timeLabel = new XBayaLabel(EventDataRepository.Column.TIME.getName(), this.timeTextField);
    this.idTextField = new XBayaTextField();
    this.idTextField.setEditable(false);
    XBayaLabel idLabel = new XBayaLabel(EventDataRepository.Column.ID.getName(), this.idTextField);
    this.statusTextField = new XBayaTextField();
    this.statusTextField.setEditable(false);
    XBayaLabel statusLabel = new XBayaLabel(EventDataRepository.Column.STATUS.getName(), this.statusTextField);
    this.messageTextArea = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, "");
    this.messageTextArea.setSize(500, 500);
    this.messageTextArea.setEditable(false);
    messageTextArea.setBackground(Color.WHITE);
    messageTextArea.addHyperlinkListener(new HyperlinkListener() {

        public void hyperlinkUpdate(HyperlinkEvent event) {
            if (event.getEventType() == EventType.ACTIVATED) {
                URL url = event.getURL();
                try {
                    BrowserLauncher.openURL(url.toString());
                } catch (Exception e) {
                    MonitorWindow.this.xbayaGUI.getErrorWindow().error(MonitorWindow.this.dialog.getDialog(), e.getMessage(), e);
                }
            }
        }
    });
    JScrollPane pane = new JScrollPane(messageTextArea);
    pane.setSize(500, 500);
    XBayaLabel messageLabel = new XBayaLabel(EventDataRepository.Column.MESSAGE.getName(), pane);
    GridPanel infoPanel = new GridPanel();
    infoPanel.add(timeLabel);
    infoPanel.add(this.timeTextField);
    infoPanel.add(idLabel);
    infoPanel.add(this.idTextField);
    infoPanel.add(statusLabel);
    infoPanel.add(this.statusTextField);
    infoPanel.add(messageLabel);
    infoPanel.add(pane);
    infoPanel.layout(4, 2, 3, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JButton copyButton = new JButton("Copy to Clipboard");
    copyButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(messageText), null);
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);
    buttonPanel.add(copyButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Notification", infoPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : HyperlinkEvent(javax.swing.event.HyperlinkEvent) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) ActionEvent(java.awt.event.ActionEvent) URL(java.net.URL) StringSelection(java.awt.datatransfer.StringSelection) HyperlinkListener(javax.swing.event.HyperlinkListener) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Aggregations

XBayaTextField (org.apache.airavata.xbaya.ui.widgets.XBayaTextField)35 XBayaLabel (org.apache.airavata.xbaya.ui.widgets.XBayaLabel)32 ActionEvent (java.awt.event.ActionEvent)31 GridPanel (org.apache.airavata.xbaya.ui.widgets.GridPanel)31 XBayaDialog (org.apache.airavata.xbaya.ui.dialogs.XBayaDialog)30 AbstractAction (javax.swing.AbstractAction)26 JButton (javax.swing.JButton)26 JPanel (javax.swing.JPanel)25 JSpinner (javax.swing.JSpinner)8 SpinnerNumberModel (javax.swing.SpinnerNumberModel)8 XBayaTextArea (org.apache.airavata.xbaya.ui.widgets.XBayaTextArea)8 JLabel (javax.swing.JLabel)5 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)4 AiravataSystemException (org.apache.airavata.model.error.AiravataSystemException)4 InvalidRequestException (org.apache.airavata.model.error.InvalidRequestException)4 TException (org.apache.thrift.TException)4 ActionListener (java.awt.event.ActionListener)3 XBayaComboBox (org.apache.airavata.xbaya.ui.widgets.XBayaComboBox)3 StringSelection (java.awt.datatransfer.StringSelection)2 URL (java.net.URL)2