build_cmake/OMCompiler/Compiler/generated-mo/Template/GraphMLDumpTpl.mo
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | encapsulated package GraphMLDumpTpl | ||
| 2 | " | ||
| 3 | file: GraphMLDumpTpl.mo | ||
| 4 | package: GraphMLDumpTpl | ||
| 5 | description: Generated by Susan. | ||
| 6 | " | ||
| 7 | |||
| 8 | public import Tpl; | ||
| 9 | |||
| 10 | public import Util; | ||
| 11 | public import GraphML; | ||
| 12 | |||
| 13 | public function dumpGraphInfo | ||
| 14 | input Tpl.Text txt; | ||
| 15 | input GraphML.GraphInfo a_graphInfo; | ||
| 16 | input String a_fileName; | ||
| 17 | |||
| 18 | output Tpl.Text out_txt; | ||
| 19 | protected | ||
| 20 | Tpl.Text txt_0; | ||
| 21 | algorithm | ||
| 22 | 57 | txt_0 := dumpGraphInfoInternal(Tpl.emptyTxt, a_graphInfo); | |
| 23 | 57 | Tpl.textFile(txt_0, a_fileName); | |
| 24 | out_txt := txt; | ||
| 25 | end dumpGraphInfo; | ||
| 26 | |||
| 27 | protected function lm_5 | ||
| 28 | input output Tpl.Text txt; | ||
| 29 | input list<GraphML.Attribute> items; | ||
| 30 | algorithm | ||
| 31 |
2/2✓ Branch 0 taken 1067 times.
✓ Branch 1 taken 57 times.
|
1124 | for lstElt_5 in items loop |
| 32 | txt := match lstElt_5 | ||
| 33 | local | ||
| 34 | GraphML.Attribute i_att; | ||
| 35 | |||
| 36 | case i_att | ||
| 37 | algorithm | ||
| 38 | 1067 | txt := dumpAttDef(txt, i_att); | |
| 39 | 1067 | txt := Tpl.nextIter(txt); | |
| 40 | then txt; | ||
| 41 | end match; | ||
| 42 | end for; | ||
| 43 | end lm_5; | ||
| 44 | |||
| 45 | protected function lm_6 | ||
| 46 | input output Tpl.Text txt; | ||
| 47 | input list<GraphML.Edge> items; | ||
| 48 | input array<GraphML.Attribute> a_attributes; | ||
| 49 | input String a_graphInfo_graphEdgeKey; | ||
| 50 | algorithm | ||
| 51 |
2/2✓ Branch 0 taken 14426 times.
✓ Branch 1 taken 57 times.
|
14483 | for lstElt_6 in items loop |
| 52 | txt := match lstElt_6 | ||
| 53 | local | ||
| 54 | GraphML.Edge i_edge; | ||
| 55 | |||
| 56 | case i_edge | ||
| 57 | algorithm | ||
| 58 | 14426 | txt := dumpEdge(txt, i_edge, a_graphInfo_graphEdgeKey, a_attributes); | |
| 59 | 14426 | txt := Tpl.nextIter(txt); | |
| 60 | then txt; | ||
| 61 | end match; | ||
| 62 | end for; | ||
| 63 | end lm_6; | ||
| 64 | |||
| 65 | public function dumpGraphInfoInternal | ||
| 66 | input Tpl.Text in_txt; | ||
| 67 | input GraphML.GraphInfo in_a_graphInfo; | ||
| 68 | |||
| 69 | output Tpl.Text out_txt; | ||
| 70 | algorithm | ||
| 71 | out_txt := | ||
| 72 | match(in_txt, in_a_graphInfo) | ||
| 73 | local | ||
| 74 | Tpl.Text txt; | ||
| 75 | array<GraphML.Node> i_nodes; | ||
| 76 | array<GraphML.Graph> i_graphs; | ||
| 77 | String i_graphEdgeKey; | ||
| 78 | String i_graphNodeKey; | ||
| 79 | String i_graphInfo_graphEdgeKey; | ||
| 80 | list<GraphML.Edge> i_edges; | ||
| 81 | array<GraphML.Attribute> i_attributes; | ||
| 82 | GraphML.Graph ret_5; | ||
| 83 | Integer ret_4; | ||
| 84 | Integer ret_3; | ||
| 85 | Tpl.Text l_edgeDump; | ||
| 86 | list<GraphML.Attribute> ret_1; | ||
| 87 | Tpl.Text l_attDefDump; | ||
| 88 | |||
| 89 | case ( txt, | ||
| 90 | GraphML.GRAPHINFOARR(attributes = i_attributes, edges = i_edges, graphEdgeKey = (i_graphEdgeKey as i_graphInfo_graphEdgeKey), graphNodeKey = i_graphNodeKey, graphs = i_graphs, nodes = i_nodes) ) | ||
| 91 | algorithm | ||
| 92 | 57 | ret_1 := arrayList(i_attributes); | |
| 93 | 57 | l_attDefDump := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 94 | 57 | l_attDefDump := lm_5(l_attDefDump, ret_1); | |
| 95 | 57 | l_attDefDump := Tpl.popIter(l_attDefDump); | |
| 96 | 57 | l_edgeDump := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 97 | 57 | l_edgeDump := lm_6(l_edgeDump, i_edges, i_attributes, i_graphInfo_graphEdgeKey); | |
| 98 | 57 | l_edgeDump := Tpl.popIter(l_edgeDump); | |
| 99 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 100 | "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n", | ||
| 101 | "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:y=\"http://www.yworks.com/xml/graphml\" xmlns:yed=\"http://www.yworks.com/xml/yed/3\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd\">\n", | ||
| 102 | "\n" | ||
| 103 | }, true)); | ||
| 104 | 57 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 105 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<key for=\"node\" id=\"")); | |
| 106 | 57 | txt := Tpl.writeStr(txt, i_graphNodeKey); | |
| 107 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 108 | "\" yfiles.type=\"nodegraphics\"/>\n", | ||
| 109 | "<key attr.name=\"description\" attr.type=\"string\" for=\"node\" id=\"ddesc\" />\n", | ||
| 110 | "<key for=\"edge\" id=\"" | ||
| 111 | }, false)); | ||
| 112 | 57 | txt := Tpl.writeStr(txt, i_graphEdgeKey); | |
| 113 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 114 | "\" yfiles.type=\"edgegraphics\"/>\n", | ||
| 115 | "\n" | ||
| 116 | }, true)); | ||
| 117 | 57 | txt := Tpl.writeText(txt, l_attDefDump); | |
| 118 | 57 | txt := Tpl.softNewLine(txt); | |
| 119 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 120 | "\n", | ||
| 121 | "<!-- Graph Idx: " | ||
| 122 | }, false)); | ||
| 123 | ret_3 := arrayLength(i_graphs); | ||
| 124 | 57 | txt := Tpl.writeStr(txt, intString(ret_3)); | |
| 125 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_LINE(" -->\n")); | |
| 126 | ret_4 := arrayLength(i_graphs); | ||
| 127 | 57 | ret_5 := arrayGet(i_graphs, ret_4); | |
| 128 | 57 | txt := dumpGraph(txt, ret_5, i_graphs, i_nodes, Tpl.textString(l_edgeDump), i_graphNodeKey, i_attributes); | |
| 129 | 57 | txt := Tpl.softNewLine(txt); | |
| 130 | 57 | txt := Tpl.popBlock(txt); | |
| 131 | 57 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</graphml>")); | |
| 132 | then txt; | ||
| 133 | |||
| 134 | case ( txt, | ||
| 135 | _ ) | ||
| 136 | then txt; | ||
| 137 | end match; | ||
| 138 | end dumpGraphInfoInternal; | ||
| 139 | |||
| 140 | protected function lm_8 | ||
| 141 | input output Tpl.Text txt; | ||
| 142 | input list<Integer> items; | ||
| 143 | input array<GraphML.Attribute> a_graphAttributes; | ||
| 144 | input String a_graphNodeKey; | ||
| 145 | input array<GraphML.Graph> a_allGraphs; | ||
| 146 | input array<GraphML.Node> a_allNodes; | ||
| 147 | algorithm | ||
| 148 |
2/2✓ Branch 0 taken 8651 times.
✓ Branch 1 taken 105 times.
|
8756 | for lstElt_8 in items loop |
| 149 | txt := match lstElt_8 | ||
| 150 | local | ||
| 151 | Integer i_idc; | ||
| 152 | GraphML.Node ret_3; | ||
| 153 | Integer ret_2; | ||
| 154 | Integer ret_1; | ||
| 155 | Integer ret_0; | ||
| 156 | |||
| 157 | case i_idc | ||
| 158 | algorithm | ||
| 159 | ret_0 := arrayLength(a_allNodes); | ||
| 160 | 8651 | ret_1 := intSub(ret_0, i_idc); | |
| 161 | 8651 | ret_2 := intAdd(1, ret_1); | |
| 162 | 8651 | ret_3 := arrayGet(a_allNodes, ret_2); | |
| 163 | 8651 | txt := dumpNode(txt, ret_3, a_allGraphs, a_allNodes, a_graphNodeKey, a_graphAttributes); | |
| 164 | 8651 | txt := Tpl.nextIter(txt); | |
| 165 | then txt; | ||
| 166 | end match; | ||
| 167 | end for; | ||
| 168 | end lm_8; | ||
| 169 | |||
| 170 | protected function lm_9 | ||
| 171 | input output Tpl.Text txt; | ||
| 172 | input list<tuple<Integer, String>> items; | ||
| 173 | input array<GraphML.Attribute> a_graphAttributes; | ||
| 174 | algorithm | ||
| 175 |
2/2✓ Branch 0 taken 56 times.
✓ Branch 1 taken 105 times.
|
161 | for lstElt_9 in items loop |
| 176 | txt := match lstElt_9 | ||
| 177 | local | ||
| 178 | tuple<Integer, String> i_val; | ||
| 179 | |||
| 180 | case i_val | ||
| 181 | algorithm | ||
| 182 | 56 | txt := dumpAttKey(txt, i_val, a_graphAttributes); | |
| 183 | 56 | txt := Tpl.nextIter(txt); | |
| 184 | then txt; | ||
| 185 | end match; | ||
| 186 | end for; | ||
| 187 | end lm_9; | ||
| 188 | |||
| 189 | public function dumpGraph | ||
| 190 | input Tpl.Text in_txt; | ||
| 191 | input GraphML.Graph in_a_graph; | ||
| 192 | input array<GraphML.Graph> in_a_allGraphs; | ||
| 193 | input array<GraphML.Node> in_a_allNodes; | ||
| 194 | input String in_a_edgeDesc; | ||
| 195 | input String in_a_graphNodeKey; | ||
| 196 | input array<GraphML.Attribute> in_a_graphAttributes; | ||
| 197 | |||
| 198 | output Tpl.Text out_txt; | ||
| 199 | algorithm | ||
| 200 | out_txt := | ||
| 201 | match(in_txt, in_a_graph, in_a_allGraphs, in_a_allNodes, in_a_edgeDesc, in_a_graphNodeKey, in_a_graphAttributes) | ||
| 202 | local | ||
| 203 | Tpl.Text txt; | ||
| 204 | array<GraphML.Graph> a_allGraphs; | ||
| 205 | array<GraphML.Node> a_allNodes; | ||
| 206 | String a_edgeDesc; | ||
| 207 | String a_graphNodeKey; | ||
| 208 | array<GraphML.Attribute> a_graphAttributes; | ||
| 209 | String i_id; | ||
| 210 | Boolean i_directed; | ||
| 211 | list<tuple<Integer, String>> i_attValues; | ||
| 212 | list<Integer> i_nodeIdc; | ||
| 213 | Tpl.Text l_attKeys; | ||
| 214 | Tpl.Text l_graphNodes; | ||
| 215 | |||
| 216 | case ( txt, | ||
| 217 | GraphML.GRAPH(nodeIdc = i_nodeIdc, attValues = i_attValues, directed = i_directed, id = i_id), | ||
| 218 | a_allGraphs, | ||
| 219 | a_allNodes, | ||
| 220 | a_edgeDesc, | ||
| 221 | a_graphNodeKey, | ||
| 222 | a_graphAttributes ) | ||
| 223 | algorithm | ||
| 224 | 105 | l_graphNodes := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 225 | 105 | l_graphNodes := lm_8(l_graphNodes, i_nodeIdc, a_graphAttributes, a_graphNodeKey, a_allGraphs, a_allNodes); | |
| 226 | 105 | l_graphNodes := Tpl.popIter(l_graphNodes); | |
| 227 | 105 | l_attKeys := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 228 | 105 | l_attKeys := lm_9(l_attKeys, i_attValues, a_graphAttributes); | |
| 229 | 105 | l_attKeys := Tpl.popIter(l_attKeys); | |
| 230 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<graph edgedefault=\"")); | |
| 231 | 105 | txt := dumpDirected(txt, i_directed); | |
| 232 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" id=\"")); | |
| 233 | 105 | txt := Tpl.writeStr(txt, i_id); | |
| 234 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\">\n")); | |
| 235 | 105 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 236 | 105 | txt := Tpl.writeText(txt, l_attKeys); | |
| 237 | 105 | txt := Tpl.softNewLine(txt); | |
| 238 | 105 | txt := Tpl.writeText(txt, l_graphNodes); | |
| 239 | 105 | txt := Tpl.softNewLine(txt); | |
| 240 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE()); | |
| 241 | 105 | txt := Tpl.writeStr(txt, a_edgeDesc); | |
| 242 | 105 | txt := Tpl.softNewLine(txt); | |
| 243 | 105 | txt := Tpl.popBlock(txt); | |
| 244 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</graph>")); | |
| 245 | then txt; | ||
| 246 | |||
| 247 | case ( txt, | ||
| 248 | _, | ||
| 249 | _, | ||
| 250 | _, | ||
| 251 | _, | ||
| 252 | _, | ||
| 253 | _ ) | ||
| 254 | then txt; | ||
| 255 | end match; | ||
| 256 | end dumpGraph; | ||
| 257 | |||
| 258 | protected function lm_11 | ||
| 259 | input output Tpl.Text txt; | ||
| 260 | input list<GraphML.NodeLabel> items; | ||
| 261 | algorithm | ||
| 262 |
2/2✓ Branch 0 taken 13286 times.
✓ Branch 1 taken 8603 times.
|
21889 | for lstElt_11 in items loop |
| 263 | txt := match lstElt_11 | ||
| 264 | local | ||
| 265 | GraphML.NodeLabel i_label; | ||
| 266 | |||
| 267 | case i_label | ||
| 268 | algorithm | ||
| 269 | 13286 | txt := dumpNodeLabel(txt, i_label); | |
| 270 | 13286 | txt := Tpl.nextIter(txt); | |
| 271 | then txt; | ||
| 272 | end match; | ||
| 273 | end for; | ||
| 274 | end lm_11; | ||
| 275 | |||
| 276 | protected function lm_12 | ||
| 277 | input output Tpl.Text txt; | ||
| 278 | input list<tuple<Integer, String>> items; | ||
| 279 | input array<GraphML.Attribute> a_graphAttributes; | ||
| 280 | algorithm | ||
| 281 |
2/2✓ Branch 0 taken 64939 times.
✓ Branch 1 taken 8603 times.
|
73542 | for lstElt_12 in items loop |
| 282 | txt := match lstElt_12 | ||
| 283 | local | ||
| 284 | tuple<Integer, String> i_val; | ||
| 285 | |||
| 286 | case i_val | ||
| 287 | algorithm | ||
| 288 | 64939 | txt := dumpAttKey(txt, i_val, a_graphAttributes); | |
| 289 | 64939 | txt := Tpl.nextIter(txt); | |
| 290 | then txt; | ||
| 291 | end match; | ||
| 292 | end for; | ||
| 293 | end lm_12; | ||
| 294 | |||
| 295 | protected function fun_13 | ||
| 296 | input Tpl.Text in_txt; | ||
| 297 | input Option<String> in_mArg; | ||
| 298 | |||
| 299 | output Tpl.Text out_txt; | ||
| 300 | algorithm | ||
| 301 | out_txt := | ||
| 302 | match(in_txt, in_mArg) | ||
| 303 | local | ||
| 304 | Tpl.Text txt; | ||
| 305 | String i_val; | ||
| 306 | |||
| 307 | case ( txt, | ||
| 308 | SOME(i_val) ) | ||
| 309 | algorithm | ||
| 310 | 8603 | txt := Tpl.writeStr(txt, i_val); | |
| 311 | then txt; | ||
| 312 | |||
| 313 | case ( txt, | ||
| 314 | _ ) | ||
| 315 | then txt; | ||
| 316 | end match; | ||
| 317 | end fun_13; | ||
| 318 | |||
| 319 | protected function fun_14 | ||
| 320 | input Tpl.Text in_txt; | ||
| 321 | input Boolean in_a_isFolded; | ||
| 322 | |||
| 323 | output Tpl.Text out_txt; | ||
| 324 | algorithm | ||
| 325 | out_txt := | ||
| 326 | match(in_txt, in_a_isFolded) | ||
| 327 | local | ||
| 328 | Tpl.Text txt; | ||
| 329 | |||
| 330 | case ( txt, | ||
| 331 | false ) | ||
| 332 | algorithm | ||
| 333 | 16 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("group")); | |
| 334 | then txt; | ||
| 335 | |||
| 336 | case ( txt, | ||
| 337 | _ ) | ||
| 338 | algorithm | ||
| 339 | 32 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("folder")); | |
| 340 | then txt; | ||
| 341 | end match; | ||
| 342 | end fun_14; | ||
| 343 | |||
| 344 | protected function fun_15 | ||
| 345 | input Tpl.Text in_txt; | ||
| 346 | input Boolean in_a_isFolded; | ||
| 347 | |||
| 348 | output Tpl.Text out_txt; | ||
| 349 | algorithm | ||
| 350 | out_txt := | ||
| 351 | match(in_txt, in_a_isFolded) | ||
| 352 | local | ||
| 353 | Tpl.Text txt; | ||
| 354 | |||
| 355 | case ( txt, | ||
| 356 | false ) | ||
| 357 | algorithm | ||
| 358 | 16 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("0")); | |
| 359 | then txt; | ||
| 360 | |||
| 361 | case ( txt, | ||
| 362 | _ ) | ||
| 363 | algorithm | ||
| 364 | 32 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("1")); | |
| 365 | then txt; | ||
| 366 | end match; | ||
| 367 | end fun_15; | ||
| 368 | |||
| 369 | public function dumpNode | ||
| 370 | input Tpl.Text in_txt; | ||
| 371 | input GraphML.Node in_a_node; | ||
| 372 | input array<GraphML.Graph> in_a_allGraphs; | ||
| 373 | input array<GraphML.Node> in_a_allNodes; | ||
| 374 | input String in_a_graphNodeKey; | ||
| 375 | input array<GraphML.Attribute> in_a_graphAttributes; | ||
| 376 | |||
| 377 | output Tpl.Text out_txt; | ||
| 378 | algorithm | ||
| 379 | out_txt := | ||
| 380 | match(in_txt, in_a_node, in_a_allGraphs, in_a_allNodes, in_a_graphNodeKey, in_a_graphAttributes) | ||
| 381 | local | ||
| 382 | Tpl.Text txt; | ||
| 383 | array<GraphML.Graph> a_allGraphs; | ||
| 384 | array<GraphML.Node> a_allNodes; | ||
| 385 | String a_graphNodeKey; | ||
| 386 | array<GraphML.Attribute> a_graphAttributes; | ||
| 387 | Integer i_internalGraphIdx; | ||
| 388 | String i_header; | ||
| 389 | Boolean i_isFolded; | ||
| 390 | GraphML.ShapeType i_shapeType; | ||
| 391 | Real i_border; | ||
| 392 | String i_color; | ||
| 393 | Option<String> i_optDesc; | ||
| 394 | String i_id; | ||
| 395 | list<tuple<Integer, String>> i_attValues; | ||
| 396 | list<GraphML.NodeLabel> i_nodeLabels; | ||
| 397 | GraphML.Graph ret_10; | ||
| 398 | Integer ret_9; | ||
| 399 | Integer ret_8; | ||
| 400 | Integer ret_7; | ||
| 401 | Integer ret_6; | ||
| 402 | Integer ret_5; | ||
| 403 | Integer ret_4; | ||
| 404 | Tpl.Text l_activeType; | ||
| 405 | Tpl.Text l_folderType; | ||
| 406 | Tpl.Text l_attKeys; | ||
| 407 | Tpl.Text l_nodeLabelDump; | ||
| 408 | |||
| 409 | case ( txt, | ||
| 410 | GraphML.NODE(nodeLabels = i_nodeLabels, attValues = i_attValues, id = i_id, optDesc = i_optDesc, color = i_color, border = i_border, shapeType = i_shapeType), | ||
| 411 | _, | ||
| 412 | _, | ||
| 413 | a_graphNodeKey, | ||
| 414 | a_graphAttributes ) | ||
| 415 | algorithm | ||
| 416 | 8603 | l_nodeLabelDump := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 417 | 8603 | l_nodeLabelDump := lm_11(l_nodeLabelDump, i_nodeLabels); | |
| 418 | 8603 | l_nodeLabelDump := Tpl.popIter(l_nodeLabelDump); | |
| 419 | 8603 | l_attKeys := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 420 | 8603 | l_attKeys := lm_12(l_attKeys, i_attValues, a_graphAttributes); | |
| 421 | 8603 | l_attKeys := Tpl.popIter(l_attKeys); | |
| 422 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<node id=\"")); | |
| 423 | 8603 | txt := Tpl.writeStr(txt, i_id); | |
| 424 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\">\n")); | |
| 425 | 8603 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 426 | 8603 | txt := Tpl.writeText(txt, l_attKeys); | |
| 427 | 8603 | txt := Tpl.softNewLine(txt); | |
| 428 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<data key=\"ddesc\"><![CDATA[")); | |
| 429 | 8603 | txt := fun_13(txt, i_optDesc); | |
| 430 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 431 | "]]></data>\n", | ||
| 432 | "<data key=\"" | ||
| 433 | }, false)); | ||
| 434 | 8603 | txt := Tpl.writeStr(txt, a_graphNodeKey); | |
| 435 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 436 | "\">\n", | ||
| 437 | " <y:ShapeNode>\n" | ||
| 438 | }, true)); | ||
| 439 | 8603 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(6)); | |
| 440 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:Fill color=\"#")); | |
| 441 | 8603 | txt := Tpl.writeStr(txt, i_color); | |
| 442 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 443 | "\" transparent=\"false\"/>\n", | ||
| 444 | "<y:BorderStyle color=\"#000000\" type=\"line\" width=\"" | ||
| 445 | }, false)); | ||
| 446 | 8603 | txt := Tpl.writeStr(txt, realString(i_border)); | |
| 447 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\"/>\n")); | |
| 448 | 8603 | txt := Tpl.writeText(txt, l_nodeLabelDump); | |
| 449 | 8603 | txt := Tpl.softNewLine(txt); | |
| 450 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:Shape type=\"")); | |
| 451 | 8603 | txt := dumpShapeType(txt, i_shapeType); | |
| 452 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\"/>\n")); | |
| 453 | 8603 | txt := Tpl.popBlock(txt); | |
| 454 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 455 | " </y:ShapeNode>\n", | ||
| 456 | "</data>\n" | ||
| 457 | }, true)); | ||
| 458 | 8603 | txt := Tpl.popBlock(txt); | |
| 459 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</node>")); | |
| 460 | then txt; | ||
| 461 | |||
| 462 | case ( txt, | ||
| 463 | GraphML.GROUPNODE(isFolded = i_isFolded, id = i_id, header = i_header, internalGraphIdx = i_internalGraphIdx), | ||
| 464 | a_allGraphs, | ||
| 465 | a_allNodes, | ||
| 466 | a_graphNodeKey, | ||
| 467 | a_graphAttributes ) | ||
| 468 | algorithm | ||
| 469 | 48 | l_folderType := fun_14(Tpl.emptyTxt, i_isFolded); | |
| 470 | 48 | l_activeType := fun_15(Tpl.emptyTxt, i_isFolded); | |
| 471 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<node id=\"")); | |
| 472 | 48 | txt := Tpl.writeStr(txt, i_id); | |
| 473 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" yfiles.foldertype=\"")); | |
| 474 | 48 | txt := Tpl.writeText(txt, l_folderType); | |
| 475 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\">\n")); | |
| 476 | 48 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); | |
| 477 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<data key=\"")); | |
| 478 | 48 | txt := Tpl.writeStr(txt, a_graphNodeKey); | |
| 479 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 480 | "\">\n", | ||
| 481 | " <y:ProxyAutoBoundsNode>\n" | ||
| 482 | }, true)); | ||
| 483 | 48 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 484 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:Realizers active=\"")); | |
| 485 | 48 | txt := Tpl.writeText(txt, l_activeType); | |
| 486 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 487 | "\">\n", | ||
| 488 | " <y:GroupNode>\n", | ||
| 489 | " <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n" | ||
| 490 | }, true)); | ||
| 491 | 48 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 492 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\">")); | |
| 493 | 48 | txt := Tpl.writeStr(txt, i_header); | |
| 494 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 495 | "</y:NodeLabel>\n", | ||
| 496 | "<y:Shape type=\"roundrectangle\"/>\n", | ||
| 497 | "<y:State closed=\"false\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n", | ||
| 498 | "<y:Insets bottom=\"15\" bottomF=\"15.0\" left=\"15\" leftF=\"15.0\" right=\"15\" rightF=\"15.0\" top=\"15\" topF=\"15.0\"/>\n", | ||
| 499 | "<y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n" | ||
| 500 | }, true)); | ||
| 501 | 48 | txt := Tpl.popBlock(txt); | |
| 502 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 503 | " </y:GroupNode>\n", | ||
| 504 | " <y:GroupNode>\n", | ||
| 505 | " <y:Geometry height=\"50.0\" width=\"50.0\" x=\"0.0\" y=\"60.0\"/>\n", | ||
| 506 | " <y:Fill color=\"#F5F5F5\" transparent=\"false\"/>\n", | ||
| 507 | " <y:BorderStyle color=\"#000000\" type=\"dashed\" width=\"1.0\"/>\n" | ||
| 508 | }, true)); | ||
| 509 | 48 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 510 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:NodeLabel alignment=\"right\" autoSizePolicy=\"node_width\" backgroundColor=\"#EBEBEB\" borderDistance=\"0.0\" fontFamily=\"Dialog\" fontSize=\"15\" fontStyle=\"plain\" hasLineColor=\"false\" height=\"22.37646484375\" modelName=\"internal\" modelPosition=\"t\" textColor=\"#000000\" visible=\"true\">")); | |
| 511 | 48 | txt := Tpl.writeStr(txt, i_header); | |
| 512 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 513 | "</y:NodeLabel>\n", | ||
| 514 | "<y:Shape type=\"roundrectangle\"/>\n", | ||
| 515 | "<y:State closed=\"true\" closedHeight=\"50.0\" closedWidth=\"50.0\" innerGraphDisplayEnabled=\"false\"/>\n", | ||
| 516 | "<y:Insets bottom=\"5\" bottomF=\"5.0\" left=\"5\" leftF=\"5.0\" right=\"5\" rightF=\"5.0\" top=\"5\" topF=\"5.0\"/>\n", | ||
| 517 | "<y:BorderInsets bottom=\"0\" bottomF=\"0.0\" left=\"0\" leftF=\"0.0\" right=\"0\" rightF=\"0.0\" top=\"0\" topF=\"0.0\"/>\n" | ||
| 518 | }, true)); | ||
| 519 | 48 | txt := Tpl.popBlock(txt); | |
| 520 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 521 | " </y:GroupNode>\n", | ||
| 522 | "</y:Realizers>\n" | ||
| 523 | }, true)); | ||
| 524 | 48 | txt := Tpl.popBlock(txt); | |
| 525 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 526 | " </y:ProxyAutoBoundsNode>\n", | ||
| 527 | "</data>\n", | ||
| 528 | "<!-- Graph Idx: " | ||
| 529 | }, false)); | ||
| 530 | ret_4 := arrayLength(a_allGraphs); | ||
| 531 | 48 | ret_5 := intSub(ret_4, i_internalGraphIdx); | |
| 532 | 48 | ret_6 := intAdd(1, ret_5); | |
| 533 | 48 | txt := Tpl.writeStr(txt, intString(ret_6)); | |
| 534 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_LINE(" -->\n")); | |
| 535 | ret_7 := arrayLength(a_allGraphs); | ||
| 536 | 48 | ret_8 := intSub(ret_7, i_internalGraphIdx); | |
| 537 | 48 | ret_9 := intAdd(1, ret_8); | |
| 538 | 48 | ret_10 := arrayGet(a_allGraphs, ret_9); | |
| 539 | 48 | txt := dumpGraph(txt, ret_10, a_allGraphs, a_allNodes, "", a_graphNodeKey, a_graphAttributes); | |
| 540 | 48 | txt := Tpl.softNewLine(txt); | |
| 541 | 48 | txt := Tpl.popBlock(txt); | |
| 542 | 48 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</node>")); | |
| 543 | then txt; | ||
| 544 | |||
| 545 | case ( txt, | ||
| 546 | _, | ||
| 547 | _, | ||
| 548 | _, | ||
| 549 | _, | ||
| 550 | _ ) | ||
| 551 | then txt; | ||
| 552 | end match; | ||
| 553 | end dumpNode; | ||
| 554 | |||
| 555 | protected function lm_17 | ||
| 556 | input output Tpl.Text txt; | ||
| 557 | input list<GraphML.EdgeLabel> items; | ||
| 558 | algorithm | ||
| 559 |
2/2✓ Branch 0 taken 8535 times.
✓ Branch 1 taken 14426 times.
|
22961 | for lstElt_17 in items loop |
| 560 | txt := match lstElt_17 | ||
| 561 | local | ||
| 562 | GraphML.EdgeLabel i_label; | ||
| 563 | |||
| 564 | case i_label | ||
| 565 | algorithm | ||
| 566 | 8535 | txt := dumpEdgeLabel(txt, i_label); | |
| 567 | 8535 | txt := Tpl.nextIter(txt); | |
| 568 | then txt; | ||
| 569 | end match; | ||
| 570 | end for; | ||
| 571 | end lm_17; | ||
| 572 | |||
| 573 | protected function lm_18 | ||
| 574 | input output Tpl.Text txt; | ||
| 575 | input list<tuple<Integer, String>> items; | ||
| 576 | input array<GraphML.Attribute> a_graphAttributes; | ||
| 577 | algorithm | ||
| 578 |
2/2✓ Branch 0 taken 42675 times.
✓ Branch 1 taken 14426 times.
|
57101 | for lstElt_18 in items loop |
| 579 | txt := match lstElt_18 | ||
| 580 | local | ||
| 581 | tuple<Integer, String> i_val; | ||
| 582 | |||
| 583 | case i_val | ||
| 584 | algorithm | ||
| 585 | 42675 | txt := dumpAttKey(txt, i_val, a_graphAttributes); | |
| 586 | 42675 | txt := Tpl.nextIter(txt); | |
| 587 | then txt; | ||
| 588 | end match; | ||
| 589 | end for; | ||
| 590 | end lm_18; | ||
| 591 | |||
| 592 | public function dumpEdge | ||
| 593 | input Tpl.Text in_txt; | ||
| 594 | input GraphML.Edge in_a_edge; | ||
| 595 | input String in_a_graphEdgeKey; | ||
| 596 | input array<GraphML.Attribute> in_a_graphAttributes; | ||
| 597 | |||
| 598 | output Tpl.Text out_txt; | ||
| 599 | algorithm | ||
| 600 | out_txt := | ||
| 601 | match(in_txt, in_a_edge, in_a_graphEdgeKey, in_a_graphAttributes) | ||
| 602 | local | ||
| 603 | Tpl.Text txt; | ||
| 604 | String a_graphEdgeKey; | ||
| 605 | array<GraphML.Attribute> a_graphAttributes; | ||
| 606 | Boolean i_smooth; | ||
| 607 | tuple<GraphML.ArrowType, GraphML.ArrowType> i_arrows; | ||
| 608 | Real i_lineWidth; | ||
| 609 | GraphML.LineType i_lineType; | ||
| 610 | String i_color; | ||
| 611 | String i_target; | ||
| 612 | String i_source; | ||
| 613 | String i_id; | ||
| 614 | list<tuple<Integer, String>> i_attValues; | ||
| 615 | list<GraphML.EdgeLabel> i_edgeLabels; | ||
| 616 | GraphML.ArrowType ret_3; | ||
| 617 | GraphML.ArrowType ret_2; | ||
| 618 | Tpl.Text l_attKeys; | ||
| 619 | Tpl.Text l_edgeLabelDump; | ||
| 620 | |||
| 621 | case ( txt, | ||
| 622 | GraphML.EDGE(edgeLabels = i_edgeLabels, attValues = i_attValues, id = i_id, source = i_source, target = i_target, color = i_color, lineType = i_lineType, lineWidth = i_lineWidth, arrows = i_arrows, smooth = i_smooth), | ||
| 623 | a_graphEdgeKey, | ||
| 624 | a_graphAttributes ) | ||
| 625 | algorithm | ||
| 626 | 14426 | l_edgeLabelDump := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 627 | 14426 | l_edgeLabelDump := lm_17(l_edgeLabelDump, i_edgeLabels); | |
| 628 | 14426 | l_edgeLabelDump := Tpl.popIter(l_edgeLabelDump); | |
| 629 | 14426 | l_attKeys := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 630 | 14426 | l_attKeys := lm_18(l_attKeys, i_attValues, a_graphAttributes); | |
| 631 | 14426 | l_attKeys := Tpl.popIter(l_attKeys); | |
| 632 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<edge id=\"")); | |
| 633 | 14426 | txt := Tpl.writeStr(txt, i_id); | |
| 634 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" source=\"")); | |
| 635 | 14426 | txt := Tpl.writeStr(txt, i_source); | |
| 636 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" target=\"")); | |
| 637 | 14426 | txt := Tpl.writeStr(txt, i_target); | |
| 638 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\">\n")); | |
| 639 | 14426 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); | |
| 640 | 14426 | txt := Tpl.writeText(txt, l_attKeys); | |
| 641 | 14426 | txt := Tpl.softNewLine(txt); | |
| 642 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<data key=\"")); | |
| 643 | 14426 | txt := Tpl.writeStr(txt, a_graphEdgeKey); | |
| 644 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 645 | "\">\n", | ||
| 646 | " <y:PolyLineEdge>\n", | ||
| 647 | " <y:Path sx=\"0.0\" sy=\"0.0\" tx=\"0.0\" ty=\"0.0\"/>\n" | ||
| 648 | }, true)); | ||
| 649 | 14426 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 650 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:LineStyle color=\"#")); | |
| 651 | 14426 | txt := Tpl.writeStr(txt, i_color); | |
| 652 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" type=\"")); | |
| 653 | 14426 | txt := dumpLineType(txt, i_lineType); | |
| 654 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" width=\"")); | |
| 655 | 14426 | txt := Tpl.writeStr(txt, realString(i_lineWidth)); | |
| 656 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 657 | "\"/>\n", | ||
| 658 | "<y:Arrows source=\"" | ||
| 659 | }, false)); | ||
| 660 | 14426 | ret_2 := Util.tuple21(i_arrows); | |
| 661 | 14426 | txt := dumpArrowType(txt, ret_2); | |
| 662 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" target=\"")); | |
| 663 | 14426 | ret_3 := Util.tuple22(i_arrows); | |
| 664 | 14426 | txt := dumpArrowType(txt, ret_3); | |
| 665 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 666 | "\"/>\n", | ||
| 667 | "<y:BendStyle smoothed=\"" | ||
| 668 | }, false)); | ||
| 669 | 14426 | txt := Tpl.writeStr(txt, Tpl.booleanString(i_smooth)); | |
| 670 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\"/>\n")); | |
| 671 | 14426 | txt := Tpl.writeText(txt, l_edgeLabelDump); | |
| 672 | 14426 | txt := Tpl.softNewLine(txt); | |
| 673 | 14426 | txt := Tpl.popBlock(txt); | |
| 674 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ | |
| 675 | " </y:PolyLineEdge>\n", | ||
| 676 | "</data>\n" | ||
| 677 | }, true)); | ||
| 678 | 14426 | txt := Tpl.popBlock(txt); | |
| 679 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</edge>")); | |
| 680 | then txt; | ||
| 681 | |||
| 682 | case ( txt, | ||
| 683 | _, | ||
| 684 | _, | ||
| 685 | _ ) | ||
| 686 | then txt; | ||
| 687 | end match; | ||
| 688 | end dumpEdge; | ||
| 689 | |||
| 690 | public function dumpEdgeLabel | ||
| 691 | input Tpl.Text in_txt; | ||
| 692 | input GraphML.EdgeLabel in_a_edgeLabel; | ||
| 693 | |||
| 694 | output Tpl.Text out_txt; | ||
| 695 | algorithm | ||
| 696 | out_txt := | ||
| 697 | match(in_txt, in_a_edgeLabel) | ||
| 698 | local | ||
| 699 | Tpl.Text txt; | ||
| 700 | String i_text; | ||
| 701 | Integer i_fontSize; | ||
| 702 | Option<String> i_backgroundColor; | ||
| 703 | Tpl.Text l_bgColor; | ||
| 704 | |||
| 705 | case ( txt, | ||
| 706 | GraphML.EDGELABEL(backgroundColor = i_backgroundColor, fontSize = i_fontSize, text = i_text) ) | ||
| 707 | algorithm | ||
| 708 | 8535 | l_bgColor := dumpColorOpt(Tpl.emptyTxt, i_backgroundColor); | |
| 709 | 8535 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:EdgeLabel alignment=\"center\" distance=\"2.0\" fontFamily=\"Dialog\" ")); | |
| 710 | 8535 | txt := Tpl.writeText(txt, l_bgColor); | |
| 711 | 8535 | txt := Tpl.writeTok(txt, Tpl.ST_STRING(" fontSize=\"")); | |
| 712 | 8535 | txt := Tpl.writeStr(txt, intString(i_fontSize)); | |
| 713 | 8535 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" fontStyle=\"plain\" hasBackgroundColor=\"false\" hasLineColor=\"false\" modelName=\"side_slider\" preferredPlacement=\"anywhere\" visible=\"true\">")); | |
| 714 | 8535 | txt := Tpl.writeStr(txt, i_text); | |
| 715 | 8535 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</y:EdgeLabel>")); | |
| 716 | then txt; | ||
| 717 | |||
| 718 | case ( txt, | ||
| 719 | _ ) | ||
| 720 | then txt; | ||
| 721 | end match; | ||
| 722 | end dumpEdgeLabel; | ||
| 723 | |||
| 724 | public function dumpNodeLabel | ||
| 725 | input Tpl.Text in_txt; | ||
| 726 | input GraphML.NodeLabel in_a_nodeLabel; | ||
| 727 | |||
| 728 | output Tpl.Text out_txt; | ||
| 729 | algorithm | ||
| 730 | out_txt := | ||
| 731 | match(in_txt, in_a_nodeLabel) | ||
| 732 | local | ||
| 733 | Tpl.Text txt; | ||
| 734 | String i_position; | ||
| 735 | String i_text; | ||
| 736 | GraphML.FontStyle i_fontStyle; | ||
| 737 | Option<String> i_backgroundColor; | ||
| 738 | Tpl.Text l_bgColor; | ||
| 739 | |||
| 740 | case ( txt, | ||
| 741 | GraphML.NODELABEL_INTERNAL(backgroundColor = i_backgroundColor, fontStyle = i_fontStyle, text = i_text) ) | ||
| 742 | algorithm | ||
| 743 | 8603 | l_bgColor := dumpColorOpt(Tpl.emptyTxt, i_backgroundColor); | |
| 744 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" ")); | |
| 745 | 8603 | txt := Tpl.writeText(txt, l_bgColor); | |
| 746 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING(" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"")); | |
| 747 | 8603 | txt := dumpFontStyle(txt, i_fontStyle); | |
| 748 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" hasLineColor=\"false\" modelName=\"internal\" modelPosition=\"c\" textColor=\"#000000\" visible=\"true\">")); | |
| 749 | 8603 | txt := Tpl.writeStr(txt, i_text); | |
| 750 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</y:NodeLabel>")); | |
| 751 | then txt; | ||
| 752 | |||
| 753 | case ( txt, | ||
| 754 | GraphML.NODELABEL_CORNER(backgroundColor = i_backgroundColor, fontStyle = i_fontStyle, position = i_position, text = i_text) ) | ||
| 755 | algorithm | ||
| 756 | 4683 | l_bgColor := dumpColorOpt(Tpl.emptyTxt, i_backgroundColor); | |
| 757 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<y:NodeLabel alignment=\"center\" autoSizePolicy=\"content\" ")); | |
| 758 | 4683 | txt := Tpl.writeText(txt, l_bgColor); | |
| 759 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING(" fontFamily=\"Dialog\" fontSize=\"12\" fontStyle=\"")); | |
| 760 | 4683 | txt := dumpFontStyle(txt, i_fontStyle); | |
| 761 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" hasLineColor=\"false\" modelName=\"corners\" modelPosition=\"")); | |
| 762 | 4683 | txt := Tpl.writeStr(txt, i_position); | |
| 763 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" textColor=\"#000000\" visible=\"true\">")); | |
| 764 | 4683 | txt := Tpl.writeStr(txt, i_text); | |
| 765 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</y:NodeLabel>")); | |
| 766 | then txt; | ||
| 767 | |||
| 768 | case ( txt, | ||
| 769 | _ ) | ||
| 770 | then txt; | ||
| 771 | end match; | ||
| 772 | end dumpNodeLabel; | ||
| 773 | |||
| 774 | protected function fun_22 | ||
| 775 | input Tpl.Text in_txt; | ||
| 776 | input GraphML.Attribute in_mArg; | ||
| 777 | input String in_a_val; | ||
| 778 | input Integer in_a_idx; | ||
| 779 | |||
| 780 | output Tpl.Text out_txt; | ||
| 781 | algorithm | ||
| 782 | out_txt := | ||
| 783 | match(in_txt, in_mArg, in_a_val, in_a_idx) | ||
| 784 | local | ||
| 785 | Tpl.Text txt; | ||
| 786 | String a_val; | ||
| 787 | Integer a_idx; | ||
| 788 | |||
| 789 | case ( txt, | ||
| 790 | GraphML.ATTRIBUTE(attType = GraphML.TYPE_STRING()), | ||
| 791 | a_val, | ||
| 792 | a_idx ) | ||
| 793 | algorithm | ||
| 794 | 32214 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<data key=\"cust")); | |
| 795 | 32214 | txt := Tpl.writeStr(txt, intString(a_idx)); | |
| 796 | 32214 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"><![CDATA[")); | |
| 797 | 32214 | txt := Tpl.writeStr(txt, a_val); | |
| 798 | 32214 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("]]></data>")); | |
| 799 | then txt; | ||
| 800 | |||
| 801 | case ( txt, | ||
| 802 | _, | ||
| 803 | a_val, | ||
| 804 | a_idx ) | ||
| 805 | algorithm | ||
| 806 | 75456 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<data key=\"cust")); | |
| 807 | 75456 | txt := Tpl.writeStr(txt, intString(a_idx)); | |
| 808 | 75456 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\">")); | |
| 809 | 75456 | txt := Tpl.writeStr(txt, a_val); | |
| 810 | 75456 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</data>")); | |
| 811 | then txt; | ||
| 812 | end match; | ||
| 813 | end fun_22; | ||
| 814 | |||
| 815 | public function dumpAttKey | ||
| 816 | input Tpl.Text in_txt; | ||
| 817 | input tuple<Integer, String> in_a_key; | ||
| 818 | input array<GraphML.Attribute> in_a_graphAttributes; | ||
| 819 | |||
| 820 | output Tpl.Text out_txt; | ||
| 821 | algorithm | ||
| 822 | out_txt := | ||
| 823 | match(in_txt, in_a_key, in_a_graphAttributes) | ||
| 824 | local | ||
| 825 | Tpl.Text txt; | ||
| 826 | array<GraphML.Attribute> a_graphAttributes; | ||
| 827 | String i_val; | ||
| 828 | Integer i_idx; | ||
| 829 | GraphML.Attribute ret_0; | ||
| 830 | |||
| 831 | case ( txt, | ||
| 832 | (i_idx, i_val), | ||
| 833 | a_graphAttributes ) | ||
| 834 | algorithm | ||
| 835 | 107670 | ret_0 := arrayGet(a_graphAttributes, i_idx); | |
| 836 | 107670 | txt := fun_22(txt, ret_0, i_val, i_idx); | |
| 837 | then txt; | ||
| 838 | end match; | ||
| 839 | end dumpAttKey; | ||
| 840 | |||
| 841 | public function dumpAttDef | ||
| 842 | input Tpl.Text in_txt; | ||
| 843 | input GraphML.Attribute in_a_attribute; | ||
| 844 | |||
| 845 | output Tpl.Text out_txt; | ||
| 846 | algorithm | ||
| 847 | out_txt := | ||
| 848 | match(in_txt, in_a_attribute) | ||
| 849 | local | ||
| 850 | Tpl.Text txt; | ||
| 851 | String i_defaultValue; | ||
| 852 | Integer i_attIdx; | ||
| 853 | GraphML.AttributeTarget i_attTarget; | ||
| 854 | GraphML.AttributeType i_attType; | ||
| 855 | String i_name; | ||
| 856 | |||
| 857 | case ( txt, | ||
| 858 | GraphML.ATTRIBUTE(name = i_name, attType = i_attType, attTarget = i_attTarget, attIdx = i_attIdx, defaultValue = i_defaultValue) ) | ||
| 859 | algorithm | ||
| 860 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<key attr.name=\"")); | |
| 861 | 1067 | txt := Tpl.writeStr(txt, i_name); | |
| 862 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" attr.type=\"")); | |
| 863 | 1067 | txt := dumpAttType(txt, i_attType); | |
| 864 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" for=\"")); | |
| 865 | 1067 | txt := dumpAttTarget(txt, i_attTarget); | |
| 866 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" id=\"cust")); | |
| 867 | 1067 | txt := Tpl.writeStr(txt, intString(i_attIdx)); | |
| 868 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("\">\n")); | |
| 869 | 1067 | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4)); | |
| 870 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<default>")); | |
| 871 | 1067 | txt := Tpl.writeStr(txt, i_defaultValue); | |
| 872 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_LINE("</default>\n")); | |
| 873 | 1067 | txt := Tpl.popBlock(txt); | |
| 874 | 1067 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</key>")); | |
| 875 | then txt; | ||
| 876 | |||
| 877 | case ( txt, | ||
| 878 | _ ) | ||
| 879 | then txt; | ||
| 880 | end match; | ||
| 881 | end dumpAttDef; | ||
| 882 | |||
| 883 | public function dumpAttType | ||
| 884 | input Tpl.Text in_txt; | ||
| 885 | input GraphML.AttributeType in_a_type; | ||
| 886 | |||
| 887 | output Tpl.Text out_txt; | ||
| 888 | algorithm | ||
| 889 | out_txt := | ||
| 890 | match(in_txt, in_a_type) | ||
| 891 | local | ||
| 892 | Tpl.Text txt; | ||
| 893 | |||
| 894 | case ( txt, | ||
| 895 | GraphML.TYPE_STRING() ) | ||
| 896 | algorithm | ||
| 897 | 395 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("string")); | |
| 898 | then txt; | ||
| 899 | |||
| 900 | case ( txt, | ||
| 901 | GraphML.TYPE_BOOLEAN() ) | ||
| 902 | algorithm | ||
| 903 | 168 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("boolean")); | |
| 904 | then txt; | ||
| 905 | |||
| 906 | case ( txt, | ||
| 907 | GraphML.TYPE_INTEGER() ) | ||
| 908 | algorithm | ||
| 909 | 392 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("int")); | |
| 910 | then txt; | ||
| 911 | |||
| 912 | case ( txt, | ||
| 913 | GraphML.TYPE_DOUBLE() ) | ||
| 914 | algorithm | ||
| 915 | 112 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("double")); | |
| 916 | then txt; | ||
| 917 | |||
| 918 | case ( txt, | ||
| 919 | _ ) | ||
| 920 | then txt; | ||
| 921 | end match; | ||
| 922 | end dumpAttType; | ||
| 923 | |||
| 924 | public function dumpAttTarget | ||
| 925 | input Tpl.Text in_txt; | ||
| 926 | input GraphML.AttributeTarget in_a_target; | ||
| 927 | |||
| 928 | output Tpl.Text out_txt; | ||
| 929 | algorithm | ||
| 930 | out_txt := | ||
| 931 | match(in_txt, in_a_target) | ||
| 932 | local | ||
| 933 | Tpl.Text txt; | ||
| 934 | |||
| 935 | case ( txt, | ||
| 936 | GraphML.TARGET_NODE() ) | ||
| 937 | algorithm | ||
| 938 | 731 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("node")); | |
| 939 | then txt; | ||
| 940 | |||
| 941 | case ( txt, | ||
| 942 | GraphML.TARGET_EDGE() ) | ||
| 943 | algorithm | ||
| 944 | 280 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("edge")); | |
| 945 | then txt; | ||
| 946 | |||
| 947 | case ( txt, | ||
| 948 | GraphML.TARGET_GRAPH() ) | ||
| 949 | algorithm | ||
| 950 | 56 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("graph")); | |
| 951 | then txt; | ||
| 952 | |||
| 953 | case ( txt, | ||
| 954 | _ ) | ||
| 955 | then txt; | ||
| 956 | end match; | ||
| 957 | end dumpAttTarget; | ||
| 958 | |||
| 959 | public function dumpDirected | ||
| 960 | input Tpl.Text in_txt; | ||
| 961 | input Boolean in_a_directed; | ||
| 962 | |||
| 963 | output Tpl.Text out_txt; | ||
| 964 | algorithm | ||
| 965 | out_txt := | ||
| 966 | match(in_txt, in_a_directed) | ||
| 967 | local | ||
| 968 | Tpl.Text txt; | ||
| 969 | |||
| 970 | case ( txt, | ||
| 971 | true ) | ||
| 972 | algorithm | ||
| 973 | 105 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("directed")); | |
| 974 | then txt; | ||
| 975 | |||
| 976 | case ( txt, | ||
| 977 | false ) | ||
| 978 | algorithm | ||
| 979 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("undirected")); | |
| 980 | then txt; | ||
| 981 | |||
| 982 | case ( txt, | ||
| 983 | _ ) | ||
| 984 | then txt; | ||
| 985 | end match; | ||
| 986 | end dumpDirected; | ||
| 987 | |||
| 988 | public function dumpColorOpt | ||
| 989 | input Tpl.Text in_txt; | ||
| 990 | input Option<String> in_a_colorOpt; | ||
| 991 | |||
| 992 | output Tpl.Text out_txt; | ||
| 993 | algorithm | ||
| 994 | out_txt := | ||
| 995 | match(in_txt, in_a_colorOpt) | ||
| 996 | local | ||
| 997 | Tpl.Text txt; | ||
| 998 | String i_col; | ||
| 999 | |||
| 1000 | case ( txt, | ||
| 1001 | SOME(i_col) ) | ||
| 1002 | algorithm | ||
| 1003 | 13218 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("backgroundColor=\"#")); | |
| 1004 | 13218 | txt := Tpl.writeStr(txt, i_col); | |
| 1005 | 13218 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"")); | |
| 1006 | then txt; | ||
| 1007 | |||
| 1008 | case ( txt, | ||
| 1009 | _ ) | ||
| 1010 | then txt; | ||
| 1011 | end match; | ||
| 1012 | end dumpColorOpt; | ||
| 1013 | |||
| 1014 | public function dumpFontStyle | ||
| 1015 | input Tpl.Text in_txt; | ||
| 1016 | input GraphML.FontStyle in_a_fontStyle; | ||
| 1017 | |||
| 1018 | output Tpl.Text out_txt; | ||
| 1019 | algorithm | ||
| 1020 | out_txt := | ||
| 1021 | match(in_txt, in_a_fontStyle) | ||
| 1022 | local | ||
| 1023 | Tpl.Text txt; | ||
| 1024 | |||
| 1025 | case ( txt, | ||
| 1026 | GraphML.FONTPLAIN() ) | ||
| 1027 | algorithm | ||
| 1028 | 8603 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("plain")); | |
| 1029 | then txt; | ||
| 1030 | |||
| 1031 | case ( txt, | ||
| 1032 | GraphML.FONTBOLD() ) | ||
| 1033 | algorithm | ||
| 1034 | 4683 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("bold")); | |
| 1035 | then txt; | ||
| 1036 | |||
| 1037 | case ( txt, | ||
| 1038 | GraphML.FONTITALIC() ) | ||
| 1039 | algorithm | ||
| 1040 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("italic")); | |
| 1041 | then txt; | ||
| 1042 | |||
| 1043 | case ( txt, | ||
| 1044 | GraphML.FONTBOLDITALIC() ) | ||
| 1045 | algorithm | ||
| 1046 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("bolditalic")); | |
| 1047 | then txt; | ||
| 1048 | |||
| 1049 | case ( txt, | ||
| 1050 | _ ) | ||
| 1051 | then txt; | ||
| 1052 | end match; | ||
| 1053 | end dumpFontStyle; | ||
| 1054 | |||
| 1055 | public function dumpLineType | ||
| 1056 | input Tpl.Text in_txt; | ||
| 1057 | input GraphML.LineType in_a_lineType; | ||
| 1058 | |||
| 1059 | output Tpl.Text out_txt; | ||
| 1060 | algorithm | ||
| 1061 | out_txt := | ||
| 1062 | match(in_txt, in_a_lineType) | ||
| 1063 | local | ||
| 1064 | Tpl.Text txt; | ||
| 1065 | |||
| 1066 | case ( txt, | ||
| 1067 | GraphML.LINE() ) | ||
| 1068 | algorithm | ||
| 1069 | 14426 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("line")); | |
| 1070 | then txt; | ||
| 1071 | |||
| 1072 | case ( txt, | ||
| 1073 | GraphML.DASHED() ) | ||
| 1074 | algorithm | ||
| 1075 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("dashed")); | |
| 1076 | then txt; | ||
| 1077 | |||
| 1078 | case ( txt, | ||
| 1079 | GraphML.DASHEDDOTTED() ) | ||
| 1080 | algorithm | ||
| 1081 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("dasheddotted")); | |
| 1082 | then txt; | ||
| 1083 | |||
| 1084 | case ( txt, | ||
| 1085 | _ ) | ||
| 1086 | then txt; | ||
| 1087 | end match; | ||
| 1088 | end dumpLineType; | ||
| 1089 | |||
| 1090 | public function dumpArrowType | ||
| 1091 | input Tpl.Text in_txt; | ||
| 1092 | input GraphML.ArrowType in_a_arrowType; | ||
| 1093 | |||
| 1094 | output Tpl.Text out_txt; | ||
| 1095 | algorithm | ||
| 1096 | out_txt := | ||
| 1097 | match(in_txt, in_a_arrowType) | ||
| 1098 | local | ||
| 1099 | Tpl.Text txt; | ||
| 1100 | |||
| 1101 | case ( txt, | ||
| 1102 | GraphML.ARROWSTANDART() ) | ||
| 1103 | algorithm | ||
| 1104 | 14315 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("standard")); | |
| 1105 | then txt; | ||
| 1106 | |||
| 1107 | case ( txt, | ||
| 1108 | GraphML.ARROWNONE() ) | ||
| 1109 | algorithm | ||
| 1110 | 14537 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("none")); | |
| 1111 | then txt; | ||
| 1112 | |||
| 1113 | case ( txt, | ||
| 1114 | GraphML.ARROWCONCAVE() ) | ||
| 1115 | algorithm | ||
| 1116 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("concave")); | |
| 1117 | then txt; | ||
| 1118 | |||
| 1119 | case ( txt, | ||
| 1120 | _ ) | ||
| 1121 | then txt; | ||
| 1122 | end match; | ||
| 1123 | end dumpArrowType; | ||
| 1124 | |||
| 1125 | public function dumpShapeType | ||
| 1126 | input Tpl.Text in_txt; | ||
| 1127 | input GraphML.ShapeType in_a_shape; | ||
| 1128 | |||
| 1129 | output Tpl.Text out_txt; | ||
| 1130 | algorithm | ||
| 1131 | out_txt := | ||
| 1132 | match(in_txt, in_a_shape) | ||
| 1133 | local | ||
| 1134 | Tpl.Text txt; | ||
| 1135 | |||
| 1136 | case ( txt, | ||
| 1137 | GraphML.RECTANGLE() ) | ||
| 1138 | algorithm | ||
| 1139 | 4718 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("rectangle")); | |
| 1140 | then txt; | ||
| 1141 | |||
| 1142 | case ( txt, | ||
| 1143 | GraphML.ROUNDRECTANGLE() ) | ||
| 1144 | algorithm | ||
| 1145 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("roundrectangle")); | |
| 1146 | then txt; | ||
| 1147 | |||
| 1148 | case ( txt, | ||
| 1149 | GraphML.ELLIPSE() ) | ||
| 1150 | algorithm | ||
| 1151 | 3885 | txt := Tpl.writeTok(txt, Tpl.ST_STRING("ellipse")); | |
| 1152 | then txt; | ||
| 1153 | |||
| 1154 | case ( txt, | ||
| 1155 | GraphML.PARALLELOGRAM() ) | ||
| 1156 | algorithm | ||
| 1157 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("parallelogram")); | |
| 1158 | then txt; | ||
| 1159 | |||
| 1160 | case ( txt, | ||
| 1161 | GraphML.HEXAGON() ) | ||
| 1162 | algorithm | ||
| 1163 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("hexagon")); | |
| 1164 | then txt; | ||
| 1165 | |||
| 1166 | case ( txt, | ||
| 1167 | GraphML.TRIANGLE() ) | ||
| 1168 | algorithm | ||
| 1169 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("triangle")); | |
| 1170 | then txt; | ||
| 1171 | |||
| 1172 | case ( txt, | ||
| 1173 | GraphML.OCTAGON() ) | ||
| 1174 | algorithm | ||
| 1175 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("octagon")); | |
| 1176 | then txt; | ||
| 1177 | |||
| 1178 | case ( txt, | ||
| 1179 | GraphML.DIAMOND() ) | ||
| 1180 | algorithm | ||
| 1181 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("diamond")); | |
| 1182 | then txt; | ||
| 1183 | |||
| 1184 | case ( txt, | ||
| 1185 | GraphML.TRAPEZOID() ) | ||
| 1186 | algorithm | ||
| 1187 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("trapezoid")); | |
| 1188 | then txt; | ||
| 1189 | |||
| 1190 | case ( txt, | ||
| 1191 | GraphML.TRAPEZOID2() ) | ||
| 1192 | algorithm | ||
| 1193 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("trapezoid2")); | |
| 1194 | then txt; | ||
| 1195 | |||
| 1196 | case ( txt, | ||
| 1197 | _ ) | ||
| 1198 | then txt; | ||
| 1199 | end match; | ||
| 1200 | end dumpShapeType; | ||
| 1201 | |||
| 1202 | annotation(__OpenModelica_Interface="codegen_graphml"); | ||
| 1203 | end GraphMLDumpTpl; | ||
| 1204 |