27
27
!global $LEGEND_NO_LINE_TEXT = "(no line color ) "
28
28
!global $LEGEND_ROUNDED_BOX = "(rounded box ) "
29
29
!global $LEGEND_EIGHT_SIDED = "(eight sided ) "
30
+ !global $LEGEND_DOTTED_LINE = "(dotted ) "
31
+ !global $LEGEND_DASHED_LINE = "(dashed ) "
32
+ !global $LEGEND_BOLD_LINE = "(bold ) "
30
33
31
34
' Styling
32
35
' ##################################
38
41
!global $ROUNDED_BOX = "roundedBox "
39
42
!global $EIGHT_SIDED = "eightSided "
40
43
44
+ !global $DOTTED_LINE = "dotted "
45
+ !global $DASHED_LINE = "dashed "
46
+ !global $BOLD_LINE = "bold "
47
+
41
48
skinparam defaultTextAlignment center
42
49
43
50
skinparam wrapWidth 200
@@ -226,7 +233,7 @@ $tagSkin
226
233
!return $c
227
234
!endfunction
228
235
229
- !unquoted procedure $defineRelSkinparams ($tagStereo , $textColor , $lineColor )
236
+ !unquoted procedure $defineRelSkinparams ($tagStereo , $textColor , $lineColor , $ lineStyle )
230
237
!$elementSkin = "skinparam arrow <<" + $tagStereo + ">> {" + %newline ()
231
238
!$elementSkin = $elementSkin + " Color "
232
239
!if ($lineColor != "")
@@ -235,6 +242,9 @@ $tagSkin
235
242
!if ($textColor != "")
236
243
!$elementSkin = $elementSkin + ";text :" + $colorWithoutHash($textColor)
237
244
!endif
245
+ !if ($lineStyle != "")
246
+ !$elementSkin = $elementSkin + ";line . " + $lineStyle
247
+ !endif
238
248
!$elementSkin = $elementSkin + %newline ()
239
249
!$elementSkin = $elementSkin + "}" + %newline ()
240
250
$elementSkin
@@ -398,7 +408,7 @@ $elementSkin
398
408
!return $tagEntry
399
409
!endfunction
400
410
401
- !function $tagRelLegendEntry ($tagStereo , $textColor , $lineColor )
411
+ !function $tagRelLegendEntry ($tagStereo , $textColor , $lineColor , $ lineStyle )
402
412
!$tc = $textColor
403
413
!$lc = $lineColor
404
414
@@ -428,11 +438,26 @@ $elementSkin
428
438
!if ($lineColor == "")
429
439
!$tagEntry = $tagEntry + $LEGEND_NO_LINE_TEXT
430
440
!endif
441
+ !if ($lineStyle != "")
442
+ !if ($lineStyle == $DOTTED_LINE )
443
+ !$tagEntry = $tagEntry + $LEGEND_DOTTED_LINE
444
+ !else if ($lineStyle == $DASHED_LINE )
445
+ !$tagEntry = $tagEntry + $LEGEND_DASHED_LINE
446
+ !else if ($lineStyle == $BOLD_LINE )
447
+ !$tagEntry = $tagEntry + $LEGEND_BOLD_LINE
448
+ !else
449
+ !$tagEntry = $tagEntry + "(" + $lineStyle + ") "
450
+ !endif
451
+ !endif
431
452
!$tagEntry = $tagEntry + "</color > "
432
453
!$tagEntry = $tagEntry + "|"
433
454
!return $tagEntry
434
455
!endfunction
435
456
457
+ !global $LEGEND_DOTTED_LINE = "(dotted ) "
458
+ !global $LEGEND_DASHED_LINE = "(dashed ) "
459
+ !global $LEGEND_BOLD_LINE = "(bold ) "
460
+
436
461
!unquoted procedure $addTagToLegend ($tagStereo , $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "")
437
462
'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color,
438
463
'' like a new $fontColor="#fdae61" therefore it should be added to the legend
@@ -446,15 +471,15 @@ $elementSkin
446
471
' !endif
447
472
!endprocedure
448
473
449
- !unquoted procedure $addRelTagToLegend ($tagStereo , $textColor = "", $lineColor = "")
474
+ !unquoted procedure $addRelTagToLegend ($tagStereo , $textColor = "", $lineColor = "", $ lineStyle = "" )
450
475
'' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype
451
476
'' and the line color of another stereotype. Therefore the text color of one tag and the line color
452
477
'' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1").
453
478
'' This workaround tag could be theoretically removed in the legend but after that there would
454
479
'' be an inconsistency between the element tags and the rel tags and therefore
455
480
'' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed)
456
481
' !if (%strpos($tagStereo, "&")<0)
457
- !$tagEntry = $tagRelLegendEntry ($tagStereo , $textColor , $lineColor )
482
+ !$tagEntry = $tagRelLegendEntry ($tagStereo , $textColor , $lineColor , $ lineStyle )
458
483
%set_variable_value ("$" + $tagStereo + "_LineLegendEntry" , $tagEntry )
459
484
!$tagCustomLegend = $tagCustomLegend + $tagStereo + "_Line \n "
460
485
' !endif
@@ -486,16 +511,28 @@ $elementSkin
486
511
!return $EIGHT_SIDED
487
512
!endfunction
488
513
514
+ !function DottedLine ()
515
+ !return $DOTTED_LINE
516
+ !endfunction
517
+
518
+ !function DashedLine ()
519
+ !return $DASHED_LINE
520
+ !endfunction
521
+
522
+ !function BoldLine ()
523
+ !return $BOLD_LINE
524
+ !endfunction
525
+
489
526
' used by new defined tags
490
527
!unquoted procedure AddElementTag ($tagStereo , $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "")
491
528
$defineSkinparams ($tagStereo , $bgColor , $fontColor , $borderColor , $shadowing , $shape )
492
529
$addTagToLegend ($tagStereo , $bgColor , $fontColor , $borderColor , $shadowing , $shape )
493
530
!endprocedure
494
531
495
532
' used by new defined rel tags
496
- !unquoted procedure AddRelTag ($tagStereo , $textColor = "", $lineColor = "")
497
- $defineRelSkinparams ($tagStereo , $textColor , $lineColor )
498
- $addRelTagToLegend ($tagStereo , $textColor , $lineColor )
533
+ !unquoted procedure AddRelTag ($tagStereo , $textColor = "", $lineColor = "", $ lineStyle = "" )
534
+ $defineRelSkinparams ($tagStereo , $textColor , $lineColor , $ lineStyle )
535
+ $addRelTagToLegend ($tagStereo , $textColor , $lineColor , $ lineStyle )
499
536
!endprocedure
500
537
501
538
' update the style of existing elements like person, ...
0 commit comments