Author: objectiser
Date: 2010-08-10 07:39:08 -0400 (Tue, 10 Aug 2010)
New Revision: 906
Modified:
trunk/console/bpel2svg/src/main/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtil.java
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/LayoutManager.java
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java
Log:
Associating state with the activities in the svg model, to change the opacity of the image
elements.
Modified:
trunk/console/bpel2svg/src/main/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtil.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtil.java 2010-08-10
10:28:46 UTC (rev 905)
+++
trunk/console/bpel2svg/src/main/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtil.java 2010-08-10
11:39:08 UTC (rev 906)
@@ -19,6 +19,7 @@
import org.apache.axiom.om.OMElement;
import org.wso2.carbon.bpel.ui.bpel2svg.*;
+import org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface.ActivityState;
import org.wso2.carbon.bpel.ui.bpel2svg.impl.BPELImpl;
import org.wso2.carbon.bpel.ui.bpel2svg.impl.SVGImpl;
@@ -60,6 +61,8 @@
"', valid values are: "+PNG_IMAGE+","+SVG_IMAGE);
System.exit(1);
}
+ } else {
+ transformer = BPEL2SVGUtil.getTransformer("svg");
}
try {
@@ -67,8 +70,16 @@
java.io.FileOutputStream os=new java.io.FileOutputStream(args[1]);
- BPEL2SVGUtil.generate(fis, os, transformer);
+ SVGInterface svg=BPEL2SVGUtil.generate(fis);
+ ActivityInterface recv=svg.getActivityAtLineNumber(61);
+ ActivityInterface assign=svg.getActivityAtLineNumber(64);
+
+ recv.setState(ActivityState.Completed);
+ assign.setState(ActivityState.Active);
+
+ transformer.transform(svg, os);
+
fis.close();
os.close();
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java 2010-08-10
10:28:46 UTC (rev 905)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/ActivityInterface.java 2010-08-10
11:39:08 UTC (rev 906)
@@ -11,6 +11,29 @@
import java.util.Map;
public interface ActivityInterface {
+
+ // States associated with an activity
+ public enum ActivityState {
+ Ready,
+ Active,
+ Completed,
+ Failed
+ }
+
+ /**
+ * This method returns the activity's current state.
+ *
+ * @return The state
+ */
+ public ActivityState getState();
+
+ /**
+ * This method sets the activity's current state.
+ *
+ * @param state The state
+ */
+ public void setState(ActivityState state);
+
//public ActivityInterface processSubActivities(StringTokenizer bpelST);
public ActivityInterface processSubActivities(OMElement om);
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/LayoutManager.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/LayoutManager.java 2010-08-10
10:28:46 UTC (rev 905)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/LayoutManager.java 2010-08-10
11:39:08 UTC (rev 906)
@@ -4,6 +4,8 @@
import java.util.*;
+import org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface.ActivityState;
+
public class LayoutManager {
// Variables
// Properties
@@ -110,10 +112,10 @@
private String iconOpacity = "0.25";
public String getCompositeActivityOpacity() {
- return compositeActivityOpacity;
+ return Double.toString(compositeActivityOpacity);
}
- public void setCompositeActivityOpacity(String compositeActivityOpacity) {
+ public void setCompositeActivityOpacity(double compositeActivityOpacity) {
this.compositeActivityOpacity = compositeActivityOpacity;
}
@@ -127,7 +129,7 @@
this.iconOpacity = iconOpacity;
}
- private String simpleActivityOpacity = "0.251";
+ private double simpleActivityOpacity = 0.251;
public String getOpacity() {
return opacity;
@@ -137,13 +139,22 @@
this.opacity = opacity;
}
- private String compositeActivityOpacity = "0.10";
+ private double compositeActivityOpacity = 0.10;
- public String getSimpleActivityOpacity() {
- return simpleActivityOpacity;
+ public String getSimpleActivityOpacity(ActivityState state) {
+ double ret=simpleActivityOpacity;
+
+ if (state == ActivityState.Active) {
+ ret = 1.0;
+ } else if (state == ActivityState.Completed ||
+ state == ActivityState.Failed) {
+ ret += 0.4;
+ }
+
+ return Double.toString(ret);
}
- public void setSimpleActivityOpacity(String simpleActivityOpacity) {
+ public void setSimpleActivityOpacity(double simpleActivityOpacity) {
this.simpleActivityOpacity = simpleActivityOpacity;
}
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java 2010-08-10
10:28:46 UTC (rev 905)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java 2010-08-10
11:39:08 UTC (rev 906)
@@ -30,6 +30,8 @@
protected int startLineNumber=-1;
+ protected ActivityState state=ActivityState.Ready;
+
public List<BPELAttributeValuePair> getAttributes() {
return attributes;
}
@@ -209,6 +211,14 @@
return(ret);
}
+
+ public ActivityState getState() {
+ return(this.state);
+ }
+
+ public void setState(ActivityState state) {
+ this.state = state;
+ }
public void setDisplayName(String displayName) {
this.displayName = displayName;
@@ -247,7 +257,7 @@
}
public String getSimpleActivityOpacity() {
- return layoutManager.getSimpleActivityOpacity();
+ return layoutManager.getSimpleActivityOpacity(getState());
}
public String getCompositeOpacity() {
Show replies by date