Difference between revisions of "Artefact:Template/org/oomodels/converter/templates/simplediagram-1.0-svg-1.1"

From OOModels
Jump to navigationJump to search
Line 12: Line 12:
  <span class="oogintro">G-2.0-xml_string-1.0 -*- coding: utf-8; -*-</span>
  <span class="oogintro">G-2.0-xml_string-1.0 -*- coding: utf-8; -*-</span>
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <svg xmlns="http://www.w3.org/2000/svg">
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <span class="oogindentation">  ⋮</span><span class="oogcode">«∀(a:<span class="oogpath">‖"Ⓧ/Diagram/Item"</span>){»</span><span class="oogcontinuation">…</span>
  <span class="oogindentation">  ⋮</span><span class="oogcode">«∀(a:<span class="oogpath">‖"Ⓧ/Diagram/Item"</span>){»</span><span class="oogcontinuation">…</span>
  <span class="oogindentation">  ⋮</span><span class="oogcode">« String name = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Name"</span>).toString();</span>
  <span class="oogindentation">  ⋮</span><span class="oogcode">« String name = ((XMLNode)<span class="oogpath">‖"Ⓧ/@Name"</span>).toString();</span>
Line 18: Line 18:
  <span class="oogcode">    int len = name.length();</span>
  <span class="oogcode">    int len = name.length();</span>
  <span class="oogcode">    int width = len * 10; »</span><span class="oogcontinuation">…</span>
  <span class="oogcode">    int width = len * 10; »</span><span class="oogcontinuation">…</span>
   <g transform="translate(<span class="oogexpression">◂8*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@X"</span>)).toString())▸</span>,<span class="oogexpression">◂16*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@Y"</span>)).toString())▸</span>)">
   <g transform="translate(<span class="oogexpression">◂8*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@X"</span>)).toString())▸</span>,<span class="oogexpression">◂16*Integer.parseInt(((XMLNode)(<span class="oogpath">‖"Ⓧ/@Y"</span>)).toString())▸</span>)" xlink:href="<span class="oogexpression">◂<span class="oogpath">‖"Ⓧ/@Item"</span>▸</span>">
  <span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("Class")){»</span><span class="oogcontinuation">…</span>
  <span class="oogindentation">    ⋮</span><span class="oogcode">«if(type.equals("Class")){»</span><span class="oogcontinuation">…</span>
     <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
     <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
Line 47: Line 47:
                   text-align:center;text-anchor:middle;fill:#000000;font-family:Sans"><span class="oogexpression">◂name▸</span></text>
                   text-align:center;text-anchor:middle;fill:#000000;font-family:Sans"><span class="oogexpression">◂name▸</span></text>
   </g>
   </g>
  <!-- <span class="oogexpression">◂<span class="oogpath">‖"Ⓧ/@Item"</span>▸</span> -->
  <span class="oogindentation">  ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
  <span class="oogindentation">  ⋮</span><span class="oogcode">«}/∀»</span><span class="oogcontinuation">…</span>
  </svg>
  </svg>
</div>
</div>

Revision as of 13:19, 3 March 2009

Classification
Type Type:org/oogenerator/Template/2.0
Domain Domain:it/development/formatting
Category Type:org/oomodels/wiki/Template
Maturity final
More
Download Code
Namespace (more)

OOModels main namespace

create new pages

Code[edit]

G-2.0-xml_string-1.0 -*- coding: utf-8; -*-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
«∀(a:‖"Ⓧ/Diagram/Item"){»
« String name = ((XMLNode)‖"Ⓧ/@Name").toString();
     String type = ((XMLNode)‖"Ⓧ/@Type").toString();
     int len = name.length();
     int width = len * 10; »
  <g transform="translate(◂8*Integer.parseInt(((XMLNode)(‖"Ⓧ/@X")).toString())▸,◂16*Integer.parseInt(((XMLNode)(‖"Ⓧ/@Y")).toString())▸)" xlink:href="‖"Ⓧ/@Item"">
«if(type.equals("Class")){»
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
              d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,46 L 2,46 L 2,2 z "/>
    <path style="fill:#80A0C0;fill-opacity:1;stroke:#000000;stroke-width:1px;"
              d="M 0,0 L ◂width▸,0 L ◂width▸,44 L 0,44 L 0,0 z "/>
«}»
«if(type.equals("StateMachine")){»
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
              d="M 2,2 L ◂2+width▸,2 L ◂2+width▸,46 L 2,46 L 2,2 z "/>
    <path style="fill:#80E080;fill-opacity:1;stroke:#000000;stroke-width:1px;"
              d="M 0,0 L ◂width▸,0 L ◂width▸,44 L 0,44 L 0,0 z "/>
«}»
«if(type.equals("Step")){»
    <path style="fill:#000000;fill-opacity:0.49803922;stroke:none;stroke-width:1px;"
              d="M 2,2 L ◂2+width▸,2 L ◂13+width▸,24 L ◂2+width▸,46 L 2,46 L 2,2 z "/>
    <path style="fill:#e6f28b;fill-opacity:1;stroke:#000000;stroke-width:1px;"
              d="M 0,0 L ◂width▸,0 L ◂11+width▸,22 L ◂width▸,44 L 0,44 L 0,0 z "/>
«}»
«if(type.equals("Constellation")){»
    <path style="fill:#000000;fill-opacity:0.49803922;fill-rule:evenodd;stroke:none;stroke-width:1px;"
              d="M 14,2 L ◂8+width▸,2 C ◂15+width▸,2 ◂20+width▸,8 ◂20+width▸,15 L ◂20+width▸,34 C ◂20+width▸,41 ◂15+width▸,47 ◂8+width▸,47 L 14,47 C 7,47 2,41 2,34 L 2,15 C 2,8 7,2 14,2 z "/>
    <path style="fill:#d8cae2;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;"
              d="M 12,0 L ◂6+width▸,0 C ◂13+width▸,0 ◂18+width▸,6 ◂18+width▸,13 L ◂18+width▸,32 C ◂18+width▸,39 ◂13+width▸,45 ◂6+width▸,45 L 12,45 C 5,45 0,39 0,32 L 0,13 C 0,6 5,0 12,0 z "/>
«}»
    <text y="26" x="◂1+(width/2)▸"
          style="font-size:16px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;
                 text-align:center;text-anchor:middle;fill:#000000;font-family:Sans">◂name▸</text>
  </g>
«}/∀»
</svg>