Author: objectiser
Date: 2010-08-10 09:38:23 -0400 (Tue, 10 Aug 2010)
New Revision: 908
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/LayoutManager.java
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/ProcessImpl.java
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/SimpleActivityImpl.java
Log:
Reflect a red border when the activity (or grouped activity) has a 'failed'
state.
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
12:26:17 UTC (rev 907)
+++
trunk/console/bpel2svg/src/main/java/org/jboss/soa/bpel/bpel2svg/BPEL2SVGUtil.java 2010-08-10
13:38:23 UTC (rev 908)
@@ -72,11 +72,16 @@
SVGInterface svg=BPEL2SVGUtil.generate(fis);
- /*
ActivityInterface seq=svg.getActivityAtLineNumber(53);
ActivityInterface recv=svg.getActivityAtLineNumber(61);
ActivityInterface assign=svg.getActivityAtLineNumber(64);
+ /*
+ seq.setState(ActivityState.Failed);
+ recv.setState(ActivityState.Completed);
+ assign.setState(ActivityState.Failed);
+ */
+ /*
seq.setState(ActivityState.Active);
recv.setState(ActivityState.Completed);
assign.setState(ActivityState.Active);
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
12:26:17 UTC (rev 907)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/LayoutManager.java 2010-08-10
13:38:23 UTC (rev 908)
@@ -121,8 +121,14 @@
private double opacity = 0.50;
- public double getIconOpacity() {
- return iconOpacity;
+ public double getIconOpacity(ActivityState state) {
+ double ret=iconOpacity;
+
+ if (state != ActivityState.Ready) {
+ ret = 1.0;
+ }
+
+ return ret;
}
public void setIconOpacity(double iconOpacity) {
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
12:26:17 UTC (rev 907)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ActivityImpl.java 2010-08-10
13:38:23 UTC (rev 908)
@@ -101,6 +101,9 @@
protected String boxStyle =
"fill-opacity:0.04;fill-rule:evenodd;stroke:#0000FF;stroke-width:1.99999988;" +
"stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;"
+
"bbbbbbbstroke-opacity:1;fill:url(#orange_red);stroke-opacity:0.2";
+ protected String failureBoxStyle =
"fill-opacity:0.04;fill-rule:evenodd;stroke:#FF0000;stroke-width:2.99999988;" +
+
"stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;"
+
+ "bbbbbbbstroke-opacity:1;fill:url(#orange_red);stroke-opacity:0.8";
// Constructor
public ActivityImpl() {
@@ -264,8 +267,8 @@
return layoutManager.getCompositeActivityOpacity();
}
- public double getIconOpacity() {
- return layoutManager.getIconOpacity();
+ public double getIconOpacity(ActivityState state) {
+ return layoutManager.getIconOpacity(state);
}
public String getBoxId() {
@@ -417,6 +420,9 @@
}
public String getBoxStyle() {
+ if (getState() == ActivityState.Failed) {
+ return(failureBoxStyle);
+ }
return boxStyle;
}
@@ -507,9 +513,9 @@
group.setAttributeNS(null, "id", getLayerId());
if (getStartIconPath() != null) { // TODO looks like redundent, imgPath
in method arguments
- if (isAddIconOpacity() && !isAddSimpleActivityOpacity()) {
- group.setAttributeNS(null, "style", "opacity:" +
getIconOpacity());
- }
+ //if (isAddIconOpacity() && !isAddSimpleActivityOpacity()) {
+ group.setAttributeNS(null, "style", "opacity:" +
getIconOpacity(getState()));
+ //}
Element image =
doc.createElementNS("http://www.w3.org/2000/svg",
"image");
image.setAttributeNS(null, "xlink:href", imgPath);
//image.setAttributeNS(null, "transform",
BPEL2SVGIcons.TRANSFORMATION_MATRIX);
@@ -520,12 +526,12 @@
image.setAttributeNS(null, "id", id);
image.setAttributeNS("xlink", "title",
getActivityInfoString());
- if (isAddIconOpacity() && !isAddSimpleActivityOpacity()) {
+ //if (isAddIconOpacity() && !isAddSimpleActivityOpacity()) {
group.appendChild(image);
return group;
- } else {
- return image;
- }
+ //} else {
+ // return image;
+ //}
}
return group;
}
@@ -677,7 +683,7 @@
rect.setAttributeNS(null, "id", "Rect" + id);
rect.setAttributeNS(null, "rx", "10");
rect.setAttributeNS(null, "ry", "10");
- rect.setAttributeNS(null, "style", boxStyle);
+ rect.setAttributeNS(null, "style", getBoxStyle());
group.appendChild(rect);
}
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ProcessImpl.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ProcessImpl.java 2010-08-10
12:26:17 UTC (rev 907)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/ProcessImpl.java 2010-08-10
13:38:23 UTC (rev 908)
@@ -275,7 +275,7 @@
//path.setAttributeNS(null, "onmouseout",
"this.style.opacity=" + getIconOpacity() +
";this.filters.alpha.opacity=25");
path.setAttributeNS(null, "onmouseover",
"this.style.opacity=1;this.filters.alpha.opacity=100");
- path.setAttributeNS(null, "onmouseout", "this.style.opacity="
+ getIconOpacity() + ";this.filters.alpha.opacity=100");
+ path.setAttributeNS(null, "onmouseout", "this.style.opacity="
+ getIconOpacity(getState()) + ";this.filters.alpha.opacity=100");
//path.setAttributeNS(null, "onload", "this.style.opacity=" +
getIconOpacity() + ";this.filters.alpha.opacity=100");
// path.setAttributeNS(null, "onmousemove",
"this.style.opacity=1;this.filters.alpha.opacity=100");
Modified:
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/SimpleActivityImpl.java
===================================================================
---
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/SimpleActivityImpl.java 2010-08-10
12:26:17 UTC (rev 907)
+++
trunk/console/bpel2svg/src/main/java/org/wso2/carbon/bpel/ui/bpel2svg/impl/SimpleActivityImpl.java 2010-08-10
13:38:23 UTC (rev 908)
@@ -99,7 +99,11 @@
group.setAttributeNS("xlink", "title",
getActivityInfoString());
}
-// group.appendChild(getBoxDefinition());
+ // Add border on failed state, to show the red boundary indicating an error has
occurred
+ if (getState() == ActivityState.Failed) {
+ group.appendChild(getBoxDefinition(doc));
+ }
+
group.appendChild(getImageDefinition(doc));
group.appendChild(getStartImageText(doc));