@@ -34,6 +34,9 @@ rectangle C4VersionDetailsArea <<legendArea>> [
34
34
!$BOUNDARY_COLOR ?= "#444444 "
35
35
!$BOUNDARY_BG_COLOR ?= "transparent "
36
36
!$BOUNDARY_BORDER_STYLE ?= "dashed "
37
+ ' boundary symbols written in the same line, typically only 50% of the size in element
38
+ !$BOUNDARY_IMAGE_SIZE_FACTOR ?= 0. 5
39
+ !$BOUNDARY_DESCR_MAX_CHAR_WIDTH ?= 35
37
40
38
41
!$LEGEND_TITLE_COLOR ?= "#000000 "
39
42
!$LEGEND_FONT_COLOR ?= "#FFFFFF "
@@ -595,13 +598,13 @@ $elementSkin
595
598
!endfunction
596
599
597
600
' element symbols typically 4 times too big in legend
598
- !function $smallVersionSprite ($sprite )
601
+ !function $smallVersionSprite ($sprite , $ imageScale = $ LEGEND_IMAGE_SIZE_FACTOR )
599
602
' ,scale= ... has to be first (...,color=black,scale=0.25... is invalid too)
600
603
!if (%strpos ($sprite , "=" ) < 0 )
601
604
!if (%substr ($sprite , 0 , 4 ) == "img :")
602
- !$smallSprite = $sprite + "{scale = " + $LEGEND_IMAGE_SIZE_FACTOR + "}"
605
+ !$smallSprite = $sprite + "{scale = " + $imageScale + "}"
603
606
!else
604
- !$smallSprite = $sprite + ",scale = " + $LEGEND_IMAGE_SIZE_FACTOR
607
+ !$smallSprite = $sprite + ",scale = " + $imageScale
605
608
!endif
606
609
!else
607
610
!$smallSprite = $sprite
@@ -1373,22 +1376,22 @@ $getLegendArea($alias, $hideStereotype, $details)
1373
1376
' Boundaries
1374
1377
' ##################################
1375
1378
1376
- !unquoted procedure UpdateBoundaryStyle ($elementName = "", $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "", $type = "", $legendText = "", $borderStyle = "", $borderThickness = "")
1379
+ !unquoted procedure UpdateBoundaryStyle ($elementName = "", $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "", $type = "", $legendText = "", $borderStyle = "", $borderThickness = "", $ sprite = "", $ legendSprite = "" )
1377
1380
!if ($elementName != "")
1378
1381
!$elementBoundary = $elementName + '_boundary '
1379
- UpdateElementStyle ($elementBoundary , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "" , $type , $legendText , "" , $borderStyle , $borderThickness )
1382
+ UpdateElementStyle ($elementBoundary , $bgColor , $fontColor , $borderColor , $shadowing , $shape , $ sprite , $type , $legendText , $ legendSprite , $borderStyle , $borderThickness )
1380
1383
!else
1381
- UpdateElementStyle ("boundary" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "" , $type , $legendText , "" , $borderStyle , $borderThickness )
1384
+ UpdateElementStyle ("boundary" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , $ sprite , $type , $legendText , $ legendSprite , $borderStyle , $borderThickness )
1382
1385
' simulate color inheritance
1383
- UpdateBoundaryStyle ("enterprise" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "Enterprise" , "" , $borderStyle , $borderThickness )
1384
- UpdateBoundaryStyle ("system" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "System" , "" , $borderStyle , $borderThickness )
1385
- UpdateBoundaryStyle ("container" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "Container" , "" , $borderStyle , $borderThickness )
1386
+ UpdateBoundaryStyle ("enterprise" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "Enterprise" , "" , $borderStyle , $borderThickness , $ sprite , $ legendSprite )
1387
+ UpdateBoundaryStyle ("system" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "System" , "" , $borderStyle , $borderThickness , $ sprite , $ legendSprite )
1388
+ UpdateBoundaryStyle ("container" , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "Container" , "" , $borderStyle , $borderThickness , $ sprite , $ legendSprite )
1386
1389
!endif
1387
1390
!endprocedure
1388
1391
1389
- !unquoted procedure AddBoundaryTag ($tagStereo , $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "", $type = "", $legendText = "", $borderStyle = "", $borderThickness = "")
1392
+ !unquoted procedure AddBoundaryTag ($tagStereo , $bgColor = "", $fontColor = "", $borderColor = "", $shadowing = "", $shape = "", $type = "", $legendText = "", $borderStyle = "", $borderThickness = "", $ sprite = "", $ legendSprite = "" )
1390
1393
!$tagBoundary = $tagStereo + '_boundary '
1391
- AddElementTag ($tagBoundary , $bgColor , $fontColor , $borderColor , $shadowing , $shape , "" , $type , $legendText , "" , $borderStyle , $borderThickness )
1394
+ AddElementTag ($tagBoundary , $bgColor , $fontColor , $borderColor , $shadowing , $shape , $ sprite , $type , $legendText , $ legendSprite , $borderStyle , $borderThickness )
1392
1395
!endprocedure
1393
1396
1394
1397
' add _boundary to all tags that short tag version can be used
@@ -1410,20 +1413,28 @@ $getLegendArea($alias, $hideStereotype, $details)
1410
1413
!return $boundaryTags
1411
1414
!endfunction
1412
1415
1413
- !function $getBoundary ($label , $type )
1414
- !if ($type == "")
1415
- !return '== ' + $breakLabel ($label )
1416
+ !function $getBoundary ($label , $type , $descr , $sprite )
1417
+ !$line = '== '
1418
+ !if ($sprite != "")
1419
+ ' add sprite in label line that it is more compact
1420
+ !$line = $line + $getSprite ($smallVersionSprite ($sprite , $BOUNDARY_IMAGE_SIZE_FACTOR )) + ' '
1421
+ !endif
1422
+ !$line = $line + $breakLabel ($label )
1423
+ !if ($type != "")
1424
+ !$line = $line + '\n <size :' + $TECHN_FONT_SIZE + '>[' + $type + ']</size>'
1416
1425
!endif
1417
- !if (type != "")
1418
- !return ' == ' + $ breakLabel ($ label ) + '\n < size : ' + $TECHN_FONT_SIZE + '>[' + $type + ']</size>'
1426
+ !if ($ descr != "")
1427
+ !$ line = $ line + '\n \ n ' + $breakDescr ($ descr , $ BOUNDARY_DESCR_MAX_CHAR_WIDTH )
1419
1428
!endif
1429
+ !return $line
1420
1430
!endfunction
1421
1431
1422
- !unquoted procedure Boundary ($alias , $label , $type = "", $tags = "", $link = "")
1432
+ !unquoted procedure Boundary ($alias , $label , $type = "", $tags = "", $link = "", $ descr = "" )
1423
1433
!$boundaryTags = $addBoundaryPostfix ($tags )
1424
- ' nodes $type reuses $techn definition of $boundaryTags
1434
+ ' boundary $type reuses $techn definition of $boundaryTags
1425
1435
!$type = $toElementArg ($type , $boundaryTags , "ElementTagTechn ", "boundary ")
1426
- rectangle "$getBoundary($label, $type)" $toStereos ("boundary" , $boundaryTags ) as $alias $getLink ($link )
1436
+ !$sprite = $toElementArg ("", $boundaryTags , "ElementTagSprite ", "boundary ")
1437
+ rectangle "$getBoundary($label, $type, $descr, $sprite)" $toStereos ("boundary" , $boundaryTags ) as $alias $getLink ($link )
1427
1438
!endprocedure
1428
1439
1429
1440
' Boundary Styling
0 commit comments