Package org.apache.airavata.xbaya.gui

Examples of org.apache.airavata.xbaya.gui.GridPanel


        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();
View Full Code Here


        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);

        this.metadataTextArea = new XBayaTextArea();
        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(nameLabel);
        mainPanel.add(this.nameTextField);
        mainPanel.add(descriptionLabel);
        mainPanel.add(this.descriptionTextArea);
        mainPanel.add(metadataLabel);
        mainPanel.add(this.metadataTextArea);
        mainPanel.layout(3, 2, 2, 1);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                setInput();
View Full Code Here

        this.valueLabel = new XBayaLabel("", this.valueTextField);

        this.metadataTextArea = new XBayaTextArea();
        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);

        this.gridPanel = new GridPanel();
        this.gridPanel.add(nameLabel);
        this.gridPanel.add(this.nameTextField);
        this.gridPanel.add(descriptionLabel);
        this.gridPanel.add(this.descriptionTextArea);
        this.gridPanel.add(this.valueLabel);
View Full Code Here

     */
    private void initGUI() {
        this.urlTextField = new XBayaTextField();
        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(urlLabel);
        infoPanel.add(this.urlTextField);
        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                ok();
View Full Code Here

        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);

        urlTextField.getSwingComponent().addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                updateURL();
View Full Code Here

                InstanceConfigurationDialog.this.instanceTypeComboBox.getJComboBox().setEnabled(true);
            }
        });
        this.instanceTypeComboBox = new XBayaComboBox(new DefaultComboBoxModel(AmazonUtil.INSTANCE_TYPE));
        this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
        GridPanel amiPanel = new GridPanel();
        amiPanel.add(this.amiButton);
        amiPanel.add(this.instanceTypeComboBox);
        amiPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);

        this.idButton = new JRadioButton("Use existing instance");
        this.idButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent paramActionEvent) {
                InstanceConfigurationDialog.this.instanceTypeComboBox.getJComboBox().setEnabled(false);
            }
        });
        ButtonGroup serviceTypeButtonGroup = new ButtonGroup();
        serviceTypeButtonGroup.add(this.amiButton);
        serviceTypeButtonGroup.add(this.idButton);
        XBayaLabel radioLabel = new XBayaLabel("Options", this.amiButton);

        /*
         * AMI/Instance ID
         */
        this.idTextField = new XBayaTextField();
        XBayaLabel idLabel = new XBayaLabel("AMI/Instance ID", this.amiButton);

        /*
         * Username
         */
        this.usernameTextField = new XBayaTextField();
        XBayaLabel usernameLabel = new XBayaLabel("Username", this.amiButton);

        GridPanel gridPanel = new GridPanel();
        gridPanel.add(nameLabel);
        gridPanel.add(this.nameTextField);
        gridPanel.add(radioLabel);
        gridPanel.add(amiPanel);
        gridPanel.add(new JPanel());
        gridPanel.add(this.idButton);
        gridPanel.add(idLabel);
        gridPanel.add(this.idTextField);
        gridPanel.add(usernameLabel);
        gridPanel.add(this.usernameTextField);
        gridPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                if (InstanceConfigurationDialog.this.idTextField.getText() == null
View Full Code Here

        this.wsdlTextArea = new XBayaTextArea();
        this.wsdlTextArea.setEditable(false);
        XBayaLabel wsdlLabel = new XBayaLabel("WSDL", this.wsdlTextArea);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(nameLabel);
        infoPanel.add(this.nameTextField);
        infoPanel.add(idLabel);
        infoPanel.add(this.idTextField);
        infoPanel.add(typeLabel);
        infoPanel.add(this.typeTextField);
        infoPanel.add(wsdlLabel);
        infoPanel.add(this.wsdlTextArea);
        infoPanel.layout(4, 2, 3, 1);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                hide();
View Full Code Here

        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);

        this.visibilityTextField = new XBayaTextField();
        XBayaLabel visibilityLabel = new XBayaLabel("Visibility", this.visibilityTextField);

        this.gridPanel = new GridPanel();
        this.gridPanel.add(nameLabel);
        this.gridPanel.add(this.nameTextField);
        this.gridPanel.add(visibilityLabel);
        this.gridPanel.add(this.visibilityTextField);
        this.gridPanel.add(descriptionLabel);
View Full Code Here

        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);

        this.metadataTextArea = new XBayaTextArea();
        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(nameLabel);
        mainPanel.add(this.nameTextField);
        mainPanel.add(templateIDLabel);
        mainPanel.add(this.templateIDField);
        mainPanel.add(instanceIDLabel);
        mainPanel.add(this.instanceIDField);
        mainPanel.add(descriptionLabel);
        mainPanel.add(this.descriptionTextArea);
        mainPanel.add(metadataLabel);
        mainPanel.add(this.metadataTextArea);
        mainPanel.layout(new double[] { 0, 0, 0, 0.5, 0.5 }, new double[] { 0, 1 });

        this.okButton = new JButton("OK");
        this.okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                setToWorkflow();
View Full Code Here

      setTitle("Update Deployment Description: "+getOriginalDeploymentDescription().getType().getApplicationName().getStringValue());
    }
    setBounds(100, 100, 600, 620);
        setModal(true);
        setLocationRelativeTo(null);
        GridPanel buttonPane = new GridPanel();
//        getContentPane().setLayout(new BorderLayout());
        {
         
//            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
//            getContentPane().add(buttonPane, BorderLayout.SOUTH);

            lblError = new JLabel("");
            lblError.setForeground(Color.RED);
            buttonPane.add(lblError);
            if (!isNewDescritor()){
              JButton resetButton = new JButton("Reset");
                resetButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        loadData();
                    }
                });
                buttonPane.add(resetButton);
            }
            {
                okButton = new JButton("Save");
                if (!isNewDescritor()){
                  okButton.setText("Update");
                }
                okButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        saveApplicationDescription();
                        close();
                    }
                });
                okButton.setEnabled(false);
                okButton.setActionCommand("OK");
                buttonPane.add(okButton);
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setApplicationDescCreated(false);
                        close();
                    }
                });
                cancelButton.setActionCommand("Cancel");
                buttonPane.add(cancelButton);
            }
        }
        {
//            JPanel panel = new JPanel();
//            getContentPane().add(panel, BorderLayout.CENTER);
          GridPanel execPath=new GridPanel();
            txtExecPath = new XBayaTextField();
            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setExecutablePath(txtExecPath.getText());
                }
            });
            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
              @Override
              public void focusLost(FocusEvent e) {
                super.focusLost(e);
                updateTempDirWithExecPath(txtExecPath.getText());
              }
      });
            txtExecPath.setColumns(10);
            JButton execBrowse=new JButton("Browse...");
            execBrowse.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtExecPath.setText(c.getSelectedFile().toString());
            setExecutablePath(txtExecPath.getText());
          }
        }
            });
            execPath.add(txtExecPath);
            execPath.add(execBrowse);
            execPath.layout(1, 2, 0, 0);
            txtAppName = new XBayaTextField();
            txtAppName.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent arg0) {
                    setApplicationName(txtAppName.getText());
                }
            });
            txtAppName.setColumns(10);
            XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
            XBayaLabel lblExecutablePath = new XBayaLabel("Executable path",txtExecPath);
          GridPanel tmpDirPath=new GridPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
            txtTempDir.setColumns(10);
            JButton tmpDirBrowse=new JButton("Browse...");
            tmpDirBrowse.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtTempDir.setText(c.getSelectedFile().toString());
            setTempDir(txtTempDir.getText());
          }
        }
            });
            tmpDirPath.add(txtTempDir);
            tmpDirPath.add(tmpDirBrowse);
            tmpDirPath.layout(1, 2, 0, 0);

            XBayaLabel lblTemporaryDirectory = new XBayaLabel("Temporary directory",txtTempDir);

            JButton btnAdvance = new JButton("Advanced options...");
            btnAdvance.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
                                getRegistry(), getShellApplicationDescription());
                        serviceDescriptionDialog.open();
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });

            XBayaLinkButton lnkNewService = new XBayaLinkButton("New button");
            lnkNewService.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent arg0) {
                    try {
                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
                        serviceDescriptionDialog.open();
                        if (serviceDescriptionDialog.isServiceCreated()) {
                            loadServiceDescriptions();
                            cmbServiceName.setSelectedItem(serviceDescriptionDialog.getServiceName());
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });
            lnkNewService.setText("Create new service...");
            lnkNewService.setHorizontalAlignment(SwingConstants.TRAILING);

            cmbServiceName = new JComboBox();
            cmbServiceName.addActionListener(this);
//            cmbServiceName.setRenderer(new DefaultListCellRenderer());
            cmbHostName = new JComboBox();
            cmbHostName.addActionListener(this);

            XBayaLabel lblHostName = new XBayaLabel("Host",cmbHostName);

            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
            lnkNewHost.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
                        hostDescriptionDialog.open();

                        if (hostDescriptionDialog.isHostCreated()) {
                            loadHostDescriptions();
                            cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });
            lnkNewHost.setText("Create new host...");
            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);

            XBayaLabel lblService = new XBayaLabel("Service",cmbServiceName);

            JLabel lblBindThisDeployment = new JLabel("Bind this deployment description to:");
            lblBindThisDeployment.setFont(new Font("Tahoma", Font.BOLD, 11));

            btnHostAdvanceOptions=new JButton("Gram Configuration...");
            btnHostAdvanceOptions.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
          try {
            ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(getRegistry(),getShellApplicationDescription());
                        hostAdvancedOptionsDialog.open();
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
        }
      });
           
            GridPanel hostPanel=new GridPanel();
            hostPanel.add(cmbHostName);
            hostPanel.add(btnHostAdvanceOptions);
           
            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
            GridPanel infoPanel0 = new GridPanel();

            infoPanel0.add(lblApplicationName);
            infoPanel0.add(txtAppName);
           
            GridPanel infoPanel1 = new GridPanel();

           
            infoPanel1.add(lblExecutablePath);
            infoPanel1.add(execPath);
            infoPanel1.add(lblTemporaryDirectory);
            infoPanel1.add(tmpDirPath);
//            infoPanel1.add(new JLabel());
//            infoPanel1.add(btnAdvance);
           
            GridPanel infoPanel2 = new GridPanel();
//            infoPanel2.add(new JSeparator());
            infoPanel2.add(lblBindThisDeployment);
           
            GridPanel infoPanel3 = new GridPanel();

            infoPanel3.add(lblService);
            infoPanel3.add(cmbServiceName);
            infoPanel3.add(new JLabel());
            infoPanel3.add(lnkNewService);
            infoPanel3.add(lblHostName);
            infoPanel3.add(hostPanel);
            infoPanel3.add(new JLabel());
            infoPanel3.add(lnkNewHost);
           
            GridPanel infoPanel4=new GridPanel();
            infoPanel4.add(new JLabel());
            infoPanel4.add(btnAdvance);
            infoPanel4.layout(1, 2, 0, 0);
           
            SwingUtil.layoutToGrid(infoPanel0.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);

            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 4, 2, SwingUtil.WEIGHT_NONE, 1);

            GridPanel infoPanel = new GridPanel();
            infoPanel.add(infoPanel0);
            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel1);
            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel2);
            infoPanel.add(infoPanel3);
            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel4);
           
            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 8, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),SwingUtil.WEIGHT_NONE,0);
            getContentPane().add(infoPanel.getSwingComponent());
            getContentPane().add(buttonPane.getSwingComponent());
           
            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());

            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
            loadServiceDescriptions();
            loadHostDescriptions();
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.gui.GridPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.