-
Notifications
You must be signed in to change notification settings - Fork 0
/
option-notes.puml
104 lines (88 loc) · 2.64 KB
/
option-notes.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@startuml option-notes
skinparam dummy 0
!function $option_label($text='',$desc='')
!$linklabel = $GetName($text)
!return '<color:purple><size:20><&tag>' + $linklabel + '</size></color>'
!endfunction
!function $option_pro()
!return '<color:green><size:25><&thumb-up></size></color>'
!endfunction
!function $option_con()
!return '<color:red><size:25><&thumb-down></size></color>'
!endfunction
!function $option_link($name)
!if ($ishidden($name) == 1)
!return '<<alt>> <<' + $name + '>> : . '
!endif
!return '<<alt>> <<' + $name + '>> : ' + $option_label($name)
!endfunction
!procedure $note_start($name='', $target='')
!if ($target=='')
!global $global_last_note_target = $global_last_name
!else
!global $global_last_note_target = $target
!endif
!if ($name=='')
!$name = $global_last_name + "_note"
!endif
!global $global_last_note_name = $name
!if ($name == '')
note on link
!else
!$handle = '$' + $name
!$stereotype = '<<' + $name + '>>'
note as $name $handle $stereotype
!endif
!endprocedure
!procedure $note_end()
end note
!if ($global_last_note_target != '')
!$handle = '$' + $global_last_note_name
!$stereotype = '<<' + $global_last_note_name + '>>'
!if (%not($ishidden($global_last_note_name)))
!if (%not($ishidden($global_last_note_target)))
' $global_last_note_name -- $global_last_note_target $stereotype
$global_last_note_name -- $global_last_note_target
!endif
!endif
!endif
!global $global_last_note_name = ''
!global $global_last_note_target = ''
!endprocedure
!procedure note($text, $name='', $target='')
$note_start($name, $target)
$text
$note_end()
!endprocedure
!procedure $note_test()
component(note_test_component)
note(abc)
!endprocedure
'$note_test()
!procedure $option_note_start($name='', $target='')
$note_start($name, $target)
!$str = $strReplace($name,$defaultWordSeparator,' ')
$option_label($str)
!endprocedure
!procedure $option_note_end()
$note_end()
!endprocedure
!procedure $option_test()
rectangle option_test $example {
card option_test_card [
$option_label("Opt ABC")
$option_pro() : option_pro
$option_con() : option_con
]
component option_test_component
option_test_card -- option_test_component $option_link(note_opt_test)
$option_note_start(note_opt_test, option_test_card)
description
---
$option_pro() : option_pro
$option_con() : option_con
$option_note_end()
}
!endprocedure
'$option_test()
@enduml