Examples of GridPanel


Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel

      public void actionPerformed(ActionEvent arg0) {
        setForceFileStagingToWorkDir(chkForceFileStagingToWorkDir.isSelected());
      }
         
        });
        GridPanel buttonPane = new GridPanel();
        {
            GridBagLayout gbl_buttonPane = new GridBagLayout();
            gbl_buttonPane.columnWidths = new int[] { 307, 136, 0 };
            gbl_buttonPane.rowHeights = new int[] { 33, 0 };
            gbl_buttonPane.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
            gbl_buttonPane.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
           

            lblError = new JLabel("");
            lblError.setForeground(Color.RED);
            GridBagConstraints gbc_lblError = new GridBagConstraints();
            gbc_lblError.insets = new Insets(0, 0, 0, 5);
            gbc_lblError.gridx = 0;
            gbc_lblError.gridy = 0;
            buttonPane.add(lblError);
            JPanel panel = new JPanel();
            GridBagConstraints gbc_panel = new GridBagConstraints();
            gbc_panel.anchor = GridBagConstraints.NORTHWEST;
            gbc_panel.gridx = 1;
            gbc_panel.gridy = 0;
            buttonPane.add(panel);
            {
              JButton resetButton = new JButton("Reset");
                resetButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                      loadData();
                    }
                });
                panel.add(resetButton);
            }
            {
                okButton = new JButton("Register");
                if (!isNewDescription()){
                  okButton.setText("Update");
                }
                okButton.setEnabled(false);
                okButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        try {
                            if ("Register".equals(okButton.getText())) {
                                saveServiceDescription(false);
                            } else {
                                saveServiceDescription(true);
                            }
              close();
            } catch (AiravataAPIInvocationException e1) {
              e1.printStackTrace();
            }
                    }
                });
                panel.add(okButton);
                okButton.setActionCommand("OK");
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setServiceCreated(false);
                        close();
                    }
                });
                panel.add(cancelButton);
                cancelButton.setActionCommand("Cancel");
            }
        }
        contentPanel.add(lblServiceName);
        contentPanel.add(txtApplicationServiceName);
        GridPanel pnlTables=new GridPanel();
       
        GridPanel parameterPanel=new GridPanel();
    parameterPanel.add(lblInputParameters);
        parameterPanel.add(scrollPane);
      parameterPanel.add(btnDeleteParameter);
      parameterPanel.add(chkForceFileStagingToWorkDir);
     
        SwingUtil.layoutToGrid(contentPanel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
      SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 4, 1, 1, 0);
     
      pnlTables.add(parameterPanel);
      pnlTables.add(createHostDeploymentTable());
     
      pnlTables.layout(2, 1, SwingUtil.WEIGHT_EQUALLY, 0);
     
        GridPanel infoPanel = new GridPanel();
    infoPanel.add(contentPanel);
    infoPanel.add(pnlTables);
        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
    infoPanel.layout(2, 1, 1, 0);
    getContentPane().add(infoPanel.getSwingComponent());
        getContentPane().add(buttonPane.getSwingComponent());
        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
        setResizable(true);
        getRootPane().setDefaultButton(okButton);
View Full Code Here

Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel

          }
        });
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setViewportView(tblHosts);
       
        GridPanel pnlTableButtons = new GridPanel();
        pnlTableButtons.add(btnNewDeployment);
        pnlTableButtons.add(btnEditDeployment);
        pnlTableButtons.add(btnDeleteDeployment);
        pnlTableButtons.layout(1, 3,SwingUtil.WEIGHT_NONE,SwingUtil.WEIGHT_EQUALLY);
       
        GridPanel pnlMainPanel = new GridPanel();
        pnlMainPanel.add(scrollPane);
       
        pnlMainPanel.add(pnlTableButtons);
        pnlMainPanel.layout(2, 1, 0, 0);
        btnEditDeployment.setEnabled(false);
      btnDeleteDeployment.setEnabled(false);
        return pnlMainPanel;
  }
View Full Code Here

Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel

    private void initGUI() {
      descriptorList= new JList(new DefaultListModel());
      descriptorList.setCellRenderer(new DescriptorListCellRenderer(descriptorType));
      JScrollPane pane = new JScrollPane(descriptorList);

      GridPanel infoPanel=new GridPanel();
        infoPanel.add(pane);
        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);

        descriptorList.addListSelectionListener(new ListSelectionListener(){
      @Override
      public void valueChanged(ListSelectionEvent e) {
        boolean isSelected=descriptorList.getSelectedIndex()!=-1;
        okButton.setEnabled(isSelected);
      }
         
        });
        okButton = new JButton("OK");
        okButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              serviceSelected=true;
              close();
            }

        });
        JButton closeButton = new JButton("Cancel");
        closeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                close();
            }
        });
       

        GridPanel buttonPanel = new GridPanel();
        buttonPanel.add(okButton);
        buttonPanel.add(closeButton);
        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
        String title=null;
        switch (descriptorType){
          case HOST:
            title="Host Descriptions";
            break;
          case SERVICE:
            title="Service Descriptions";
            break;
          case APPLICATION:
            title="Application Descriptions";
            break;
        }
        getContentPane().add(infoPanel.getSwingComponent());
        getContentPane().add(buttonPanel.getSwingComponent());
        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
        getRootPane().setDefaultButton(okButton);
        okButton.setEnabled(false);
        loadDescriptors();
    }
View Full Code Here

Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel

      setTitle("Update Application Description: "+ getOriginalDescription().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);
          JPanel execPath=new JPanel();
            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);
            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
            btnExecBrowse.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.getSwingComponent());
            execPath.add(btnExecBrowse);
            JButton btnIOParameters = new JButton("IO Parameters...");
            btnIOParameters.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent event) {
          try {
                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
                        serviceDescriptionDialog.open();
                        if (serviceDescriptionDialog.isServiceCreated()) {
                          setServiceDescription(serviceDescriptionDialog.getServiceDescription());
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
        }
            });
            execPath.add(new JLabel("   "));
            execPath.add(btnIOParameters);
           
            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());

            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);
            JLabel lblExecutablePath = new JLabel("Executable path");
          JPanel tmpDirPath=new JPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
            txtTempDir.setColumns(10);
            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
            btnTmpDirBrowse.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());
          }
        }
            });
            JTextField component = txtTempDir.getSwingComponent();
      tmpDirPath.add(component);
            tmpDirPath.add(btnTmpDirBrowse);
//            tmpDirPath.layout(1, 2, 0, 0);
           
            setupLayoutForBrowse(tmpDirPath, component);


            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");

            JButton btnAdvance = new JButton("Advanced application configurations...");
            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());
                    }
                }
            });

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

            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
//            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
            lnkNewHost.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(), null);
                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
                        hostDescriptionDialog.open();

                        if (hostDescriptionDialog.isHostCreated()) {
                          ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(), "Host Descriptions", "Refreshing host list..", 0, 200);
                          int progress=1;
                          progressMonitor.setProgress(progress++);
                          while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
                              loadHostDescriptions();
                              cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
                              progressMonitor.setProgress(progress++);
                              Thread.sleep(50);
                          }
                          progressMonitor.setProgress(200);
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });
            lnkNewHost.setText("Create new host...");
            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);

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

            btnHostAdvanceOptions=new JButton("HPC 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());
                    }
        }
      });
            btnHostAdvanceOptions.setVisible(false);
            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(new JLabel());
//            infoPanel1.add(btnIOParameters);
            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(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(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
//            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 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(), 7, 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

Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel

      setTitle("Update Application Deployment: "+ getOriginalDescription().getType().getApplicationName().getStringValue());
    }
    setBounds(100, 100, 600, 620);
        setModal(true);
        setLocationRelativeTo(null);
        GridPanel buttonPane = new GridPanel();
        {
            lblError = new JLabel("");
            lblError.setForeground(Color.RED);
            buttonPane.add(lblError);
            if (!isNewDescriptor()){
              JButton resetButton = new JButton("Reset");
                resetButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        loadData();
                    }
                });
                buttonPane.add(resetButton);
            }
            {
                okButton = new JButton("Add");
                if (!isNewDescriptor()){
                  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 execPath=new JPanel();
            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);
            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
            btnExecBrowse.addActionListener(new ActionListener(){
        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.getSwingComponent());
            execPath.add(btnExecBrowse);
           
            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());

            JLabel lblExecutablePath = new JLabel("Executable path");
          JPanel tmpDirPath=new JPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
            txtTempDir.setColumns(10);
            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
            btnTmpDirBrowse.addActionListener(new ActionListener(){
        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());
          }
        }
            });
            JTextField component = txtTempDir.getSwingComponent();
      tmpDirPath.add(component);
            tmpDirPath.add(btnTmpDirBrowse);
           
            setupLayoutForBrowse(tmpDirPath, component);

            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");

            JButton btnAdvance = new JButton("Advanced application configurations...");
            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());
                    }
                }
            });

            cmbHostName = new JComboBox();
            cmbHostName.addActionListener(this);

            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
            lnkNewHost.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getRegistry(), null);
                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
                        hostDescriptionDialog.open();

                        if (hostDescriptionDialog.isHostCreated()) {
                          ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(), "Host Descriptions", "Refreshing host list..", 0, 200);
                          int progress=1;
                          progressMonitor.setProgress(progress++);
                          while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
                              loadHostDescriptions();
                              cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
                              progressMonitor.setProgress(progress++);
                              Thread.sleep(50);
                          }
                          progressMonitor.setProgress(200);
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });
            lnkNewHost.setText("Create new host...");
            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);

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

           
            infoPanel1.add(lblExecutablePath);
            infoPanel1.add(execPath);
            infoPanel1.add(lblTemporaryDirectory);
            infoPanel1.add(tmpDirPath);
           
            GridPanel infoPanel3 = new GridPanel();

            infoPanel3.add(lblHostName);
            infoPanel3.add(hostPanel);
            infoPanel3.add(new JLabel());
            infoPanel3.add(lnkNewHost);
           
            GridPanel infoPanel4=new GridPanel();
//            infoPanel4.add(new JLabel());
            infoPanel4.add(btnHostAdvanceOptions);
            infoPanel4.add(btnAdvance);
            infoPanel4.layout(1, 2, 0, 0);
           
            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);

            GridPanel infoPanel = new GridPanel();
            infoPanel.add(new JSeparator());
      infoPanel.add(infoPanel3);
            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel1);

            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel4);
           
            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 6, 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);
            loadHostDescriptions();
        }
        setResizable(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.