Package org.apache.airavata.xbaya.gui

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


    }

    private void initGUI() {
        this.list = new XbayaEnhancedList<EC2InstanceResult>();

        GridPanel mainPanel = new GridPanel();
        TitledBorder border = new TitledBorder(new EtchedBorder(), "My Instances");
        mainPanel.getSwingComponent().setBorder(border);
        mainPanel.add(this.list);
        mainPanel.layout(1, 1, 0, 0);

        /*
         * Connect/Refresh Button
         */
        JButton refreshButton = new JButton("Refresh");
View Full Code Here


        XBayaLabel fileLabel = new XBayaLabel("Upload File Path", this.fileTextField);

        this.uploadBucketTextField = new XBayaTextField();
        XBayaLabel uploadBucketLabel = new XBayaLabel("Bucket Name", this.uploadBucketTextField);

        GridPanel uploadPanel = new GridPanel();
        uploadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Upload"));
        uploadPanel.add(fileLabel);
        uploadPanel.add(this.fileTextField);
        uploadPanel.add(uploadBucketLabel);
        uploadPanel.add(this.uploadBucketTextField);
        uploadPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);

        /*
         * Download Panel
         */if (AmazonCredential.getInstance().getAwsAccessKeyId().equals("AKIAI3GNMQVYA5LSQNEQ")) { // Avoid to use
                                                                                                    // default Aws
                                                                                                    // Access Key
            JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(), "Aws Access Key not set!",
                    "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        this.downloadBucketTextField = new XBayaTextField();
        XBayaLabel downloadBucketLabel = new XBayaLabel("Bucket Name", this.downloadBucketTextField);

        this.keyTextField = new XBayaTextField();
        XBayaLabel keyLabel = new XBayaLabel("Key Name", this.keyTextField);

        this.folderTextField = new XBayaTextField();
        XBayaLabel folderLabel = new XBayaLabel("Download Location", this.folderTextField);

        GridPanel downloadPanel = new GridPanel();
        downloadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Download"));
        downloadPanel.add(downloadBucketLabel);
        downloadPanel.add(this.downloadBucketTextField);
        downloadPanel.add(keyLabel);
        downloadPanel.add(this.keyTextField);
        downloadPanel.add(folderLabel);
        downloadPanel.add(this.folderTextField);
        downloadPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);

        /*
         * Button Panel
         */
        JButton refreshButton = new JButton("Connect/Refresh");
        refreshButton.addActionListener(new AbstractAction() {

            private ChangeCredentialWindow credentialWindow;

            @Override
            public void actionPerformed(ActionEvent e) {
                if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
                        || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
                    JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(),
                            "Aws Access Key not set!", "Error", JOptionPane.ERROR_MESSAGE);

                    if (this.credentialWindow == null) {
                        this.credentialWindow = new ChangeCredentialWindow(AmazonS3UtilsWindow.this.dialog.getDialog());
                    }
                    try {
                        this.credentialWindow.show();
                    } catch (Exception e1) {
                        xBayaEngine.getErrorWindow().error(e1);
                    }

                    return;
                }
                AmazonS3UtilsWindow.this.s3Tree.clean();
                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine, window.dialog.getDialog());
                bucketsLoader.load(getS3Service(), AmazonS3UtilsWindow.this.s3Tree);
            }
        });

        JButton uploadButton = new JButton("Upload");
        uploadButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if ((window.fileTextField.getText().length() != 0)
                        && (window.uploadBucketTextField.getText().length() != 0)) {
                    S3Uploader s3Uploader = new S3Uploader(xBayaEngine, window.dialog.getDialog());
                    s3Uploader.upload(getS3Service(), AmazonS3UtilsWindow.this.s3Tree,
                            window.uploadBucketTextField.getText(), window.fileTextField.getText());

                    window.fileTextField.setText("");
                    window.folderTextField.setText("");
                } else {
                    xBayaEngine.getErrorWindow().error(window.dialog.getDialog(),
                            "Please give input to every upload fields");
                }
            }
        });

        JButton downloadButton = new JButton("Download");
        downloadButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if ((window.downloadBucketTextField.getText().length() != 0)
                        && (window.keyTextField.getText().length() != 0)
                        && (window.folderTextField.getText().length() != 0)) {
                    S3Downloader s3Downloader = new S3Downloader(xBayaEngine, window.dialog.getDialog());
                    s3Downloader.download(getS3Service(), window.downloadBucketTextField.getText(),
                            window.keyTextField.getText(), window.folderTextField.getText());

                    window.downloadBucketTextField.setText("");
                    window.keyTextField.setText("");
                    window.folderTextField.setText("");

                } else {
                    xBayaEngine.getErrorWindow().error(window.dialog.getDialog(),
                            "Please give input to every download fields");
                }
            }
        });

        JButton fileButton = new JButton("Choose File & Flolder");
        fileButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                final JFileChooser fc = new JFileChooser();
                fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                int returnVal = fc.showOpenDialog(AmazonS3UtilsWindow.this.dialog.getDialog());

                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    String filePath = fc.getSelectedFile().getAbsolutePath();
                    File file = fc.getSelectedFile();
                    if (file.isFile()) {
                        window.fileTextField.setText(filePath);
                        window.folderTextField.setText("");
                    } else if (file.isDirectory()) {
                        window.folderTextField.setText(filePath);
                        window.fileTextField.setText("");
                    }
                }
            }
        });

        JButton cancelButton = new JButton("Cancel");
        cancelButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                hide();
            }
        });

        JPanel buttonPanel = new JPanel();
        buttonPanel.add(refreshButton);
        buttonPanel.add(uploadButton);
        buttonPanel.add(downloadButton);
        buttonPanel.add(fileButton);
        buttonPanel.add(cancelButton);

        /*
         * Main Panel
         */
        GridPanel mainPanel = new GridPanel(true);
        this.s3Tree = new S3Tree();
        mainPanel.add(new JScrollPane(this.s3Tree));
        mainPanel.add(uploadPanel);
        mainPanel.add(downloadPanel);
        mainPanel.layout(3, 1, 0, GridPanel.WEIGHT_EQUALLY);

        this.s3Tree.addTreeSelectionListener(new TreeSelectionListener() {
            @Override
            public void valueChanged(TreeSelectionEvent e) {
                DefaultMutableTreeNode node = AmazonS3UtilsWindow.this.s3Tree.getSelectedNode();
View Full Code Here

        this.myProxyChecker = new MyProxyChecker(this.engine);
        initGUI();
    }

    protected void initGUI() {
        this.parameterPanel = new GridPanel(true);

        this.topicTextField = new XBayaTextField();
        XBayaLabel topicLabel = new XBayaLabel("Notification Topic", this.topicTextField);

        // this.xRegistryTextField = new XBayaTextField();
        // XBayaLabel xRegistryLabel = new XBayaLabel("XRegistry URL", this.xRegistryTextField);

        this.gfacTextField = new XBayaTextField();
        XBayaLabel gfacLabel = new XBayaLabel("GFac URL", this.gfacTextField);

        this.inputFilepathField = new XBayaTextField();
        this.inputFilepathField.setText("/Users/fanye/Documents/fileList");
        XBayaLabel filePathLabel = new XBayaLabel("Input File", this.inputFilepathField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(topicLabel);
        infoPanel.add(this.topicTextField);
        // infoPanel.add(xRegistryLabel);
        // infoPanel.add(this.xRegistryTextField);
        infoPanel.add(gfacLabel);
        infoPanel.add(this.gfacTextField);
        infoPanel.add(filePathLabel);
        infoPanel.add(this.inputFilepathField);

        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(this.parameterPanel);
        mainPanel.add(infoPanel);
        mainPanel.layout(2, 1, 0, 0);

        this.invokeButton = new JButton("Invoke");
        this.invokeButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                execute();
View Full Code Here

        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);

        this.secretAccessKeyTextField = new XBayaTextField();
        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Access Key", this.secretAccessKeyTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(accessKeyIDLabel);
        infoPanel.add(this.accessKeyIDTextField);
        infoPanel.add(secretAccessKeyLabel);
        infoPanel.add(this.secretAccessKeyTextField);

        infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(infoPanel);
        mainPanel.layout(1, 1, GridPanel.WEIGHT_EQUALLY, GridPanel.WEIGHT_EQUALLY);

        JButton okButton = new JButton("Ok");
        okButton.addActionListener(new AbstractAction() {

            @Override
View Full Code Here

        XBayaLabel numPortLabel = new XBayaLabel("Number of Inputs", this.numPorts);

        this.xpathTextField = new XBayaTextField();
        XBayaLabel xpathLabel = new XBayaLabel("XPath", this.xpathTextField);

        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.add(xpathLabel);
        gridPanel.add(this.xpathTextField);
        gridPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);

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

     */
    private void initGui() {
        this.memoTextArea = new XBayaTextArea();
        XBayaLabel memoLabel = new XBayaLabel("Memo", this.memoTextArea);

        GridPanel gridPanel = new GridPanel();
        gridPanel.add(memoLabel);
        gridPanel.add(this.memoTextArea);
        gridPanel.layout(1, 2, 0, 1);

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

        this.wsdlLabel = new XBayaLabel("The EPR of the Stream Source", this.wsdlTextField);

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

        this.gridPanel = new GridPanel();
        this.gridPanel.add(wsdlLabel);
        this.gridPanel.add(this.wsdlTextField);
        this.gridPanel.add(descriptionLabel);
        this.gridPanel.add(this.descriptionTextField);
        this.gridPanel.layout(2, 2, 1, 1);
View Full Code Here

        XBayaLabel sourceEprLabel = new XBayaLabel("Source Endpoint", this.sourceEndpointTextField);
        XBayaLabel sourceFilePathLabel = new XBayaLabel("Source File Path", this.sourceFilePathTextField);
        XBayaLabel destEprLabel = new XBayaLabel("Destination Endpoint", this.destEndpointTextField);
        XBayaLabel destFilePathLabel = new XBayaLabel("Destination FIle path", this.destFilePathTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(nameLabel);
        infoPanel.add(this.usernameTextField);
        infoPanel.add(caFileLabel);
        infoPanel.add(this.caFileTextField);
        infoPanel.add(certFileLabel);
        infoPanel.add(certFileTextField);
        infoPanel.add(keyFileLabel);
        infoPanel.add(this.keyFileTextField);
        infoPanel.add(sourceEprLabel);
        infoPanel.add(this.sourceEndpointTextField);
        infoPanel.add(sourceFilePathLabel);
        infoPanel.add(this.sourceFilePathTextField);
        infoPanel.add(destEprLabel);
        infoPanel.add(this.destEndpointTextField);
        infoPanel.add(destFilePathLabel);
        infoPanel.add(this.destFilePathTextField);
        infoPanel.layout(8, 2, GridPanel.WEIGHT_NONE, 1);

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

            public void actionPerformed(ActionEvent e) {
                createNewUser();
            }
        });

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(urlLabel);
        infoPanel.add(this.urlTextField);
        infoPanel.add(nameLabel);
        infoPanel.add(this.usernameTextField);
        infoPanel.add(passLabel);
        infoPanel.add(this.passwordTextField);
        infoPanel.add(emptyLabel);
        infoPanel.add(this.newUserButton);
        infoPanel.layout(4, 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, "JCR Registry", infoPanel, buttonPanel);
        this.dialog.setDefaultButton(okButton);
    }
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

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.