dojox/gfx/vml.js

  • Provides:

    • dojox.gfx.vml
  • Requires:

    • dojox.gfx._base in common
    • dojox.gfx.shape in common
    • dojox.gfx.path in common
    • dojox.gfx.arc in common
    • dojox.gfx.gradient in common
  • dojox.gfx.vml.Group

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Container._init: (call)
    • summary
      a group shape (VML), which can be used
      to logically group shapes (e.g, to propagate matricies)
    • source: [view]
         gs.Container._init.call(this);
  • dojox.gfx.vml.Group._applyTransform

    • type
      Function
    • source: [view]
         var matrix = this._getRealMatrix();
         for(var i = 0; i < this.children.length; ++i){
          this.children[i]._updateParentMatrix(matrix);
         }
         return this; // self
    • summary
      applies a transformation matrix to a group
    • returns
      self
  • dojox.gfx.vml.Group._setDimensions

    • type
      Function
    • parameters:
      • width: (typeof String)
        width in pixels
      • height: (typeof String)
        height in pixels
    • source: [view]
         var r = this.rawNode, rs = r.style,
          bs = this.bgNode.style;
         rs.width = width;
         rs.height = height;
         r.coordsize = width + " " + height;
         bs.width = width;
         bs.height = height;
         for(var i = 0; i < this.children.length; ++i){
          this.children[i]._setDimensions(width, height);
         }
         return this; // self
    • summary
      sets the width and height of the rawNode,
      if the surface sixe has been changed
    • returns
      self
  • dojox.gfx.vml.Rect

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Rect: (call)
    • mixins:
      • gs.Rect.prototype: (prototype)
    • summary
      a rectangle shape (VML)
  • dojox.gfx.vml.Rect.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        a rectangle shape object
    • source: [view]
         var shape = this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         var r = Math.min(1, (shape.r / Math.min(parseFloat(shape.width), parseFloat(shape.height)))).toFixed(8);
         // a workaround for the VML's arcsize bug: cannot read arcsize of an instantiated node
         var parent = this.rawNode.parentNode, before = null;
         if(parent){
          if(parent.lastChild !== this.rawNode){
           for(var i = 0; i < parent.childNodes.length; ++i){
            if(parent.childNodes[i] === this.rawNode){
             before = parent.childNodes[i + 1];
             break;
            }
           }
          }
          parent.removeChild(this.rawNode);
         }
         if(d.isIE > 7){
          var node = this.rawNode.ownerDocument.createElement("v:roundrect");
          node.arcsize = r;
          node.style.display = "inline-block";
          this.rawNode = node;
         }else{
          this.rawNode.arcsize = r;
         }
         if(parent){
          if(before){
           parent.insertBefore(this.rawNode, before);
          }else{
           parent.appendChild(this.rawNode);
          }
         }
         var style = this.rawNode.style;
         style.left = shape.x.toFixed();
         style.top = shape.y.toFixed();
         style.width = (typeof shape.width == "string" && shape.width.indexOf("%") >= 0) ? shape.width : shape.width.toFixed();
         style.height = (typeof shape.width == "string" && shape.height.indexOf("%") >= 0) ? shape.height : shape.height.toFixed();
         // set all necessary styles, which are lost by VML (yes, it's a VML's bug)
         return this.setTransform(this.matrix).setFill(this.fillStyle).setStroke(this.strokeStyle); // self
    • summary
      sets a rectangle shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Rect.shape

    • summary
  • dojox.gfx.vml.Rect.bbox

    • summary
  • dojox.gfx.vml.Rect.rawNode

    • summary
  • dojox.gfx.vml.Rect.rawNode.arcsize

    • summary
  • dojox.gfx.vml.Ellipse

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Ellipse: (call)
    • mixins:
      • gs.Ellipse.prototype: (prototype)
    • summary
      an ellipse shape (VML)
  • dojox.gfx.vml.Ellipse.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        an ellipse shape object
    • source: [view]
         var shape = this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         var style = this.rawNode.style;
         style.left = (shape.cx - shape.rx).toFixed();
         style.top = (shape.cy - shape.ry).toFixed();
         style.width = (shape.rx * 2).toFixed();
         style.height = (shape.ry * 2).toFixed();
         return this.setTransform(this.matrix); // self
    • summary
      sets an ellipse shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Ellipse.shape

    • summary
  • dojox.gfx.vml.Ellipse.bbox

    • summary
  • dojox.gfx.vml.Circle

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Circle: (call)
    • mixins:
      • gs.Circle.prototype: (prototype)
    • summary
      a circle shape (VML)
  • dojox.gfx.vml.Circle.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        a circle shape object
    • source: [view]
         var shape = this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         var style = this.rawNode.style;
         style.left = (shape.cx - shape.r).toFixed();
         style.top = (shape.cy - shape.r).toFixed();
         style.width = (shape.r * 2).toFixed();
         style.height = (shape.r * 2).toFixed();
         return this; // self
    • summary
      sets a circle shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Circle.shape

    • summary
  • dojox.gfx.vml.Circle.bbox

    • summary
  • dojox.gfx.vml.Line

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Line: (call)
    • mixins:
      • gs.Line.prototype: (prototype)
    • summary
      a line shape (VML)
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         if(rawNode) rawNode.setAttribute("dojoGfxType", "line");
  • dojox.gfx.vml.Line.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        a line shape object
    • source: [view]
         var shape = this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         this.rawNode.path.v = "m" + shape.x1.toFixed() + " " + shape.y1.toFixed() +
          "l" + shape.x2.toFixed() + " " + shape.y2.toFixed() + "e";
         return this.setTransform(this.matrix); // self
    • summary
      sets a line shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Line.shape

    • summary
  • dojox.gfx.vml.Line.bbox

    • summary
  • dojox.gfx.vml.Line.rawNode.path.v

    • summary
  • dojox.gfx.vml.Polyline

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Polyline: (call)
    • mixins:
      • gs.Polyline.prototype: (prototype)
    • summary
      a polyline/polygon shape (VML)
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         if(rawNode) rawNode.setAttribute("dojoGfxType", "polyline");
  • dojox.gfx.vml.Polyline.setShape

    • type
      Function
    • parameters:
      • points: (typeof Object)
        a polyline/polygon shape object
      • closed: (typeof Boolean)
        if true, close the polyline explicitely
    • source: [view]
         if(points && points instanceof Array){
          // branch
          // points: Array: an array of points
          this.shape = g.makeParameters(this.shape, { points: points });
          if(closed && this.shape.points.length) this.shape.points.push(this.shape.points[0]);
         }else{
          this.shape = g.makeParameters(this.shape, points);
         }
         this.bbox = null;
         this._normalizePoints();
         var attr = [], p = this.shape.points;
         if(p.length > 0){
          attr.push("m");
          attr.push(p[0].x.toFixed(), p[0].y.toFixed());
          if(p.length > 1){
           attr.push("l");
           for(var i = 1; i < p.length; ++i){
            attr.push(p[i].x.toFixed(), p[i].y.toFixed());
           }
          }
         }
         attr.push("e");
         this.rawNode.path.v = attr.join(" ");
         return this.setTransform(this.matrix); // self
    • summary
      sets a polyline/polygon shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Polyline.shape

    • summary
  • dojox.gfx.vml.Polyline.bbox

    • summary
  • dojox.gfx.vml.Polyline.rawNode.path.v

    • summary
  • dojox.gfx.vml.Image

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Image: (call)
    • mixins:
      • gs.Image.prototype: (prototype)
    • summary
      an image (VML)
  • dojox.gfx.vml.Image.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        an image shape object
    • source: [view]
         var shape = this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         this.rawNode.firstChild.src = shape.src;
         return this.setTransform(this.matrix); // self
    • summary
      sets an image shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Image._applyTransform

    • type
      Function
    • source: [view]
         var matrix = this._getRealMatrix(),
          rawNode = this.rawNode,
          s = rawNode.style,
          shape = this.shape;
         if(matrix){
          matrix = m.multiply(matrix, {dx: shape.x, dy: shape.y});
         }else{
          matrix = m.normalize({dx: shape.x, dy: shape.y});
         }
         if(matrix.xy == 0 && matrix.yx == 0 && matrix.xx > 0 && matrix.yy > 0){
          // special case to avoid filters
          s.filter = "";
          s.width = Math.floor(matrix.xx * shape.width);
          s.height = Math.floor(matrix.yy * shape.height);
          s.left = Math.floor(matrix.dx);
          s.top = Math.floor(matrix.dy);
         }else{
          var ps = rawNode.parentNode.style;
          s.left = "0px";
          s.top = "0px";
          s.width = ps.width;
          s.height = ps.height;
          matrix = m.multiply(matrix,
           {xx: shape.width / parseInt(s.width), yy: shape.height / parseInt(s.height)});
          var f = rawNode.filters["DXImageTransform.Microsoft.Matrix"];
          if(f){
           f.M11 = matrix.xx;
           f.M12 = matrix.xy;
           f.M21 = matrix.yx;
           f.M22 = matrix.yy;
           f.Dx = matrix.dx;
           f.Dy = matrix.dy;
          }else{
           s.filter = "progid:DXImageTransform.Microsoft.Matrix(M11=" + matrix.xx +
            ", M12=" + matrix.xy + ", M21=" + matrix.yx + ", M22=" + matrix.yy +
            ", Dx=" + matrix.dx + ", Dy=" + matrix.dy + ")";
          }
         }
         return this; // self
    • returns
      self
    • summary
  • dojox.gfx.vml.Image._setDimensions

    • type
      Function
    • parameters:
      • width: (typeof String)
        width in pixels
      • height: (typeof String)
        height in pixels
    • source: [view]
         var r = this.rawNode, f = r.filters["DXImageTransform.Microsoft.Matrix"];
         if(f){
          var s = r.style;
          s.width = width;
          s.height = height;
          return this._applyTransform(); // self
         }
         return this; // self
    • summary
      sets the width and height of the rawNode,
      if the surface sixe has been changed
    • returns
      self
  • dojox.gfx.vml.Image.shape

    • summary
  • dojox.gfx.vml.Image.bbox

    • summary
  • dojox.gfx.vml.Image.rawNode.firstChild.src

    • summary
  • dojox.gfx.vml.Text

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • gs.Text: (call)
    • mixins:
      • gs.Text.prototype: (prototype)
    • summary
      an anchored text (VML)
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         if(rawNode){rawNode.setAttribute("dojoGfxType", "text");}
         this.fontStyle = null;
  • dojox.gfx.vml.Text._alignment

    • type
      Object
    • summary
  • dojox.gfx.vml.Text.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        a text shape object
    • source: [view]
         this.shape = g.makeParameters(this.shape, newShape);
         this.bbox = null;
         var r = this.rawNode, s = this.shape, x = s.x, y = s.y.toFixed(), path;
         switch(s.align){
          case "middle":
           x -= 5;
           break;
          case "end":
           x -= 10;
           break;
         }
         path = "m" + x.toFixed() + "," + y + "l" + (x + 10).toFixed() + "," + y + "e";
         // find path and text path
         var p = null, t = null, c = r.childNodes;
         for(var i = 0; i < c.length; ++i){
          var tag = c[i].tagName;
          if(tag == "path"){
           p = c[i];
           if(t) break;
          }else if(tag == "textpath"){
           t = c[i];
           if(p) break;
          }
         }
         if(!p){
          p = r.ownerDocument.createElement("v:path");
          r.appendChild(p);
         }
         if(!t){
          t = r.ownerDocument.createElement("v:textpath");
          r.appendChild(t);
         }
         p.v = path;
         p.textPathOk = true;
         t.on = true;
         var a = vml.text_alignment[s.align];
         t.style["v-text-align"] = a ? a : "left";
         t.style["text-decoration"] = s.decoration;
         t.style["v-rotate-letters"] = s.rotated;
         t.style["v-text-kern"] = s.kerning;
         t.string = s.text;
         return this.setTransform(this.matrix); // self
    • summary
      sets a text shape object (VML)
    • returns
      self
  • dojox.gfx.vml.Text._setFont

    • type
      Function
    • source: [view]
         var f = this.fontStyle, c = this.rawNode.childNodes;
         for(var i = 0; i < c.length; ++i){
          if(c[i].tagName == "textpath"){
           c[i].style.font = g.makeFontString(f);
           break;
          }
         }
         this.setTransform(this.matrix);
    • summary
      sets a font object (VML)
  • dojox.gfx.vml.Text._getRealMatrix

    • type
      Function
    • source: [view]
         var matrix = this.inherited(arguments);
         // It appears that text is always aligned vertically at a middle of x-height (???).
         // It is impossible to obtain these metrics from VML => I try to approximate it with
         // more-or-less util value of 0.7 * FontSize, which is typical for European fonts.
         if(matrix){
          matrix = m.multiply(matrix,
           {dy: -g.normalizedLength(this.fontStyle ? this.fontStyle.size : "10pt") * 0.35});
         }
         return matrix; // dojox.gfx.Matrix2D
    • summary
      returns the cumulative (&quot;real&quot;) transformation matrix
      by combining the shape's matrix with its parent's matrix;
      it makes a correction for a font size
    • returns
      dojox.gfx.Matrix2D
  • dojox.gfx.vml.Text.getTextWidth

    • type
      Function
    • source: [view]
         var rawNode = this.rawNode, _display = rawNode.style.display;
         rawNode.style.display = "inline";
         var _width = g.pt2px(parseFloat(rawNode.currentStyle.width));
         rawNode.style.display = _display;
         return _width;
    • summary
      get the text width, in px
  • dojox.gfx.vml.Text._alignment.start

    • summary
  • dojox.gfx.vml.Text._alignment.middle

    • summary
  • dojox.gfx.vml.Text._alignment.end

    • summary
  • dojox.gfx.vml.Text.shape

    • summary
  • dojox.gfx.vml.Text.bbox

    • summary
  • dojox.gfx.vml.Text.fontStyle

    • summary
  • dojox.gfx.vml.Path

    • type
      Function
    • chains:
      • vml.Shape: (prototype)
      • vml.Shape: (call)
      • g.path.Path: (call)
    • mixins:
      • g.path.Path.prototype: (prototype)
    • summary
      a path shape (VML)
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         if(rawNode && !rawNode.getAttribute("dojoGfxType")){
          rawNode.setAttribute("dojoGfxType", "path");
         }
         this.vmlPath = "";
         this.lastControl = {};
  • dojox.gfx.vml.Path._updateWithSegment

    • type
      Function
    • parameters:
      • segment: (typeof Object)
        a segment
    • source: [view]
         var last = d.clone(this.last);
         this.inherited(arguments);
         if(arguments.length > 1){ return; } // skip transfomed bbox calculations
         // add a VML path segment
         var path = this[this.renderers[segment.action]](segment, last);
         if(typeof this.vmlPath == "string"){
          this.vmlPath += path.join("");
          this.rawNode.path.v = this.vmlPath + " r0,0 e";
         }else{
          Array.prototype.push.apply(this.vmlPath, path); //FIXME: why not push()?
         }
    • summary
      updates the bounding box of path with new segment
    • returns
      skip transfomed bbox calculations
    • chains:
      • Array.prototype.push: (call)
  • dojox.gfx.vml.Path.setShape

    • type
      Function
    • parameters:
      • newShape: (typeof Object)
        an VML path string or a path object (see dojox.gfx.defaultPath)
    • source: [view]
         this.vmlPath = [];
         this.lastControl.type = ""; // no prior control point
         this.inherited(arguments);
         this.vmlPath = this.vmlPath.join("");
         this.rawNode.path.v = this.vmlPath + " r0,0 e";
         return this;
    • summary
      forms a path using a shape (VML)
  • dojox.gfx.vml.Path._pathVmlToSvgMap

    • type
      Object
    • summary
  • dojox.gfx.vml.Path.renderers

    • type
      Object
    • summary
  • dojox.gfx.vml.Path._addArgs

    • type
      Function
    • parameters:
      • path: (typeof )
      • segment: (typeof )
      • from: (typeof )
      • upto: (typeof )
    • source: [view]
         var n = segment instanceof Array ? segment : segment.args;
         for(var i = from; i < upto; ++i){
          path.push(" ", n[i].toFixed());
         }
    • summary
  • dojox.gfx.vml.Path._adjustRelCrd

    • type
      Function
    • parameters:
      • last: (typeof )
      • segment: (typeof )
      • step: (typeof )
    • source: [view]
         var n = segment instanceof Array ? segment : segment.args, l = n.length,
          result = new Array(l), i = 0, x = last.x, y = last.y;
         if(typeof x != "number"){
          // there is no last coordinate =>
          // treat the first pair as an absolute coordinate
          result[0] = x = n[0];
          result[1] = y = n[1];
          i = 2;
         }
         if(typeof step == "number" && step != 2){
          var j = step;
          while(j <= l){
           for(; i < j; i += 2){
            result[i] = x + n[i];
            result[i + 1] = y + n[i + 1];
           }
           x = result[j - 2];
           y = result[j - 1];
           j += step;
          }
         }else{
          for(; i < l; i += 2){
           result[i] = (x += n[i]);
           result[i + 1] = (y += n[i + 1]);
          }
         }
         return result;
    • summary
  • dojox.gfx.vml.Path._adjustRelPos

    • type
      Function
    • parameters:
      • last: (typeof )
      • segment: (typeof )
    • source: [view]
         var n = segment instanceof Array ? segment : segment.args, l = n.length,
          result = new Array(l);
         for(var i = 0; i < l; ++i){
          result[i] = (last += n[i]);
         }
         return result;
    • summary
  • dojox.gfx.vml.Path._moveToA

    • type
      Function
    • parameters:
      • segment: (typeof )
    • source: [view]
         var p = [" m"], n = segment instanceof Array ? segment : segment.args, l = n.length;
         this._addArgs(p, n, 0, 2);
         if(l > 2){
          p.push(" l");
          this._addArgs(p, n, 2, l);
         }
         this.lastControl.type = ""; // no control point after this primitive
         return p;
    • summary
  • dojox.gfx.vml.Path._moveToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._moveToA(this._adjustRelCrd(last, segment));
    • summary
  • dojox.gfx.vml.Path._lineToA

    • type
      Function
    • parameters:
      • segment: (typeof )
    • source: [view]
         var p = [" l"], n = segment instanceof Array ? segment : segment.args;
         this._addArgs(p, n, 0, n.length);
         this.lastControl.type = ""; // no control point after this primitive
         return p;
    • summary
  • dojox.gfx.vml.Path._lineToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._lineToA(this._adjustRelCrd(last, segment));
    • summary
  • dojox.gfx.vml.Path._hLineToA

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         var p = [" l"], y = " " + last.y.toFixed(),
          n = segment instanceof Array ? segment : segment.args, l = n.length;
         for(var i = 0; i < l; ++i){
          p.push(" ", n[i].toFixed(), y);
         }
         this.lastControl.type = ""; // no control point after this primitive
         return p;
    • summary
  • dojox.gfx.vml.Path._hLineToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._hLineToA(this._adjustRelPos(last.x, segment), last);
    • summary
  • dojox.gfx.vml.Path._vLineToA

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         var p = [" l"], x = " " + last.x.toFixed(),
          n = segment instanceof Array ? segment : segment.args, l = n.length;
         for(var i = 0; i < l; ++i){
          p.push(x, " ", n[i].toFixed());
         }
         this.lastControl.type = ""; // no control point after this primitive
         return p;
    • summary
  • dojox.gfx.vml.Path._vLineToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._vLineToA(this._adjustRelPos(last.y, segment), last);
    • summary
  • dojox.gfx.vml.Path._curveToA

    • type
      Function
    • parameters:
      • segment: (typeof )
    • source: [view]
         var p = [], n = segment instanceof Array ? segment : segment.args, l = n.length,
          lc = this.lastControl;
         for(var i = 0; i < l; i += 6){
          p.push(" c");
          this._addArgs(p, n, i, i + 6);
         }
         lc.x = n[l - 4];
         lc.y = n[l - 3];
         lc.type = "C";
         return p;
    • summary
  • dojox.gfx.vml.Path._curveToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._curveToA(this._adjustRelCrd(last, segment, 6));
    • summary
  • dojox.gfx.vml.Path._smoothCurveToA

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         var p = [], n = segment instanceof Array ? segment : segment.args, l = n.length,
          lc = this.lastControl, i = 0;
         if(lc.type != "C"){
          p.push(" c");
          this._addArgs(p, [last.x, last.y], 0, 2);
          this._addArgs(p, n, 0, 4);
          lc.x = n[0];
          lc.y = n[1];
          lc.type = "C";
          i = 4;
         }
         for(; i < l; i += 4){
          p.push(" c");
          this._addArgs(p, [
           2 * last.x - lc.x,
           2 * last.y - lc.y
          ], 0, 2);
          this._addArgs(p, n, i, i + 4);
          lc.x = n[i];
          lc.y = n[i + 1];
         }
         return p;
    • summary
  • dojox.gfx.vml.Path._smoothCurveToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._smoothCurveToA(this._adjustRelCrd(last, segment, 4), last);
    • summary
  • dojox.gfx.vml.Path._qCurveToA

    • type
      Function
    • parameters:
      • segment: (typeof )
    • source: [view]
         var p = [], n = segment instanceof Array ? segment : segment.args, l = n.length,
          lc = this.lastControl;
         for(var i = 0; i < l; i += 4){
          p.push(" qb");
          this._addArgs(p, n, i, i + 4);
         }
         lc.x = n[l - 4];
         lc.y = n[l - 3];
         lc.type = "Q";
         return p;
    • summary
  • dojox.gfx.vml.Path._qCurveToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._qCurveToA(this._adjustRelCrd(last, segment, 4));
    • summary
  • dojox.gfx.vml.Path._qSmoothCurveToA

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         var p = [], n = segment instanceof Array ? segment : segment.args, l = n.length,
          lc = this.lastControl, i = 0;
         if(lc.type != "Q"){
          p.push(" qb");
          this._addArgs(p, [
           lc.x = last.x,
           lc.y = last.y
          ], 0, 2);
          lc.type = "Q";
          this._addArgs(p, n, 0, 2);
          i = 2;
         }
         for(; i < l; i += 2){
          p.push(" qb");
          this._addArgs(p, [
           lc.x = 2 * last.x - lc.x,
           lc.y = 2 * last.y - lc.y
          ], 0, 2);
          this._addArgs(p, n, i, i + 2);
         }
         return p;
    • summary
  • dojox.gfx.vml.Path._qSmoothCurveToR

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         return this._qSmoothCurveToA(this._adjustRelCrd(last, segment, 2), last);
    • summary
  • dojox.gfx.vml.Path._arcTo

    • type
      Function
    • parameters:
      • segment: (typeof )
      • last: (typeof )
    • source: [view]
         var p = [], n = segment.args, l = n.length, relative = segment.action == "a";
         for(var i = 0; i < l; i += 7){
          var x1 = n[i + 5], y1 = n[i + 6];
          if(relative){
           x1 += last.x;
           y1 += last.y;
          }
          var result = g.arc.arcAsBezier(
           last, n[i], n[i + 1], n[i + 2],
           n[i + 3] ? 1 : 0, n[i + 4] ? 1 : 0,
           x1, y1
          );
          for(var j = 0; j < result.length; ++j){
           p.push(" c");
           var t = result[j];
           this._addArgs(p, t, 0, t.length);
           this._updateBBox(t[0], t[1]);
           this._updateBBox(t[2], t[3]);
           this._updateBBox(t[4], t[5]);
          }
          last.x = x1;
          last.y = y1;
         }
         this.lastControl.type = ""; // no control point after this primitive
         return p;
    • summary
  • dojox.gfx.vml.Path._closePath

    • type
      Function
    • source: [view]
         this.lastControl.type = ""; // no control point after this primitive
         return ["x"];
    • summary
  • dojox.gfx.vml.Path.vmlPath

    • summary
  • dojox.gfx.vml.Path.rawNode.path.v

    • summary
  • dojox.gfx.vml.Path.lastControl.type

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.m

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.l

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.t

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.r

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.c

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.v

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.qb

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.x

    • summary
  • dojox.gfx.vml.Path._pathVmlToSvgMap.e

    • summary
  • dojox.gfx.vml.Path.renderers.M

    • summary
  • dojox.gfx.vml.Path.renderers.L

    • summary
  • dojox.gfx.vml.Path.renderers.H

    • summary
  • dojox.gfx.vml.Path.renderers.V

    • summary
  • dojox.gfx.vml.Path.renderers.C

    • summary
  • dojox.gfx.vml.Path.renderers.S

    • summary
  • dojox.gfx.vml.Path.renderers.Q

    • summary
  • dojox.gfx.vml.Path.renderers.T

    • summary
  • dojox.gfx.vml.Path.renderers.A

    • summary
  • dojox.gfx.vml.Path.renderers.Z

    • summary
  • dojox.gfx.vml.Path.lastControl

    • summary
  • dojox.gfx.vml.TextPath

    • type
      Function
    • chains:
      • vml.Path: (prototype)
      • vml.Path: (call)
      • g.path.TextPath: (call)
    • mixins:
      • g.path.TextPath.prototype: (prototype)
    • summary
      a textpath shape (VML)
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         if(rawNode){rawNode.setAttribute("dojoGfxType", "textpath");}
         this.fontStyle = null;
         if(!("text" in this)){
          this.text = d.clone(g.defaultTextPath);
         }
         if(!("fontStyle" in this)){
          this.fontStyle = d.clone(g.defaultFont);
         }
  • dojox.gfx.vml.TextPath.setText

    • type
      Function
    • parameters:
      • newText: (typeof )
    • source: [view]
         this.text = g.makeParameters(this.text,
          typeof newText == "string" ? {text: newText} : newText);
         this._setText();
         return this; // self
    • summary
      sets a text to be drawn along the path
    • returns
      self
  • dojox.gfx.vml.TextPath.setFont

    • type
      Function
    • parameters:
      • newFont: (typeof )
    • source: [view]
         this.fontStyle = typeof newFont == "string" ?
          g.splitFontString(newFont) :
          g.makeParameters(g.defaultFont, newFont);
         this._setFont();
         return this; // self
    • summary
      sets a font for text
    • returns
      self
  • dojox.gfx.vml.TextPath._setText

    • type
      Function
    • source: [view]
         this.bbox = null;
         var r = this.rawNode, s = this.text,
          // find path and text path
          p = null, t = null, c = r.childNodes;
         for(var i = 0; i < c.length; ++i){
          var tag = c[i].tagName;
          if(tag == "path"){
           p = c[i];
           if(t) break;
          }else if(tag == "textpath"){
           t = c[i];
           if(p) break;
          }
         }
         if(!p){
          p = this.rawNode.ownerDocument.createElement("v:path");
          r.appendChild(p);
         }
         if(!t){
          t = this.rawNode.ownerDocument.createElement("v:textpath");
          r.appendChild(t);
         }
         p.textPathOk = true;
         t.on = true;
         var a = vml.text_alignment[s.align];
         t.style["v-text-align"] = a ? a : "left";
         t.style["text-decoration"] = s.decoration;
         t.style["v-rotate-letters"] = s.rotated;
         t.style["v-text-kern"] = s.kerning;
         t.string = s.text;
    • summary
      sets a text shape object (VML)
  • dojox.gfx.vml.TextPath._setFont

    • type
      Function
    • source: [view]
         var f = this.fontStyle, c = this.rawNode.childNodes;
         for(var i = 0; i < c.length; ++i){
          if(c[i].tagName == "textpath"){
           c[i].style.font = g.makeFontString(f);
           break;
          }
         }
    • summary
      sets a font object (VML)
  • dojox.gfx.vml.TextPath.text

    • summary
  • dojox.gfx.vml.TextPath.fontStyle

    • summary
  • dojox.gfx.vml.TextPath.bbox

    • summary
  • dojox.gfx.vml.Surface

    • type
      Function
    • chains:
      • gs.Surface: (prototype)
      • gs.Surface: (call)
      • gs.Container._init: (call)
    • summary
      a surface object to be used for drawings (VML)
    • source: [view]
         gs.Container._init.call(this);
  • dojox.gfx.vml.Surface.setDimensions

    • type
      Function
    • parameters:
      • width: (typeof String)
        width of surface, e.g., &quot;100px&quot;
      • height: (typeof String)
        height of surface, e.g., &quot;100px&quot;
    • source: [view]
         this.width = g.normalizedLength(width); // in pixels
         this.height = g.normalizedLength(height); // in pixels
         if(!this.rawNode) return this;
         var cs = this.clipNode.style,
          r = this.rawNode, rs = r.style,
          bs = this.bgNode.style,
          ps = this._parent.style, i;
         ps.width = width;
         ps.height = height;
         cs.width = width;
         cs.height = height;
         cs.clip = "rect(0px " + width + "px " + height + "px 0px)";
         rs.width = width;
         rs.height = height;
         r.coordsize = width + " " + height;
         bs.width = width;
         bs.height = height;
         for(i = 0; i < this.children.length; ++i){
          this.children[i]._setDimensions(width, height);
         }
         return this; // self
    • summary
      sets the width and height of the rawNode
    • returns
      self
  • dojox.gfx.vml.Surface.getDimensions

    • type
      Function
    • source: [view]
         var t = this.rawNode ? {
          width: g.normalizedLength(this.rawNode.style.width),
          height: g.normalizedLength(this.rawNode.style.height)} : null;
         if(t.width <= 0){ t.width = this.width; }
         if(t.height <= 0){ t.height = this.height; }
         return t; // Object
    • summary
      returns an object with properties &quot;width&quot; and &quot;height&quot;
    • returns
      Object
  • dojox.gfx.vml.Surface.width

    • summary
  • dojox.gfx.vml.Surface.height

    • summary
  • dojox.gfx.vml.Surface.setDimensions.width

    • type
      String
    • summary
      width of surface, e.g., &quot;100px&quot;
  • dojox.gfx.vml.Surface.setDimensions.height

    • type
      String
    • summary
      height of surface, e.g., &quot;100px&quot;
  • dojox.gfx.vml.Shape

    • type
      Function
    • chains:
      • gs.Shape: (prototype)
      • gs.Shape: (call)
    • summary
      VML-specific implementation of dojox.gfx.Shape methods
  • dojox.gfx.vml.Shape.setFill

    • type
      Function
    • parameters:
      • fill: (typeof Object)
        a fill object
        (see dojox.gfx.defaultLinearGradient,
        dojox.gfx.defaultRadialGradient,
        dojox.gfx.defaultPattern,
        or dojo.Color)
    • source: [view]
         if(!fill){
          // don't fill
          this.fillStyle = null;
          this.rawNode.filled = "f";
          return this;
         }
         var i, f, fo, a, s;
         if(typeof fill == "object" && "type" in fill){
          // gradient
          switch(fill.type){
           case "linear":
            var matrix = this._getRealMatrix(), bbox = this.getBoundingBox(),
             tbbox = this._getRealBBox ? this._getRealBBox() : this.getTransformedBoundingBox();
            s = [];
            if(this.fillStyle !== fill){
             this.fillStyle = g.makeParameters(g.defaultLinearGradient, fill);
            }
            f = g.gradient.project(matrix, this.fillStyle,
              {x: bbox.x, y: bbox.y},
              {x: bbox.x + bbox.width, y: bbox.y + bbox.height},
              tbbox[0], tbbox[2]);
            a = f.colors;
            if(a[0].offset.toFixed(5) != "0.00000"){
             s.push("0 " + g.normalizeColor(a[0].color).toHex());
            }
            for(i = 0; i < a.length; ++i){
             s.push(a[i].offset.toFixed(5) + " " + g.normalizeColor(a[i].color).toHex());
            }
            i = a.length - 1;
            if(a[i].offset.toFixed(5) != "1.00000"){
             s.push("1 " + g.normalizeColor(a[i].color).toHex());
            }
            fo = this.rawNode.fill;
            fo.colors.value = s.join(";");
            fo.method = "sigma";
            fo.type = "gradient";
            fo.angle = (270 - m._radToDeg(f.angle)) % 360;
            fo.on = true;
            break;
           case "radial":
            f = g.makeParameters(g.defaultRadialGradient, fill);
            this.fillStyle = f;
            var l = parseFloat(this.rawNode.style.left),
             t = parseFloat(this.rawNode.style.top),
             w = parseFloat(this.rawNode.style.width),
             h = parseFloat(this.rawNode.style.height),
             c = isNaN(w) ? 1 : 2 * f.r / w;
            a = [];
            // add a color at the offset 0 (1 in VML coordinates)
            if(f.colors[0].offset > 0){
             a.push({offset: 1, color: g.normalizeColor(f.colors[0].color)});
            }
            // massage colors
            d.forEach(f.colors, function(v, i){
             a.push({offset: 1 - v.offset * c, color: g.normalizeColor(v.color)});
            });
            i = a.length - 1;
            while(i >= 0 && a[i].offset < 0){ --i; }
            if(i < a.length - 1){
             // correct excessive colors
             var q = a[i], p = a[i + 1];
             p.color = d.blendColors(q.color, p.color, q.offset / (q.offset - p.offset));
             p.offset = 0;
             while(a.length - i > 2) a.pop();
            }
            // set colors
            i = a.length - 1, s = [];
            if(a[i].offset > 0){
             s.push("0 " + a[i].color.toHex());
            }
            for(; i >= 0; --i){
             s.push(a[i].offset.toFixed(5) + " " + a[i].color.toHex());
            }
            fo = this.rawNode.fill;
            fo.colors.value = s.join(";");
            fo.method = "sigma";
            fo.type = "gradientradial";
            if(isNaN(w) || isNaN(h) || isNaN(l) || isNaN(t)){
             fo.focusposition = "0.5 0.5";
            }else{
             fo.focusposition = ((f.cx - l) / w).toFixed(5) + " " + ((f.cy - t) / h).toFixed(5);
            }
            fo.focussize = "0 0";
            fo.on = true;
            break;
           case "pattern":
            f = g.makeParameters(g.defaultPattern, fill);
            this.fillStyle = f;
            fo = this.rawNode.fill;
            fo.type = "tile";
            fo.src = f.src;
            if(f.width && f.height){
             // in points
             fo.size.x = g.px2pt(f.width);
             fo.size.y = g.px2pt(f.height);
            }
            fo.alignShape = "f";
            fo.position.x = 0;
            fo.position.y = 0;
            fo.origin.x = f.width ? f.x / f.width : 0;
            fo.origin.y = f.height ? f.y / f.height : 0;
            fo.on = true;
            break;
          }
          this.rawNode.fill.opacity = 1;
          return this;
         }
         // color object
         this.fillStyle = g.normalizeColor(fill);
         fo = this.rawNode.fill;
         if(!fo){
          fo = this.rawNode.ownerDocument.createElement("v:fill");
         }
         fo.method = "any";
         fo.type = "solid";
         fo.opacity = this.fillStyle.a;
         var alphaFilter = this.rawNode.filters["DXImageTransform.Microsoft.Alpha"];
         if(alphaFilter){
          alphaFilter.opacity = Math.round(this.fillStyle.a * 100);
         }
         this.rawNode.fillcolor = this.fillStyle.toHex();
         this.rawNode.filled = true;
         return this; // self
    • summary
      sets a fill object (VML)
    • returns
      self
  • dojox.gfx.vml.Shape.setStroke

    • type
      Function
    • parameters:
      • stroke: (typeof Object)
        a stroke object
        (see dojox.gfx.defaultStroke)
    • source: [view]
         if(!stroke){
          // don't stroke
          this.strokeStyle = null;
          this.rawNode.stroked = "f";
          return this;
         }
         // normalize the stroke
         if(typeof stroke == "string" || d.isArray(stroke) || stroke instanceof d.Color){
          stroke = {color: stroke};
         }
         var s = this.strokeStyle = g.makeParameters(g.defaultStroke, stroke);
         s.color = g.normalizeColor(s.color);
         // generate attributes
         var rn = this.rawNode;
         rn.stroked = true;
         rn.strokecolor = s.color.toCss();
         rn.strokeweight = s.width + "px"; // TODO: should we assume that the width is always in pixels?
         if(rn.stroke) {
          rn.stroke.opacity = s.color.a;
          rn.stroke.endcap = this._translate(this._capMap, s.cap);
          if(typeof s.join == "number") {
           rn.stroke.joinstyle = "miter";
           rn.stroke.miterlimit = s.join;
          }else{
           rn.stroke.joinstyle = s.join;
           // rn.stroke.miterlimit = s.width;
          }
          rn.stroke.dashstyle = s.style == "none" ? "Solid" : s.style;
         }
         return this; // self
    • summary
      sets a stroke object (VML)
    • returns
      self
  • dojox.gfx.vml.Shape._capMap

    • type
      Object
    • summary
  • dojox.gfx.vml.Shape._capMapReversed

    • type
      Object
    • summary
  • dojox.gfx.vml.Shape._translate

    • type
      Function
    • parameters:
      • dict: (typeof )
      • value: (typeof )
    • source: [view]
         return (value in dict) ? dict[value] : value;
    • summary
  • dojox.gfx.vml.Shape._applyTransform

    • type
      Function
    • source: [view]
         var matrix = this._getRealMatrix();
         if(matrix){
          var skew = this.rawNode.skew;
          if(typeof skew == "undefined"){
           for(var i = 0; i < this.rawNode.childNodes.length; ++i){
            if(this.rawNode.childNodes[i].tagName == "skew"){
             skew = this.rawNode.childNodes[i];
             break;
            }
           }
          }
          if(skew){
           skew.on = "f";
           var mt = matrix.xx.toFixed(8) + " " + matrix.xy.toFixed(8) + " " +
            matrix.yx.toFixed(8) + " " + matrix.yy.toFixed(8) + " 0 0",
            offset = Math.floor(matrix.dx).toFixed() + "px " + Math.floor(matrix.dy).toFixed() + "px",
            s = this.rawNode.style,
            l = parseFloat(s.left),
            t = parseFloat(s.top),
            w = parseFloat(s.width),
            h = parseFloat(s.height);
           if(isNaN(l)) l = 0;
           if(isNaN(t)) t = 0;
           if(isNaN(w) || !w) w = 1;
           if(isNaN(h) || !h) h = 1;
           var origin = (-l / w - 0.5).toFixed(8) + " " + (-t / h - 0.5).toFixed(8);
           skew.matrix = mt;
           skew.origin = origin;
           skew.offset = offset;
           skew.on = true;
          }
         }
         if(this.fillStyle && this.fillStyle.type == "linear"){
          this.setFill(this.fillStyle);
         }
         return this;
    • summary
  • dojox.gfx.vml.Shape._setDimensions

    • type
      Function
    • parameters:
      • width: (typeof String)
        width in pixels
      • height: (typeof )
    • source: [view]
      dojo.provide("dojox.gfx.vml");


      dojo.require("dojox.gfx._base");
      dojo.require("dojox.gfx.shape");
      dojo.require("dojox.gfx.path");
      dojo.require("dojox.gfx.arc");
      dojo.require("dojox.gfx.gradient");


      (function(){
       var d = dojo, g = dojox.gfx, m = g.matrix, gs = g.shape, vml = g.vml;


       // dojox.gfx.vml.xmlns: String: a VML's namespace
       vml.xmlns = "urn:schemas-microsoft-com:vml";


       // dojox.gfx.vml.text_alignment: Object: mapping from SVG alignment to VML alignment
       vml.text_alignment = {start: "left", middle: "center", end: "right"};


       vml._parseFloat = function(str) {
        // summary: a helper function to parse VML-specific floating-point values
        // str: String: a representation of a floating-point number
        return str.match(/^\d+f$/i) ? parseInt(str) / 65536 : parseFloat(str); // Number
       };


       vml._bool = {"t": 1, "true": 1};


       d.declare("dojox.gfx.vml.Shape", gs.Shape, {
        // summary: VML-specific implementation of dojox.gfx.Shape methods


        setFill: function(fill){
         // summary: sets a fill object (VML)
         // fill: Object: a fill object
         // (see dojox.gfx.defaultLinearGradient,
         // dojox.gfx.defaultRadialGradient,
         // dojox.gfx.defaultPattern,
         // or dojo.Color)


         if(!fill){
          // don't fill
          this.fillStyle = null;
          this.rawNode.filled = "f";
          return this;
         }
         var i, f, fo, a, s;
         if(typeof fill == "object" && "type" in fill){
          // gradient
          switch(fill.type){
           case "linear":
            var matrix = this._getRealMatrix(), bbox = this.getBoundingBox(),
             tbbox = this._getRealBBox ? this._getRealBBox() : this.getTransformedBoundingBox();
            s = [];
            if(this.fillStyle !== fill){
             this.fillStyle = g.makeParameters(g.defaultLinearGradient, fill);
            }
            f = g.gradient.project(matrix, this.fillStyle,
              {x: bbox.x, y: bbox.y},
              {x: bbox.x + bbox.width, y: bbox.y + bbox.height},
              tbbox[0], tbbox[2]);
            a = f.colors;
            if(a[0].offset.toFixed(5) != "0.00000"){
             s.push("0 " + g.normalizeColor(a[0].color).toHex());
            }
            for(i = 0; i < a.length; ++i){
             s.push(a[i].offset.toFixed(5) + " " + g.normalizeColor(a[i].color).toHex());
            }
            i = a.length - 1;
            if(a[i].offset.toFixed(5) != "1.00000"){
             s.push("1 " + g.normalizeColor(a[i].color).toHex());
            }
            fo = this.rawNode.fill;
            fo.colors.value = s.join(";");
            fo.method = "sigma";
            fo.type = "gradient";
            fo.angle = (270 - m._radToDeg(f.angle)) % 360;
            fo.on = true;
            break;
           case "radial":
            f = g.makeParameters(g.defaultRadialGradient, fill);
            this.fillStyle = f;
            var l = parseFloat(this.rawNode.style.left),
             t = parseFloat(this.rawNode.style.top),
             w = parseFloat(this.rawNode.style.width),
             h = parseFloat(this.rawNode.style.height),
             c = isNaN(w) ? 1 : 2 * f.r / w;
            a = [];
            // add a color at the offset 0 (1 in VML coordinates)
            if(f.colors[0].offset > 0){
             a.push({offset: 1, color: g.normalizeColor(f.colors[0].color)});
            }
            // massage colors
            d.forEach(f.colors, function(v, i){
             a.push({offset: 1 - v.offset * c, color: g.normalizeColor(v.color)});
            });
            i = a.length - 1;
            while(i >= 0 && a[i].offset < 0){ --i; }
            if(i < a.length - 1){
             // correct excessive colors
             var q = a[i], p = a[i + 1];
             p.color = d.blendColors(q.color, p.color, q.offset / (q.offset - p.offset));
             p.offset = 0;
             while(a.length - i > 2) a.pop();
            }
            // set colors
            i = a.length - 1, s = [];
            if(a[i].offset > 0){
             s.push("0 " + a[i].color.toHex());
            }
            for(; i >= 0; --i){
             s.push(a[i].offset.toFixed(5) + " " + a[i].color.toHex());
            }
            fo = this.rawNode.fill;
            fo.colors.value = s.join(";");
            fo.method = "sigma";
            fo.type = "gradientradial";
            if(isNaN(w) || isNaN(h) || isNaN(l) || isNaN(t)){
             fo.focusposition = "0.5 0.5";
            }else{
             fo.focusposition = ((f.cx - l) / w).toFixed(5) + " " + ((f.cy - t) / h).toFixed(5);
            }
            fo.focussize = "0 0";
            fo.on = true;
            break;
           case "pattern":
            f = g.makeParameters(g.defaultPattern, fill);
            this.fillStyle = f;
            fo = this.rawNode.fill;
            fo.type = "tile";
            fo.src = f.src;
            if(f.width && f.height){
             // in points
             fo.size.x = g.px2pt(f.width);
             fo.size.y = g.px2pt(f.height);
            }
            fo.alignShape = "f";
            fo.position.x = 0;
            fo.position.y = 0;
            fo.origin.x = f.width ? f.x / f.width : 0;
            fo.origin.y = f.height ? f.y / f.height : 0;
            fo.on = true;
            break;
          }
          this.rawNode.fill.opacity = 1;
          return this;
         }
         // color object
         this.fillStyle = g.normalizeColor(fill);
         fo = this.rawNode.fill;
         if(!fo){
          fo = this.rawNode.ownerDocument.createElement("v:fill");
         }
         fo.method = "any";
         fo.type = "solid";
         fo.opacity = this.fillStyle.a;
         var alphaFilter = this.rawNode.filters["DXImageTransform.Microsoft.Alpha"];
         if(alphaFilter){
          alphaFilter.opacity = Math.round(this.fillStyle.a * 100);
         }
         this.rawNode.fillcolor = this.fillStyle.toHex();
         this.rawNode.filled = true;
         return this; // self
        },


        setStroke: function(stroke){
         // summary: sets a stroke object (VML)
         // stroke: Object: a stroke object
         // (see dojox.gfx.defaultStroke)


         if(!stroke){
          // don't stroke
          this.strokeStyle = null;
          this.rawNode.stroked = "f";
          return this;
         }
         // normalize the stroke
         if(typeof stroke == "string" || d.isArray(stroke) || stroke instanceof d.Color){
          stroke = {color: stroke};
         }
         var s = this.strokeStyle = g.makeParameters(g.defaultStroke, stroke);
         s.color = g.normalizeColor(s.color);
         // generate attributes
         var rn = this.rawNode;
         rn.stroked = true;
         rn.strokecolor = s.color.toCss();
         rn.strokeweight = s.width + "px"; // TODO: should we assume that the width is always in pixels?
         if(rn.stroke) {
          rn.stroke.opacity = s.color.a;
          rn.stroke.endcap = this._translate(this._capMap, s.cap);
          if(typeof s.join == "number") {
           rn.stroke.joinstyle = "miter";
           rn.stroke.miterlimit = s.join;
          }else{
           rn.stroke.joinstyle = s.join;
           // rn.stroke.miterlimit = s.width;
          }
          rn.stroke.dashstyle = s.style == "none" ? "Solid" : s.style;
         }
         return this; // self
        },


        _capMap: { butt: 'flat' },
        _capMapReversed: { flat: 'butt' },


        _translate: function(dict, value) {
         return (value in dict) ? dict[value] : value;
        },


        _applyTransform: function() {
         var matrix = this._getRealMatrix();
         if(matrix){
          var skew = this.rawNode.skew;
          if(typeof skew == "undefined"){
           for(var i = 0; i < this.rawNode.childNodes.length; ++i){
            if(this.rawNode.childNodes[i].tagName == "skew"){
             skew = this.rawNode.childNodes[i];
             break;
            }
           }
          }
          if(skew){
           skew.on = "f";
           var mt = matrix.xx.toFixed(8) + " " + matrix.xy.toFixed(8) + " " +
            matrix.yx.toFixed(8) + " " + matrix.yy.toFixed(8) + " 0 0",
            offset = Math.floor(matrix.dx).toFixed() + "px " + Math.floor(matrix.dy).toFixed() + "px",
            s = this.rawNode.style,
            l = parseFloat(s.left),
            t = parseFloat(s.top),
            w = parseFloat(s.width),
            h = parseFloat(s.height);
           if(isNaN(l)) l = 0;
           if(isNaN(t)) t = 0;
           if(isNaN(w) || !w) w = 1;
           if(isNaN(h) || !h) h = 1;
           var origin = (-l / w - 0.5).toFixed(8) + " " + (-t / h - 0.5).toFixed(8);
           skew.matrix = mt;
           skew.origin = origin;
           skew.offset = offset;
           skew.on = true;
          }
         }
         if(this.fillStyle && this.fillStyle.type == "linear"){
          this.setFill(this.fillStyle);
         }
         return this;
        },


        _setDimensions: function(width, height){
         // summary: sets the width and height of the rawNode,
         // if the surface sixe has been changed
         // width: String: width in pixels
         // height: String: height in pixels


         // default implementation does nothing
         return this; // self
    • summary
      sets the width and height of the rawNode,
      if the surface sixe has been changed
    • returns
      Number|self
  • dojox.gfx.vml.Shape.setRawNode

    • type
      Function
    • parameters:
      • rawNode: (typeof )
    • source: [view]
         rawNode.stroked = "f";
         rawNode.filled = "f";
         this.rawNode = rawNode;
    • summary
      assigns and clears the underlying node that will represent this
      shape. Once set, transforms, gradients, etc, can be applied.
      (no fill &amp; stroke by default)
  • dojox.gfx.vml.Shape._moveToFront

    • type
      Function
    • source: [view]
         this.rawNode.parentNode.appendChild(this.rawNode);
         return this;
    • summary
      moves a shape to front of its parent's list of shapes (VML)
  • dojox.gfx.vml.Shape._moveToBack

    • type
      Function
    • source: [view]
         var r = this.rawNode, p = r.parentNode, n = p.firstChild;
         p.insertBefore(r, n);
         if(n.tagName == "rect"){
          // surface has a background rectangle, which position should be preserved
          n.swapNode(r);
         }
         return this;
    • summary
      moves a shape to back of its parent's list of shapes (VML)
  • dojox.gfx.vml.Shape._getRealMatrix

    • type
      Function
    • source: [view]
         return this.parentMatrix ? new g.Matrix2D([this.parentMatrix, this.matrix]) : this.matrix; // dojox.gfx.Matrix2D
    • summary
      returns the cumulative (&quot;real&quot;) transformation matrix
      by combining the shape's matrix with its parent's matrix
    • returns
      dojox.gfx.Matrix2D
  • dojox.gfx.vml.Shape.fillStyle

    • summary
  • dojox.gfx.vml.Shape.rawNode.filled

    • summary
  • dojox.gfx.vml.Shape.rawNode.fill.opacity

    • summary
  • dojox.gfx.vml.Shape.rawNode.fillcolor

    • summary
  • dojox.gfx.vml.Shape.strokeStyle

    • summary
  • dojox.gfx.vml.Shape.rawNode.stroked

    • summary
  • dojox.gfx.vml.Shape._capMap.butt

    • summary
  • dojox.gfx.vml.Shape._capMapReversed.flat

    • summary
  • dojox.gfx.vml.Shape.fillStyle.type

    • summary
  • dojox.gfx.vml.Shape.rawNode

    • summary
  • vml.xmlns

    • summary
  • vml.text_alignment

    • summary
  • vml._parseFloat

    • summary
  • vml._bool

    • summary
  • vml.Group.nodeType

    • summary
  • vml.Rect.nodeType

    • summary
  • vml.Ellipse.nodeType

    • summary
  • vml.Circle.nodeType

    • summary
  • vml.Line.nodeType

    • summary
  • vml.Polyline.nodeType

    • summary
  • vml.Image.nodeType

    • summary
  • vml.Text.nodeType

    • summary
  • vml.Path.nodeType

    • summary
  • vml.TextPath.nodeType

    • summary
  • vml.createSurface

    • summary
  • o

    • summary
  • dojox.gfx.vml

    • type
      Object
    • summary
  • dojox.gfx

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary