diff --git a/pytm/pytm.py b/pytm/pytm.py
index 8e85da05..4ad1cdf4 100644
--- a/pytm/pytm.py
+++ b/pytm/pytm.py
@@ -432,8 +432,9 @@ def check(self):
def dfd(self, **kwargs):
self._is_drawn = True
+ color = _setColor(self)
label = _setLabel(self)
- print("%s [\n\tshape = square;" % self._uniq_name())
+ print("{0} [\n\tshape = square;\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
print('\tlabel = <
>;'.format(label))
print("]")
@@ -519,7 +520,7 @@ def dfd(self, **kwargs):
color = _setColor(self)
pngpath = dirname(__file__) + "/images/lambda.png"
label = _setLabel(self)
- print('{0} [\n\tshape = none\n\tfixedsize=shape\n\timage="{2}"\n\timagescale=true\n\tcolor = {1}'.format(self._uniq_name(), color, pngpath))
+ print('{0} [\n\tshape = none\n\tfixedsize=shape\n\timage="{2}"\n\timagescale=true\n\tcolor = {1};\n\tfontcolor = {1};'.format(self._uniq_name(), color, pngpath))
print('\tlabel = <>;'.format(label))
print("]")
@@ -568,7 +569,7 @@ def dfd(self, **kwargs):
self._is_drawn = True
color = _setColor(self)
label = _setLabel(self)
- print("{0} [\n\tshape = circle\n\tcolor = {1}".format(self._uniq_name(), color))
+ print("{0} [\n\tshape = circle\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
print('\tlabel = <>;'.format(label))
print("]")
@@ -615,8 +616,8 @@ def dfd(self, **kwargs):
self._is_drawn = True
color = _setColor(self)
label = _setLabel(self)
- print("{0} [\n\tshape = none;\n\tcolor = {1};".format(self._uniq_name(), color))
- print('\tlabel = <>;'.format(label, color))
+ print("{0} [\n\tshape = none;\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
+ print('\tlabel = <>;'.format(label))
print("]")
@@ -632,8 +633,9 @@ def __init__(self, name, **kwargs):
def dfd(self, **kwargs):
self._is_drawn = True
+ color = _setColor(self)
label = _setLabel(self)
- print("%s [\n\tshape = square;" % self._uniq_name())
+ print("{0} [\n\tshape = square;\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
print('\tlabel = <>;'.format(label))
print("]")
@@ -685,8 +687,8 @@ def dfd(self, **kwargs):
self._is_drawn = True
color = _setColor(self)
label = _setLabel(self)
- print("{0} [\n\tshape = circle;\n\tcolor = {1};\n".format(self._uniq_name(), color))
- print('\tlabel = <>;'.format(label, color))
+ print("{0} [\n\tshape = circle;\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
+ print('\tlabel = <>;'.format(label))
print("]")
@@ -698,8 +700,8 @@ def dfd(self, **kwargs):
self._is_drawn = True
color = _setColor(self)
label = _setLabel(self)
- print("{0} [\n\tshape = doublecircle;\n\tcolor = {1};\n".format(self._uniq_name(), color))
- print('\tlabel = <>;'.format(label, color))
+ print("{0} [\n\tshape = doublecircle;\n\tcolor = {1};\n\tfontcolor = {1};".format(self._uniq_name(), color))
+ print('\tlabel = <>;'.format(label))
print("]")
@@ -753,13 +755,13 @@ def dfd(self, mergeResponses=False, **kwargs):
if self.response.order >= 0:
resp_label = "({0}) {1}".format(self.response.order, resp_label)
label += "
" + resp_label
- print("\t{0} -> {1} [\n\t\tcolor = {2};\n\t\tdir = {3};\n".format(
+ print("\t{0} -> {1} [\n\t\tcolor = {2};\n\t\tfontcolor = {2};\n\t\tdir = {3};\n".format(
self.source._uniq_name(),
self.sink._uniq_name(),
color,
direction,
))
- print('\t\tlabel = <>;'.format(label, color))
+ print('\t\tlabel = <>;'.format(label))
print("\t]")
diff --git a/tests/dfd.dot b/tests/dfd.dot
index f83a261d..6615a18c 100644
--- a/tests/dfd.dot
+++ b/tests/dfd.dot
@@ -28,6 +28,8 @@ subgraph cluster_boundary_Internet_acf3059e70 {
actor_User_579e9aae81 [
shape = square;
+ color = black;
+ fontcolor = black;
label = <>;
]
@@ -45,38 +47,44 @@ subgraph cluster_boundary_ServerDB_88f2d9c06f {
datastore_SQLDatabase_d2006ce1bb [
shape = none;
color = black;
- label = <>;
+ fontcolor = black;
+ label = <>;
]
}
server_WebServer_f2eb7a3ff7 [
shape = circle
- color = black
+ color = black;
+ fontcolor = black;
label = <>;
]
actor_User_579e9aae81 -> server_WebServer_f2eb7a3ff7 [
color = black;
+ fontcolor = black;
dir = forward;
- label = <>;
+ label = <>;
]
server_WebServer_f2eb7a3ff7 -> datastore_SQLDatabase_d2006ce1bb [
color = black;
+ fontcolor = black;
dir = forward;
- label = <Insert query with comments |
>;
+ label = <Insert query with comments |
>;
]
datastore_SQLDatabase_d2006ce1bb -> server_WebServer_f2eb7a3ff7 [
color = black;
+ fontcolor = black;
dir = forward;
- label = <>;
+ label = <>;
]
server_WebServer_f2eb7a3ff7 -> actor_User_579e9aae81 [
color = black;
+ fontcolor = black;
dir = forward;
- label = <>;
+ label = <>;
]
}