airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1220599 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: appwrapper/ menues/xbaya/ registrybrowser/nodes/
Date Mon, 19 Dec 2011 03:33:04 GMT
Author: samindaw
Date: Mon Dec 19 03:33:04 2011
New Revision: 1220599

URL: http://svn.apache.org/viewvc?rev=1220599&view=rev
Log:
updating host desc dialog to use it self as the dialog class

Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/xbaya/XBayaMenuItem.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java?rev=1220599&r1=1220598&r2=1220599&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
Mon Dec 19 03:33:04 2011
@@ -290,7 +290,7 @@ public class ApplicationDescriptionDialo
                 public void actionPerformed(ActionEvent e) {
                     try {
                         HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
-                        hostDescriptionDialog.show();
+                        hostDescriptionDialog.open();
 
                         if (hostDescriptionDialog.isHostCreated()) {
                             loadHostDescriptions();

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java?rev=1220599&r1=1220598&r2=1220599&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
Mon Dec 19 03:33:04 2011
@@ -192,7 +192,7 @@ public class DescriptorEditorDialog exte
     	switch (descriptorType){
 	    	case HOST:
 	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
-	    		hostDescriptionDialog.show();
+	    		hostDescriptionDialog.open();
 	    		if (hostDescriptionDialog.isHostCreated()){
 	    			loadDescriptors();
 	    		}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java?rev=1220599&r1=1220598&r2=1220599&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
Mon Dec 19 03:33:04 2011
@@ -21,6 +21,19 @@
 
 package org.apache.airavata.xbaya.appwrapper;
 
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.regex.Pattern;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+
 import org.apache.airavata.common.utils.SwingUtil;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.registry.api.Registry;
@@ -29,23 +42,14 @@ import org.apache.airavata.schemas.gfac.
 import org.apache.airavata.schemas.gfac.HostDescriptionType;
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.gui.GridPanel;
-import org.apache.airavata.xbaya.gui.XBayaDialog;
 import org.apache.airavata.xbaya.gui.XBayaLabel;
 import org.apache.airavata.xbaya.gui.XBayaTextField;
 
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.util.regex.Pattern;
-
 public class HostDescriptionDialog extends JDialog {
 
-    private XBayaEngine engine;
+	private static final long serialVersionUID = -2910634296292034085L;
 
-    private XBayaDialog dialog;
+	private XBayaEngine engine;
 
     private XBayaTextField hostIdTextField;
 
@@ -57,8 +61,6 @@ public class HostDescriptionDialog exten
 
     private HostDescription hostDescription;
 
-    private GlobusHostType globusHostType;
-
     private boolean hostCreated = false;
 
     private Registry registry;
@@ -73,7 +75,7 @@ public class HostDescriptionDialog exten
 
     private String hostId;
 
-    JButton okButton = new JButton("OK");
+    private JButton okButton;
 
     /**
      * @param engine XBaya workflow engine
@@ -87,12 +89,13 @@ public class HostDescriptionDialog exten
     /**
      * Displays the dialog.
      */
-    public void show() {
-        this.dialog.show();
+    public void open() {
+		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+		setVisible(true);
     }
 
-    public void hide() {
-        this.dialog.hide();
+    public void close() {
+    	setVisible(false);
     }
 
     private void ok() {
@@ -109,7 +112,7 @@ public class HostDescriptionDialog exten
         }
 
         saveHostDescription();
-        hide();
+        close();
     }
 
 	private boolean isGlobusHostType() {
@@ -120,34 +123,18 @@ public class HostDescriptionDialog exten
         ((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(epr);
     }
 
-    private String[] getGlobusGateKeeperEPR(String epr) {
-        if (hostDescription.getType() instanceof GlobusHostType) {
-            return ((GlobusHostType)hostDescription.getType()).getGlobusGateKeeperEndPointArray();
-        } else {
-            return null;
-        }
-    }
-
-    private String getServiceName() {
-        return this.hostId;
-    }
-
     private void setGridFTPEPR(String epr) {
         ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(epr);
     }
 
-    private String[] getGridFTPEPR() {
-        if (hostDescription.getType() instanceof GlobusHostType) {
-            return ((GlobusHostType)hostDescription.getType()).getGridFTPEndPointArray();
-        } else {
-            return null;
-        }
-    }
-
     /**
      * Initializes the GUI.
      */
     private void initGUI() {
+    	setBounds(100, 100, 400, 280);
+    	setModal(true);
+        setLocationRelativeTo(null);
+        setTitle("New Host Description");
         this.hostIdTextField = new XBayaTextField();
         this.hostAddressTextField = new XBayaTextField();
         this.globusGateKeeperTextField = new XBayaTextField();
@@ -169,10 +156,10 @@ public class HostDescriptionDialog exten
             public void keyPressed(KeyEvent e) {
                 try {
                     validateDialog();
+                    setError(null);
                 } catch (Exception e1) {
                     setError(e1.getMessage());
                 }
-                setError(null);
             }
         });
         GridPanel infoPanel1 = new GridPanel();
@@ -197,30 +184,36 @@ public class HostDescriptionDialog exten
         infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
         SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 3, 1, SwingUtil.WEIGHT_NONE,
0);
 
+        GridPanel buttonPanel = new GridPanel();
+        lblError = new JLabel();
+        lblError.setForeground(Color.RED);
+        buttonPanel.add(lblError);
+        okButton = new JButton("OK");
         okButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                 ok();
             }
         });
 
+        buttonPanel.add(okButton);
+
         JButton cancelButton = new JButton("Cancel");
         cancelButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
-                hide();
+                close();
             }
         });
-
-        GridPanel buttonPanel = new GridPanel();
-        lblError = new JLabel("xcf");
-        lblError.setForeground(Color.RED);
-        buttonPanel.add(lblError);
-
-        buttonPanel.add(okButton);
+        
         buttonPanel.add(cancelButton);
         buttonPanel.layout(1,3,SwingUtil.WEIGHT_NONE,0);
         buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        this.dialog = new XBayaDialog(this.engine, "New Host Description", infoPanel, buttonPanel);
-        this.dialog.setDefaultButton(okButton);
+        
+        getContentPane().add(infoPanel.getSwingComponent());
+        getContentPane().add(buttonPanel.getSwingComponent());
+        
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        
+        getRootPane().setDefaultButton(okButton);
         chkGobusHost.setSelected(false);
         updateGlobusHostTypeAndControls();
     }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/xbaya/XBayaMenuItem.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/xbaya/XBayaMenuItem.java?rev=1220599&r1=1220598&r2=1220599&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/xbaya/XBayaMenuItem.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/xbaya/XBayaMenuItem.java
Mon Dec 19 03:33:04 2011
@@ -333,7 +333,7 @@ public class XBayaMenuItem {
                     try {
                         HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(
                                 engine);
-                        hostDescriptionDialog.show();
+                        hostDescriptionDialog.open();
                     } catch (Exception e1) {
                         engine.getErrorWindow().error(e1);
                     }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java?rev=1220599&r1=1220598&r2=1220599&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
Mon Dec 19 03:33:04 2011
@@ -85,7 +85,7 @@ public class HostDescriptionsNode extend
             return true;
         } else if (action.equals(AddAction.ID)) {
             HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine());
-            //hostDescriptionDialog.open();
+            hostDescriptionDialog.open();
             if (hostDescriptionDialog.isHostCreated()) {
                 refresh();
                 reloadTreeNode(tree, this);



Mime
View raw message