airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1327669 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph: dynamic/gui/DynamicWorkflowRunnerWindow.java system/InputNode.java system/gui/InputConfigurationDialog.java
Date Wed, 18 Apr 2012 20:33:17 GMT
Author: lahiru
Date: Wed Apr 18 20:33:16 2012
New Revision: 1327669

URL: http://svn.apache.org/viewvc?rev=1327669&view=rev
Log:
fixing https://issues.apache.org/jira/browse/AIRAVATA-377.

Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/dynamic/gui/DynamicWorkflowRunnerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/InputNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/gui/InputConfigurationDialog.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/dynamic/gui/DynamicWorkflowRunnerWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/dynamic/gui/DynamicWorkflowRunnerWindow.java?rev=1327669&r1=1327668&r2=1327669&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/dynamic/gui/DynamicWorkflowRunnerWindow.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/dynamic/gui/DynamicWorkflowRunnerWindow.java
Wed Apr 18 20:33:16 2012
@@ -152,6 +152,10 @@ public class DynamicWorkflowRunnerWindow
                     valueString = value.toString();
                 }
             }
+
+            if (!node.isVisibility()) {
+                paramField.setEditable(false);
+            }
             paramField.setText(valueString);
             this.parameterPanel.add(nameLabel);
             this.parameterPanel.add(typeField);

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/InputNode.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/InputNode.java?rev=1327669&r1=1327668&r2=1327669&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/InputNode.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/InputNode.java
Wed Apr 18 20:33:16 2012
@@ -48,12 +48,16 @@ public class InputNode extends Parameter
 
     private static final String VALUE_TAG_NAME = "value";
 
+    private static final String VISIBILITY_TAG_NAME = "visibility";
+
     private static final Logger logger = LoggerFactory.getLogger(InputNode.class);
 
     private Object defaultValue;
 
     private InputNodeGUI gui;
 
+    private boolean visibility;
+
     /**
      * Creates an InputNode.
      * 
@@ -61,6 +65,8 @@ public class InputNode extends Parameter
      */
     public InputNode(Graph graph) {
         super(graph);
+        // Default value for visibility when creating a new node is true
+        visibility = true;
     }
 
     /**
@@ -83,6 +89,14 @@ public class InputNode extends Parameter
         return this.gui;
     }
 
+    public boolean isVisibility() {
+        return visibility;
+    }
+
+    public void setVisibility(boolean visibility) {
+        this.visibility = visibility;
+    }
+
     /**
      * @see org.apache.airavata.xbaya.graph.impl.NodeImpl#getComponent()
      */
@@ -277,6 +291,23 @@ public class InputNode extends Parameter
             }
             // this.defaultValue = element.requiredText();
         }
+        element = configElement.element(null, VISIBILITY_TAG_NAME);
+        if (element != null) {
+            // It might be a String or XmlElement
+            for (Object child : element.children()) {
+                if (child instanceof String) {
+                    if (((String) child).trim().length() == 0) {
+                        // Skip white space before xml element.
+                        continue;
+                    }
+                }
+                this.visibility = Boolean.parseBoolean((String) child);
+                break;
+            }
+            // this.defaultValue = element.requiredText();
+        } else {
+            this.visibility = true;
+        }
     }
 
     @Override
@@ -293,6 +324,9 @@ public class InputNode extends Parameter
             XmlElement element = configElement.addElement(GraphSchema.NS, VALUE_TAG_NAME);
             element.addChild(this.defaultValue);
         }
+       XmlElement element = configElement.addElement(GraphSchema.NS,
+                    VISIBILITY_TAG_NAME);
+        element.addChild(Boolean.toString(this.visibility));
         return configElement;
     }
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/gui/InputConfigurationDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/gui/InputConfigurationDialog.java?rev=1327669&r1=1327668&r2=1327669&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/gui/InputConfigurationDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/gui/InputConfigurationDialog.java
Wed Apr 18 20:33:16 2012
@@ -63,6 +63,8 @@ public class InputConfigurationDialog {
 
     private XBayaTextArea metadataTextArea;
 
+    private XBayaTextField visibilityTextField;
+
     /**
      * Constructs an InputConfigurationWindow.
      * 
@@ -102,6 +104,9 @@ public class InputConfigurationDialog {
         String name = this.node.getID(); // Show ID.
         this.nameTextField.setText(name);
 
+        String visibility = Boolean.toString(this.node.isVisibility());
+        this.visibilityTextField.setText(visibility);
+
         this.descriptionTextArea.setText(this.node.getDescription());
         Object value = this.node.getDefaultValue();
         String valueString;
@@ -145,6 +150,7 @@ public class InputConfigurationDialog {
         String description = this.descriptionTextArea.getText();
         String valueString = textComponent.getText();
         String metadataText = this.metadataTextArea.getText();
+        String visibilityText = this.visibilityTextField.getText();
 
         if (name.length() == 0) {
             String warning = "The name cannot be empty.";
@@ -186,6 +192,7 @@ public class InputConfigurationDialog {
         this.node.setDescription(description);
         this.node.setDefaultValue(value);
         this.node.setMetadata(metadata);
+        this.node.setVisibility(Boolean.parseBoolean(visibilityText));
         hide();
         this.engine.getGUI().getGraphCanvas().repaint();
     }
@@ -208,16 +215,21 @@ public class InputConfigurationDialog {
         this.metadataTextArea = new XBayaTextArea();
         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);
         this.gridPanel.add(this.descriptionTextArea);
         this.gridPanel.add(this.valueLabel);
         this.gridPanel.add(this.valueTextField);
         this.gridPanel.add(metadataLabel);
         this.gridPanel.add(this.metadataTextArea);
-        this.gridPanel.layout(4, 2, 3, 1);
+        this.gridPanel.layout(5, 2, 3, 1);
 
         JButton okButton = new JButton("OK");
         okButton.addActionListener(new AbstractAction() {



Mime
View raw message