UNPKG

cejs

Version:

A JavaScript module framework that is simple to use.

2,061 lines (1,206 loc) 43.9 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="generator" content="JsDoc Toolkit" /> <title>JsDoc Reference - g_SVG</title> <style type="text/css"> /* default.css */ body { font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; width: 800px; } .header { clear: both; background-color: #ccc; padding: 8px; } h1 { font-size: 150%; font-weight: bold; padding: 0; margin: 1em 0 0 .3em; } hr { border: none 0; border-top: 1px solid #7F8FB1; height: 1px; } pre.code { display: block; padding: 8px; border: 1px dashed #ccc; } #index { margin-top: 24px; float: left; width: 160px; position: absolute; left: 8px; background-color: #F3F3F3; padding: 8px; } #content { margin-left: 190px; width: 600px; } .classList { list-style-type: none; padding: 0; margin: 0 0 0 8px; font-family: arial, sans-serif; font-size: 1em; overflow: auto; } .classList li { padding: 0; margin: 0 0 8px 0; } .summaryTable { width: 100%; } h1.classTitle { font-size:170%; line-height:130%; } h2 { font-size: 110%; } caption, div.sectionTitle { background-color: #7F8FB1; color: #fff; font-size:130%; text-align: left; padding: 2px 6px 2px 6px; border: 1px #7F8FB1 solid; } div.sectionTitle { margin-bottom: 8px; } .summaryTable thead { display: none; } .summaryTable td { vertical-align: top; padding: 4px; border-bottom: 1px #7F8FB1 solid; border-right: 1px #7F8FB1 solid; } /*col#summaryAttributes {}*/ .summaryTable td.attributes { border-left: 1px #7F8FB1 solid; width: 140px; text-align: right; } td.attributes, .fixedFont { line-height: 15px; color: #002EBE; font-family: "Courier New",Courier,monospace; font-size: 13px; } .summaryTable td.nameDescription { text-align: left; font-size: 13px; line-height: 15px; } .summaryTable td.nameDescription, .description { line-height: 15px; padding: 4px; padding-left: 4px; } .summaryTable { margin-bottom: 8px; } ul.inheritsList { list-style: square; margin-left: 20px; padding-left: 0; } .detailList { margin-left: 20px; line-height: 15px; } .detailList dt { margin-left: 20px; } .detailList .heading { font-weight: bold; padding-bottom: 6px; margin-left: 0; } .light, td.attributes, .light a:link, .light a:visited { color: #777; font-style: italic; } .fineprint { text-align: right; font-size: 10px; } </style> </head> <body> <!-- ============================== header ================================= --> <!-- begin static/header.html --> <div id="header"> </div> <!-- end static/header.html --> <!-- ============================== classes index ============================ --> <div id="index"> <!-- begin publish.classesIndex --> <div align="center"><a href="../index.html">Class Index</a> | <a href="../files.html">File Index</a></div> <hr /> <h2>Classes</h2> <ul class="classList"> <li><i><a href="../symbols/_global_.html">_global_</a></i></li> <li><a href="../symbols/CeL.html">CeL</a></li> <li><a href="../symbols/CeL.code.log.html">CeL.code.log</a></li> <li><a href="../symbols/CeL.debug.html">CeL.debug</a></li> <li><a href="../symbols/CeL.env.html">CeL.env</a></li> <li><a href="../symbols/CeL.IO.Windows.file.html">CeL.IO.Windows.file</a></li> <li><a href="../symbols/g_SVG.html">g_SVG</a></li> </ul> <hr /> <!-- end publish.classesIndex --> </div> <div id="content"> <!-- ============================== class title ============================ --> <h1 class="classTitle"> Class g_SVG </h1> <!-- ============================== class summary ========================== --> <p class="description"> generation of Scalable Vector Graphics<br/> 輔助繪圖的基本功能物件,生成 SVG 操作函數。 <br /><i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_net_SVG.origin.js.html">SVG.origin.js</a>. </p> <!-- ============================== constructor summary ==================== --> <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class g_SVG."> <caption>Class Summary</caption> <thead> <tr> <th scope="col">Constructor Attributes</th> <th scope="col">Constructor Name and Description</th> </tr> </thead> <tbody> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription" > <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#constructor">g_SVG</a></b>(_width, _height, _backgroundColor) </div> <div class="description">g_SVG 物件之 constructor。<br/> 設定 SVG document fragment 並將之插入網頁中。</div> </td> </tr> </tbody> </table> <!-- ============================== properties summary ===================== --> <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class g_SVG."> <caption>Field Summary</caption> <thead> <tr> <th scope="col">Field Attributes</th> <th scope="col">Field Name and Description</th> </tr> </thead> <tbody> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#contains">contains</a></b> </div> <div class="description">包含了插入元件的原始資訊。<br/> Use <a href="#addContain">#addContain</a> to add contains.</div> </td> </tr> <tr> <td class="attributes">&lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> g_SVG.<b><a href="../symbols/g_SVG.html#.defaultStrokeWidth">defaultStrokeWidth</a></b> </div> <div class="description">default stroke width.</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#div">div</a></b> </div> <div class="description">所插入之網頁元素</div> </td> </tr> <tr> <td class="attributes">&lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> g_SVG.<b><a href="../symbols/g_SVG.html#.idPrefix">idPrefix</a></b> </div> <div class="description">所有造出 id 之 prefix</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#lastAdd">lastAdd</a></b> </div> <div class="description">最後一個增加的 instance</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#lastAddDefs">lastAddDefs</a></b> </div> <div class="description">最後一個增加的 definition</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"> <b><a href="../symbols/g_SVG.html#svg">svg</a></b> </div> <div class="description">SVG document fragment</div> </td> </tr> </tbody> </table> <!-- ============================== methods summary ======================== --> <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class g_SVG."> <caption>Method Summary</caption> <thead> <tr> <th scope="col">Method Attributes</th> <th scope="col">Method Name and Description</th> </tr> </thead> <tbody> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addCircle">addCircle</a></b>(_r, _cx, _cy) </div> <div class="description">繪製圓形。<br/> 此函數利用 g_SVG.prototype.addEllipsePath 來畫簡單圓形。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addContain">addContain</a></b>(_o, _type, propertyO) </div> <div class="description">增加插入的元件。<br/> 應該用 <a href="http://www.w3.org/TR/SVG/struct.html#SymbolElement">symbol</a></div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addDefs">addDefs</a></b>(_n) </div> <div class="description">增加 SVG 定義。<br/> SVG 規範中聲明,SVG 的 &lt;use&gt; element 不能引用外部文件或其 elements。因此我們在創建實例之前,需要先在本物件中作定義。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addEllipse">addEllipse</a></b>(_rx, _ry, _cx, _cy) </div> <div class="description">繪製簡單圓形/橢圓。<br/> 此函數利用 g_SVG.prototype.addEllipsePath 來畫簡單橢圓。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addEllipsePath">addEllipsePath</a></b>(_rx, _ry, _cx, _cy, _color, _strokeWidth, _fill, tramA) </div> <div class="description">繪製橢圓曲線。<br/> 此函數利用 g_SVG.createNode 造出橢圓曲線元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addLine">addLine</a></b>(_left, _top, _width, _height, _color, _strokeWidth) </div> <div class="description">繪製直線。<br/> 此函數利用 g_SVG.createNode 造出直線元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addNode">addNode</a></b>(_n, _a, _i) </div> <div class="description">增加 SVG element。<br/> 結合 g_SVG.prototype.addDefs 與 g_SVG.prototype.addUse,作完定義後隨即使用之。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addPath">addPath</a></b>(_d, _color, _strokeWidth, _fill) </div> <div class="description">繪製曲線路徑。<br/> 此函數利用 g_SVG.createNode 造出路徑元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addPolyline">addPolyline</a></b>(_pA, _color, _strokeWidth, _fill, tramA) </div> <div class="description">繪製多邊形。<br/> 此函數利用 g_SVG.createNode 造出多邊形路徑元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addQuadrilateral">addQuadrilateral</a></b>(_ds, _h, _d, _us, tramA) </div> <div class="description">畫簡單長方形或平行四邊形、梯形</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addRect">addRect</a></b>(_w, _h, _x, _y, _color, _strokeWidth, _fill, tramA) </div> <div class="description">繪製矩形。<br/> 此函數利用 g_SVG.createNode 造出矩形路徑元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addText">addText</a></b>(_text, _left, _baseLine, _color, _font) </div> <div class="description">添加文字。<br/> 此函數利用 g_SVG.createNode 造出文字元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addTriangle">addTriangle</a></b>(_ds, _h, _d, tramA) </div> <div class="description">畫簡單三角形</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#addUse">addUse</a></b>(_i, _a) </div> <div class="description">增加 SVG 實例。<br/> 利用本物件中之定義創建實例並增添至本物件中。<br/> 在裝載 b.svg 時,將 a.svg 中的 defs 中的圖元裝載到 b.svg 中(文件上是兩者是保持獨立的,但在內存中將二者合二為一),這樣就可以在b.svg中直接引用這些圖元了。<br/> SVG 規範中聲明,SVG 的 &lt;use&gt; element 不能引用外部文件或其 elements。因此我們在創建實例之前,需要先在本物件中作定義。</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#attachGroup">attachGroup</a></b>(_n) </div> <div class="description">綁定 SVG elements 至本物件群組。<br/> 這函數將已存在的 SVG elements 綁定至本物件之群組中。若群組不存在,則創建出一個。</div> </td> </tr> <tr> <td class="attributes">&lt;private&gt; &lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont">g_SVG.<b><a href="../symbols/g_SVG.html#.createENS">createENS</a></b>(_ns, _qn, _a, _i) </div> <div class="description">create SVG document fragment (only for g_SVG.createNode)</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#createGroup">createGroup</a></b>(_a, _i) </div> <div class="description">創建本物件之 SVG 群組。<br/> 利用 SVG 群組我們可以同時操作多個 SVG elements。</div> </td> </tr> <tr> <td class="attributes">&lt;private&gt; &lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont">g_SVG.<b><a href="../symbols/g_SVG.html#.createNode">createNode</a></b>(_nodeN, _a, _i) </div> <div class="description">create SVG document fragment 元件(component)。<br/> SVG 之 document fragment 與 HTML 不同 namespace,因此我們需要使用到 <a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a> 來作為 XML elements 的 namespace。為了未來的兼容性,我們將這個功能獨立出來。</div> </td> </tr> <tr> <td class="attributes">&lt;private&gt; &lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont">g_SVG.<b><a href="../symbols/g_SVG.html#.getRandomID">getRandomID</a></b>(_t) </div> <div class="description">get a random ID to use.</div> </td> </tr> <tr> <td class="attributes">&lt;private&gt; &lt;static&gt; &nbsp;</td> <td class="nameDescription"> <div class="fixedFont">g_SVG.<b><a href="../symbols/g_SVG.html#.setRandomID">setRandomID</a></b>(_n) </div> <div class="description">give a random ID to the specified node.</div> </td> </tr> <tr> <td class="attributes">&nbsp;</td> <td class="nameDescription"> <div class="fixedFont"><b><a href="../symbols/g_SVG.html#show">show</a></b>(_v) </div> <div class="description">顯現 this g_SVG</div> </td> </tr> </tbody> </table> <!-- ============================== events summary ======================== --> <!-- ============================== constructor details ==================== --> <div class="details"><a name="constructor"> </a> <div class="sectionTitle"> Class Detail </div> <div class="fixedFont"> <b>g_SVG</b>(_width, _height, _backgroundColor) </div> <div class="description"> g_SVG 物件之 constructor。<br/> 設定 SVG document fragment 並將之插入網頁中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{int}</span> <b>_width</b> </dt> <dd>width of the canvas</dd> <dt> <span class="light fixedFont">{int}</span> <b>_height</b> </dt> <dd>height of the canvas</dd> <dt> <span class="light fixedFont">{color string}</span> <b>_backgroundColor</b> <i>Optional</i> </dt> <dd>background color of the canvas (UNDO)</dd> </dl> <dl class="detailList"> <dt class="heading">Deprecated:</dt> <dt> Use toolkit listed below instead:<br/> <a href="http://code.google.com/p/svgweb/" accessdate="2009/11/15 16:34" title="svgweb - Project Hosting on Google Code">svgweb</a><br/> <a href="https://launchpad.net/scour" accessdate="2009/11/15 16:35" title="Scour - Cleaning SVG Files in Launchpad">Scour</a> </dt> </dl> <dl class="detailList"> <dt class="heading">Since:</dt> <dd>2006/12/7,10-12</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>g_SVG object created</dd> </dl> <dl class="detailList"> <dt class="heading">Requires:</dt> <dd>setA,createE,removeAllChild//removeNode</dd> </dl> <dl class="detailList"> <dt class="heading">See:</dt> <dd><a href="http://www.w3.org/TR/SVG/" accessdate="2009/11/15 16:31">Scalable Vector Graphics (SVG) 1.1 Specification</a><br/> <a href="http://zvon.org/xxl/svgReference/Output/" accessdate="2009/11/15 16:31">SVG 1.1 reference with examples</a><br/> <a href="http://www.permadi.com/tutorial/jsFunc/index.html" accessdate="2009/11/15 16:31" title="Introduction and Features of JavaScript &quot;Function&quot; Objects">Introduction and Features of JavaScript &quot;Function&quot; Objects</a><br/> <a href="http://volity.org/wiki/index.cgi?SVG_Script_Tricks" accessdate="2009/11/15 16:31">Volity Wiki: SVG Script Tricks</a><br/> <a href="http://pilat.free.fr/english/routines/js_dom.htm" accessdate="2009/11/15 16:31">Javascript SVG et DOM</a></dd> </dl> </div> <!-- ============================== field details ========================== --> <div class="sectionTitle"> Field Detail </div> <a name="contains"> </a> <div class="fixedFont"> <span class="light">{Array}</span> <b>contains</b> </div> <div class="description"> 包含了插入元件的原始資訊。<br/> Use <a href="#addContain">#addContain</a> to add contains. </div> <hr /> <a name=".defaultStrokeWidth"> </a> <div class="fixedFont">&lt;static&gt; <span class="light">{number}</span> <span class="light">g_SVG.</span><b>defaultStrokeWidth</b> </div> <div class="description"> default stroke width. 單位: px </div> <hr /> <a name="div"> </a> <div class="fixedFont"> <b>div</b> </div> <div class="description"> 所插入之網頁元素 </div> <hr /> <a name=".idPrefix"> </a> <div class="fixedFont">&lt;static&gt; <span class="light">{string}</span> <span class="light">g_SVG.</span><b>idPrefix</b> </div> <div class="description"> 所有造出 id 之 prefix </div> <hr /> <a name="lastAdd"> </a> <div class="fixedFont"> <b>lastAdd</b> </div> <div class="description"> 最後一個增加的 instance </div> <hr /> <a name="lastAddDefs"> </a> <div class="fixedFont"> <b>lastAddDefs</b> </div> <div class="description"> 最後一個增加的 definition </div> <hr /> <a name="svg"> </a> <div class="fixedFont"> <b>svg</b> </div> <div class="description"> SVG document fragment </div> <dl class="detailList"> <dt class="heading">See:</dt> <dd><a href="http://www.w3.org/TR/SVG/struct.html#NewDocument" accessdate="2009/11/15 16:53">Defining an SVG document fragment: the 'svg' element</a></dd> </dl> <!-- ============================== method details ========================= --> <div class="sectionTitle"> Method Detail </div> <a name="addCircle"> </a> <div class="fixedFont"> <b>addCircle</b>(_r, _cx, _cy) </div> <div class="description"> 繪製圓形。<br/> 此函數利用 g_SVG.prototype.addEllipsePath 來畫簡單圓形。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_r</b> </dt> <dd></dd> <dt> <b>_cx</b> </dt> <dd></dd> <dt> <b>_cy</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addContain"> </a> <div class="fixedFont"> <b>addContain</b>(_o, _type, propertyO) </div> <div class="description"> 增加插入的元件。<br/> 應該用 <a href="http://www.w3.org/TR/SVG/struct.html#SymbolElement">symbol</a> </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_o</b> </dt> <dd>object reference</dd> <dt> <b>_type</b> </dt> <dd>type of this component</dd> <dt> <b>propertyO</b> <i>Optional</i> </dt> <dd>other properties</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addDefs"> </a> <div class="fixedFont"> <b>addDefs</b>(_n) </div> <div class="description"> 增加 SVG 定義。<br/> SVG 規範中聲明,SVG 的 &lt;use&gt; element 不能引用外部文件或其 elements。因此我們在創建實例之前,需要先在本物件中作定義。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_n</b> </dt> <dd>node</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addEllipse"> </a> <div class="fixedFont"> <b>addEllipse</b>(_rx, _ry, _cx, _cy) </div> <div class="description"> 繪製簡單圓形/橢圓。<br/> 此函數利用 g_SVG.prototype.addEllipsePath 來畫簡單橢圓。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_rx</b> </dt> <dd></dd> <dt> <b>_ry</b> </dt> <dd></dd> <dt> <b>_cx</b> </dt> <dd></dd> <dt> <b>_cy</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addEllipsePath"> </a> <div class="fixedFont"> <b>addEllipsePath</b>(_rx, _ry, _cx, _cy, _color, _strokeWidth, _fill, tramA) </div> <div class="description"> 繪製橢圓曲線。<br/> 此函數利用 g_SVG.createNode 造出橢圓曲線元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_rx</b> </dt> <dd></dd> <dt> <b>_ry</b> </dt> <dd></dd> <dt> <b>_cx</b> </dt> <dd></dd> <dt> <b>_cy</b> </dt> <dd></dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_strokeWidth</b> </dt> <dd></dd> <dt> <b>_fill</b> </dt> <dd></dd> <dt> <b>tramA</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addLine"> </a> <div class="fixedFont"> <b>addLine</b>(_left, _top, _width, _height, _color, _strokeWidth) </div> <div class="description"> 繪製直線。<br/> 此函數利用 g_SVG.createNode 造出直線元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_left</b> </dt> <dd></dd> <dt> <b>_top</b> </dt> <dd></dd> <dt> <b>_width</b> </dt> <dd></dd> <dt> <b>_height</b> </dt> <dd></dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_strokeWidth</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addNode"> </a> <div class="fixedFont"> <b>addNode</b>(_n, _a, _i) </div> <div class="description"> 增加 SVG element。<br/> 結合 g_SVG.prototype.addDefs 與 g_SVG.prototype.addUse,作完定義後隨即使用之。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_n</b> </dt> <dd>tagName(nodeType)</dd> <dt> <span class="light fixedFont">{hash|string}</span> <b>_a</b> </dt> <dd>attribute/property</dd> <dt> <b>_i</b> </dt> <dd>inner object</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addPath"> </a> <div class="fixedFont"> <b>addPath</b>(_d, _color, _strokeWidth, _fill) </div> <div class="description"> 繪製曲線路徑。<br/> 此函數利用 g_SVG.createNode 造出路徑元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_d</b> </dt> <dd></dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_strokeWidth</b> </dt> <dd></dd> <dt> <b>_fill</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addPolyline"> </a> <div class="fixedFont"> <b>addPolyline</b>(_pA, _color, _strokeWidth, _fill, tramA) </div> <div class="description"> 繪製多邊形。<br/> 此函數利用 g_SVG.createNode 造出多邊形路徑元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{int array}</span> <b>_pA</b> </dt> <dd>[x1,y1,x2,y2,x3,y3,..]</dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_strokeWidth</b> </dt> <dd></dd> <dt> <b>_fill</b> </dt> <dd></dd> <dt> <b>tramA</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addQuadrilateral"> </a> <div class="fixedFont"> <b>addQuadrilateral</b>(_ds, _h, _d, _us, tramA) </div> <div class="description"> 畫簡單長方形或平行四邊形、梯形 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_ds</b> </dt> <dd></dd> <dt> <b>_h</b> </dt> <dd></dd> <dt> <b>_d</b> </dt> <dd></dd> <dt> <b>_us</b> </dt> <dd></dd> <dt> <b>tramA</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">See:</dt> <dd><a href="http://zh.wikipedia.org/wiki/%E5%B9%B3%E8%A1%8C%E5%9B%9B%E8%BE%B9%E5%BD%A2">平行四邊形</a></dd> </dl> <hr /> <a name="addRect"> </a> <div class="fixedFont"> <b>addRect</b>(_w, _h, _x, _y, _color, _strokeWidth, _fill, tramA) </div> <div class="description"> 繪製矩形。<br/> 此函數利用 g_SVG.createNode 造出矩形路徑元件之後,再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_w</b> </dt> <dd></dd> <dt> <b>_h</b> </dt> <dd></dd> <dt> <b>_x</b> </dt> <dd></dd> <dt> <b>_y</b> </dt> <dd></dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_strokeWidth</b> </dt> <dd></dd> <dt> <b>_fill</b> </dt> <dd></dd> <dt> <b>tramA</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addText"> </a> <div class="fixedFont"> <b>addText</b>(_text, _left, _baseLine, _color, _font) </div> <div class="description"> 添加文字。<br/> 此函數利用 g_SVG.createNode 造出文字元件之後再用 g_SVG.prototype.addNode 將之插入本物件中。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_text</b> </dt> <dd></dd> <dt> <b>_left</b> </dt> <dd></dd> <dt> <b>_baseLine</b> </dt> <dd></dd> <dt> <b>_color</b> </dt> <dd></dd> <dt> <b>_font</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addTriangle"> </a> <div class="fixedFont"> <b>addTriangle</b>(_ds, _h, _d, tramA) </div> <div class="description"> 畫簡單三角形 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_ds</b> </dt> <dd></dd> <dt> <b>_h</b> </dt> <dd></dd> <dt> <b>_d</b> </dt> <dd></dd> <dt> <b>tramA</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Since:</dt> <dd>2006/12/17 12:38</dd> </dl> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="addUse"> </a> <div class="fixedFont"> <b>addUse</b>(_i, _a) </div> <div class="description"> 增加 SVG 實例。<br/> 利用本物件中之定義創建實例並增添至本物件中。<br/> 在裝載 b.svg 時,將 a.svg 中的 defs 中的圖元裝載到 b.svg 中(文件上是兩者是保持獨立的,但在內存中將二者合二為一),這樣就可以在b.svg中直接引用這些圖元了。<br/> SVG 規範中聲明,SVG 的 &lt;use&gt; element 不能引用外部文件或其 elements。因此我們在創建實例之前,需要先在本物件中作定義。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_i</b> </dt> <dd>id</dd> <dt> <b>_a</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd></dd> </dl> <hr /> <a name="attachGroup"> </a> <div class="fixedFont"> <b>attachGroup</b>(_n) </div> <div class="description"> 綁定 SVG elements 至本物件群組。<br/> 這函數將已存在的 SVG elements 綁定至本物件之群組中。若群組不存在,則創建出一個。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_n</b> </dt> <dd>node</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>this g_SVG</dd> </dl> <hr /> <a name=".createENS"> </a> <div class="fixedFont">&lt;private&gt; &lt;static&gt; <span class="light">g_SVG.</span><b>createENS</b>(_ns, _qn, _a, _i) </div> <div class="description"> create SVG document fragment (only for g_SVG.createNode) </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_ns</b> </dt> <dd></dd> <dt> <b>_qn</b> </dt> <dd></dd> <dt> <b>_a</b> </dt> <dd></dd> <dt> <b>_i</b> </dt> <dd></dd> </dl> <hr /> <a name="createGroup"> </a> <div class="fixedFont"> <b>createGroup</b>(_a, _i) </div> <div class="description"> 創建本物件之 SVG 群組。<br/> 利用 SVG 群組我們可以同時操作多個 SVG elements。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{hash|string}</span> <b>_a</b> </dt> <dd>attribute/property</dd> <dt> <b>_i</b> </dt> <dd>inner object</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>this g_SVG</dd> </dl> <hr /> <a name=".createNode"> </a> <div class="fixedFont">&lt;private&gt; &lt;static&gt; <span class="light">g_SVG.</span><b>createNode</b>(_nodeN, _a, _i) </div> <div class="description"> create SVG document fragment 元件(component)。<br/> SVG 之 document fragment 與 HTML 不同 namespace,因此我們需要使用到 <a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a> 來作為 XML elements 的 namespace。為了未來的兼容性,我們將這個功能獨立出來。 </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_nodeN</b> </dt> <dd>node/tag name</dd> <dt> <span class="light fixedFont">{hash|string}</span> <b>_a</b> </dt> <dd>attribute/property</dd> <dt> <b>_i</b> </dt> <dd>inner object</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>node created or null</dd> </dl> <hr /> <a name=".getRandomID"> </a> <div class="fixedFont">&lt;private&gt; &lt;static&gt; <span class="light">g_SVG.</span><b>getRandomID</b>(_t) </div> <div class="description"> get a random ID to use. </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_t</b> </dt> <dd>tag name(nodeType)</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>a random ID</dd> </dl> <hr /> <a name=".setRandomID"> </a> <div class="fixedFont">&lt;private&gt; &lt;static&gt; <span class="light">g_SVG.</span><b>setRandomID</b>(_n) </div> <div class="description"> give a random ID to the specified node. </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_n</b> </dt> <dd>node</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>id of the specified node</dd> </dl> <hr /> <a name="show"> </a> <div class="fixedFont"> <b>show</b>(_v) </div> <div class="description"> 顯現 this g_SVG </div> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <b>_v</b> </dt> <dd>visible</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dd>this g_SVG</dd> </dl> <!-- ============================== event details ========================= --> <hr /> </div> <!-- ============================== footer ================================= --> <div class="fineprint" style="clear:both"> Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Thu Dec 03 2009 11:02:57 GMT+0800 (CST) </div> </body> </html>