Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ skinparam queue {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}

skinparam participant {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}

skinparam arrow {
Color $ARROW_COLOR
FontColor $ARROW_FONT_COLOR
Expand Down Expand Up @@ -353,6 +357,9 @@ skinparam package {
!$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too
!$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "")
' sequence requires participant
!$tagSkin = $tagSkin + $elementTagSkinparams("participant", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
!$tagSkin = $tagSkin + $elementTagSkinparams("sequencebox", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
!if (%strpos($tagStereo, "boundary") >= 0 && $bgColor != "")
!$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
Expand Down Expand Up @@ -893,8 +900,16 @@ $elementSkin
!if (%strpos($text, "\n") >= 0)
!while (%strpos($text, "\n") >= 0)
!$brPos = %strpos($text, "\n")
!$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine
!if ($brPos > 0)
!$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine
!else
' <U+00A0> non breaking change that newLine breaks with formats can be used with \n\n
!$multiLine = $multiLine + "<U+00A0>" + $usedNewLine
!endif
!$text = %substr($text, $brPos+2)
!if (%strlen($text) == 0)
!$text = "<U+00A0>"
!endif
!endwhile
!else
!while ($width>0 && %strlen($text) > $width)
Expand Down Expand Up @@ -965,6 +980,17 @@ $elementSkin
!return $element
!endfunction

!function $getElementLine($umlShape, $elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link)
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType)
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType)
!$baseProp = $getElementBase($label, $techn, $descr, $sprite) + $getProps()
!$stereo = $toStereos($elementType,$tags)
!$calcLink = $getLink($link)

!$line = $umlShape + " " + %chr(34) + $baseProp + %chr(34) +" " + $stereo + " as " + $alias + $calcLink
!return $line
!endfunction

' Element properties
' ##################################

Expand Down Expand Up @@ -1438,7 +1464,7 @@ $from -[hidden]L- $to
!endprocedure

' PlantUML bug: lines which does "not match" with the orientation/direction of the diagram
' uses the same length therefore the method offers no direction at all.
' use the same length therefore the method offers no direction at all.
' If a direction is required the Lay_...() methods can be used
!unquoted procedure Lay_Distance($from, $to, $distance="0")
$from $getHiddenLine($distance) $to
Expand Down
28 changes: 6 additions & 22 deletions C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -58,42 +58,26 @@ endlegend
' Elements
' ##################################

!function $getComponent($label, $techn, $descr, $sprite)
!return $getElementBase($label, $techn, $descr, $sprite)
!endfunction

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
rectangle "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("rectangle", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
database "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("database", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
queue "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
rectangle "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("rectangle", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
database "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("database", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
queue "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("queue", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
28 changes: 6 additions & 22 deletions C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -65,44 +65,28 @@ endlegend
' Elements
' ##################################

!function $getContainer($label, $techn, $descr, $sprite)
!return $getElementBase($label, $techn, $descr, $sprite)
!endfunction

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
rectangle "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("rectangle", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
database "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("database", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
queue "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
rectangle "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("rectangle", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
database "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("database", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
queue "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("queue", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

' Boundaries
Expand Down
46 changes: 15 additions & 31 deletions C4_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,6 @@ UpdateElementStyle("external_person")
!return $getElementBase($label, $type, $descr, $sprite)
!endfunction

!function $getSystem($label, $type, $descr, $sprite)
!return $getElementBase($label, $type, $descr, $sprite)
!endfunction

!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "person")
' $type reuses $techn definition of $tags
Expand Down Expand Up @@ -385,45 +381,33 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
rectangle "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
rectangle "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
database "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("database", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
queue "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
database "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("database", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
queue "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("queue", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

' Boundaries
Expand Down
Loading