Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlatools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlatools
Commits
9b877939
Commit
9b877939
authored
Jan 18, 2018
by
William Schultz
Committed by
Markus Alexander Kuppe
Feb 7, 2018
Browse files
Options
Downloads
Patches
Plain Diff
Add basic legend test
parent
6e56b119
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tlatools/src/tlc2/util/DotStateWriter.java
+14
-1
14 additions, 1 deletion
tlatools/src/tlc2/util/DotStateWriter.java
with
14 additions
and
1 deletion
tlatools/src/tlc2/util/DotStateWriter.java
+
14
−
1
View file @
9b877939
...
...
@@ -72,6 +72,7 @@ public class DotStateWriter extends StateWriter {
this
.
writer
.
append
(
stateToDotStr
(
state
,
state
));
this
.
writer
.
append
(
">]"
);
this
.
writer
.
append
(
"\n"
);
this
.
writer
.
append
(
dotLegend
(
"Legend"
,
new
ArrayList
<
String
>()));
}
/* (non-Javadoc)
...
...
@@ -162,7 +163,7 @@ public class DotStateWriter extends StateWriter {
// this.writer.append("</tr>");
this
.
writer
.
append
(
"</table>"
);
this
.
writer
.
append
(
">"
);
this
.
writer
.
append
(
" color=\""
+
color
+
"\"]"
);
this
.
writer
.
append
(
"
labeldistance=\"4\"
color=\""
+
color
+
"\"]"
);
this
.
writer
.
append
(
" [headlabel="
);
this
.
writer
.
append
(
"\""
+
String
.
join
(
"\n"
,
changedVars
)
+
"\""
);
this
.
writer
.
append
(
" labeldistance=\"4\" fontcolor=\""
+
color
+
"\" fontsize=\"9\"]"
);
...
...
@@ -184,6 +185,18 @@ public class DotStateWriter extends StateWriter {
}
}
protected
static
String
dotLegend
(
String
name
,
ArrayList
<
String
>
actions
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
String
.
format
(
"subgraph %s {"
,
name
));
sb
.
append
(
"node [ labeljust=\"l\" colorscheme=\"pastel13\" style=filled fillcolor=3 shape=record ]\n"
);
sb
.
append
(
"label = \"Legend\" style=\"solid\""
);
sb
.
append
(
"colorscheme=\"pastel13\""
);
sb
.
append
(
"action1 [label=\"Action1\", fillcolor=1] "
);
sb
.
append
(
"action2 [label=\"Action2\", fillcolor=2] "
);
sb
.
append
(
"}"
);
return
sb
.
toString
();
}
protected
static
String
stateToDotStr
(
TLCState
state
,
TLCState
successor
)
{
StringBuilder
sb
=
new
StringBuilder
();
HashMap
<
UniqueString
,
Value
>
valMap
=
successor
.
getVals
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment