| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
| <head> |
| <meta content="text/html; charset=windows-1252" http-equiv="content-type"> |
| <title>Images generation</title> |
| <link rel="stylesheet" type="text/css" href="userguide.css"> |
| </head> |
| <body> |
| <h2>Images generation</h2> |
| <p><span class="code"><image></span> tag must be defined under a <span
|
| class="code"><gendoc></span> tag.</p> |
| <p>It shall define one of the following attributes:</p> |
| <ul> |
| <li><span class="code">object</span> for diagram generation, filled with |
| an ID of the diagram. <a href="#_Displaying_diagrams">See Diagram |
| generation section</a>.</li> |
| <li><span class="code">filePath</span> for static image generation, filled |
| with the image absolute path. <a href="#_Displaying_static_images">See |
| static image generation section</a>.</li> |
| </ul> |
| <p>The drawing are correspond to the entire text box:</p> |
| <table class="pptx" border="solid" width="600"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td style="height: 17px;"><context |
| model='D:/
/myModel.uml'/> <gendoc><br> |
| </td> |
| </tr> |
| <tr> |
| <td>[for (p:Package | Package.allInstances())]</td> |
| </tr> |
| <tr height="150px" valign="top"> |
| <td><strong style="font-weight:900;"><image
/></strong></td> |
| </tr> |
| <tr> |
| <td></for><br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <h3>Customize image size</h3> |
| <p><span class="code"><image> tag provides the following attributes to |
| handle image size customization: keepW, keepH, maxW, maxH. They are used |
| in association with the dimensions of the drawing area inside |
| <image> tag:</span></p> |
| <ul> |
| <li><strong>keepW</strong>: output image width will be the same as drawing |
| area width</li> |
| <li><strong>keepH</strong>: output image height will be the same as |
| drawing area height</li> |
| <li><strong>maxW</strong>: output image width will not oversize drawing |
| area width</li> |
| <li><strong>maxH</strong>: output image height will not oversize drawing |
| area height</li> |
| </ul> |
| <p>Possible values for these attributes: <span class="code">false</span>(default), |
| <span class="code">true</span>.</p> |
| <p>For the following initial image:</p> |
| <img src="img/image_gen_orig.png" width="350"><br> |
| <br> |
| <ul> |
| <li>Fix image width, height is computed proportionally, the image overlap |
| partially the next boxes.</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td class="code"><image object='
' <span class="blue">keepW=true |
| keepH=false/></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><br> |
| </td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" width="350"></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <ul> |
| <li>Fix image height, width is computed proportionally</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td class="code"><image object='
' <span class="blue">keepW=false |
| keepH=true/></span><span class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" height="65"
|
| width="390"></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"><br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <strong></strong> |
| <ul> |
| <li><strong><u>TO BE AVOIDED</u></strong> : Fix image height and width</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td class="code"><image object='
' <span class="blue">keepW=true |
| keepH=true/></span><span class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" height="65"
|
| width="340"></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"><br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <ul> |
| <li>Ensure the image will not oversize a specified width |
| <ul> |
| <li>Case 1 : Image is smaller than the drawing area<br> |
| Output corresponds to origin image dimensions, and the picture may |
| overlap with the following rows.</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| </li> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td class="code"><image object='
' <span class="blue">maxW=true/></span><span
|
| class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" width="280"></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <ul> |
| <ul> |
| <li>Case 2 : Image is larger than the drawing area<br> |
| Output corresponds to drawing area dimension:</li> |
| </ul> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table style="width: 265px; height: 158px;" class="pptx"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td class="code"><image object='
' <span class="blue">maxW=true/></span><span
|
| class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table style="width: 265px; height: 195px;" class="pptx"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="75" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" width="242"></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <ul> |
| <li>Ensure the image will not oversize a specified height |
| <ul> |
| <li>Case 1 : Image is smaller than the drawing area<br> |
| Output corresponds to origin image dimensions</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| </li> |
| </ul> |
| <table class="sample" width="900px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="110" valign="top"> |
| <td class="code"><image object='
' <span class="blue">maxH=true/></span><span
|
| class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table style="width: 265px;" class="pptx"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="110" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" height="75"></td> |
| </tr> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <ul> |
| </ul> |
| <br> |
| <ul> |
| <li>Case 2 : Image is larger than the drawing area<br> |
| Output corresponds to drawing area dimension:</li> |
| </ul> |
| <br> |
| <ul> |
| </ul> |
| <table class="sample" width="920px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><gendoc></td> |
| </tr> |
| <tr height="115" valign="top"> |
| <td class="code"><image object='
' <span class="blue">maxH=true/></span><span
|
| class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22"></gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr height="140px" valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| <tr height="110" valign="top"> |
| <td><img class="border" src="img/image_gen_orig.png" height="110"></td> |
| </tr> |
| <tr height="22"> |
| <td><br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <a name="_Displaying_diagrams"> |
| <h3>Displaying diagrams</h3> |
| </a> |
| <p><a name="_Displaying_diagrams">Attribute object shall be filled by an ID |
| of the diagram. Diagram ID can be generated by </a><a href="bundles.html#_Gmf">service |
| getDiagram from bundle gmf</a>, called on the diagram:</p> |
| <table class="sample" width="800px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="22"><context model='${model}' |
| importedBundles='gmf;papyrus'/><br> |
| <gendoc><br> |
| [for (diag : Diagram| |
| self.getPapyrusDiagrams()]</td> |
| </tr> |
| <tr height="115" valign="top"> |
| <td class="code"> <image |
| object='[diag.getDiagram()/]' maxW='true' |
| keepH='false'/> <span class="blue"></span><span
|
| class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22">[/for]<br> |
| </gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <a name="_Displaying_static_images"> |
| <h3>Displaying static images</h3> |
| <p><span class="code"><image></span> tag can also be used for static |
| image generation, with the following content:</p> |
| <ul> |
| <li>attribute <span class="code">filePath</span> shall contain the |
| absolute path of the static image. <br> |
| The following image formats are supported : GIF, JPG, JPEG, BMP, PNG, |
| SVG</li> |
| <li><span class="code"><image></span> tag shall contain an empty |
| drawing area (alignment, text adaptation,
)</li> |
| <li>size attributes can be used : <span class="code">keepW</span>, <span
|
| class="code">keepH</span>, <span class="code">maxW</span>, <span class="code">maxH</span></li> |
| </ul> |
| <p>The following example shows the display of a static image:</p> |
| <table class="sample" width="920px"> |
| <tbody> |
| <tr class="heading"> |
| <td width="50%"> |
| <p><strong>Template content</strong></p> |
| </td> |
| <td width="50%"> |
| <p><strong>Output</strong></p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="62"><context |
| model='${model_path}'/><br> |
| <gendoc><br> |
| Project logo is displayed below :</td> |
| </tr> |
| <tr height="115" valign="top"> |
| <td class="code"> <image |
| filePath='D:/gendoc_logo.jpg' maxW='true'/> <span
|
| class="blue"></span><span class="blue"></span></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22">[/for]<br> |
| </gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| <td width="50%"> |
| <table class="pptx" border="solid" height="320" width="100%"> |
| <tbody> |
| <tr valign="top"> |
| <td> |
| <table class="pptx" width="100%"> |
| <tbody> |
| <tr> |
| <td height="62">Project logo is displayed |
| below :<br> |
| </td> |
| </tr> |
| <tr height="115" valign="top"> |
| <td class="code"><span class="blue"></span><span class="blue"></span><img
|
| class="border" src="img/logo.png" height="100"></td> |
| </tr> |
| <tr valign="top"> |
| <td height="22">[/for]<br> |
| </gendoc></td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <br> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </a> |
| </body> |
| </html> |