You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/04/24 17:32:11 UTC
svn commit: r1329791 - in
/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph:
impl/GraphImpl.java impl/PortImpl.java system/SystemDataPort.java
Author: lahiru
Date: Tue Apr 24 15:32:10 2012
New Revision: 1329791
URL: http://svn.apache.org/viewvc?rev=1329791&view=rev
Log:
fixing https://issues.apache.org/jira/browse/AIRAVATA-384.
Modified:
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/GraphImpl.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/PortImpl.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/SystemDataPort.java
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/GraphImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/GraphImpl.java?rev=1329791&r1=1329790&r2=1329791&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/GraphImpl.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/GraphImpl.java Tue Apr 24 15:32:10 2012
@@ -637,4 +637,32 @@ public abstract class GraphImpl implemen
}
}
+ /**
+ * This returns the number of input Nodes, this will be useful when adding unique Id for nodes
+ * @return
+ */
+ public int getCurrentInputNodeCount(){
+ int index=0;
+ for(Node node:nodes){
+ if(node instanceof InputNode){
+ index++;
+ }
+ }
+ return index;
+ }
+ /**
+ * This returns the number of input Nodes, this will be useful when adding unique Id for nodes
+ * @return
+ */
+ public int getCurrentOutputNodeCount(){
+ int index=0;
+ for(Node node:nodes){
+ if(node instanceof OutputNode){
+ index++;
+ }
+ }
+ return index;
+ }
+
+
}
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/PortImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/PortImpl.java?rev=1329791&r1=1329790&r2=1329791&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/PortImpl.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/impl/PortImpl.java Tue Apr 24 15:32:10 2012
@@ -34,6 +34,9 @@ import org.apache.airavata.xbaya.graph.G
import org.apache.airavata.xbaya.graph.Node;
import org.apache.airavata.xbaya.graph.Port;
import org.apache.airavata.xbaya.graph.gui.PortGUI;
+import org.apache.airavata.xbaya.graph.system.InputNode;
+import org.apache.airavata.xbaya.graph.system.OutputNode;
+import org.apache.airavata.xbaya.graph.system.SystemDataPort;
import org.xmlpull.infoset.XmlElement;
/**
@@ -275,7 +278,7 @@ public abstract class PortImpl implement
/**
* Sets a graph this port belogs to.
- *
+ *
* @param graph
* The graph
*/
@@ -283,6 +286,10 @@ public abstract class PortImpl implement
this.graph = graph;
}
+ public GraphImpl getGraph() {
+ return graph;
+ }
+
/**
* @param node
*/
@@ -406,7 +413,7 @@ public abstract class PortImpl implement
*
* @return the port index within the node that this port belongs to
*/
- private int getIndex() {
+ public int getIndex() {
int index;
switch (this.kind) {
case DATA_IN:
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/SystemDataPort.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/SystemDataPort.java?rev=1329791&r1=1329790&r2=1329791&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/SystemDataPort.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/system/SystemDataPort.java Tue Apr 24 15:32:10 2012
@@ -171,4 +171,13 @@ public class SystemDataPort extends Data
return portElement;
}
+ public int getIndex(){
+ if(this.getNode() instanceof InputNode){
+ return this.getGraph().getCurrentInputNodeCount() + 1;
+ }else if (this.getNode() instanceof OutputNode){
+ return this.getGraph().getCurrentOutputNodeCount() + 1;
+ }
+ return super.getIndex();
+ }
+
}
\ No newline at end of file