kurelo / scxmlgui

Automatically exported from code.google.com/p/scxmlgui
0 stars 0 forks source link

Can we Displaye the Condition and Action in the Transition #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Can we display the condition and action directly in a transition using say 
UML's notation:
e.g.------event[guard condition]/action---->

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by msqwe...@yahoo.com on 11 Nov 2012 at 7:58

GoogleCodeExporter commented 9 years ago
maybe we can add a config flag for this as for some project this option will 
clutter the screen too much.

Original comment by fmorbini on 11 Nov 2012 at 4:53

GoogleCodeExporter commented 9 years ago
In the meantime, here is a small patch that force display of guard and exec 

Index: 
trunk/fsm-editor/src/com/mxgraph/examples/swing/editor/scxml/SCXMLGraph.java
===================================================================
--- 
trunk/fsm-editor/src/com/mxgraph/examples/swing/editor/scxml/SCXMLGraph.java    (re
vision 171)
+++ 
trunk/fsm-editor/src/com/mxgraph/examples/swing/editor/scxml/SCXMLGraph.java    (wo
rking copy)
@@ -631,7 +631,18 @@
                return node.getID();
        } else if (v instanceof SCXMLEdge) {
            SCXMLEdge edge=((SCXMLEdge)v);
-           return edge.getEvent();
+           
+           String label = edge.getEvent();
+
+           if (edge.getCondition().length() > 0) {
+               label += "\n [" + edge.getCondition() + "]";
+           }
+           if (edge.getExe().length() > 0) {
+               label += " / " + edge.getExe();
+           }
+           return label;
+           
+
        } else {
            return "";
        }

Original comment by aurelien.labrosse on 10 Jan 2013 at 4:48