dojox/gfx/_base.js

  • Provides:

    • dojox.gfx._base
  • g._hasClass

    • summary
  • g._addClass

    • summary
  • g._removeClass

    • summary
  • b._getFontMeasurements

    • summary
  • b._getCachedFontMeasurements

    • summary
  • m.className

    • summary
  • s.borderWidth

    • summary
  • s.margin

    • summary
  • s.padding

    • summary
  • s.outline

    • summary
  • m.innerHTML

    • summary
  • b._getUniqueId

    • summary
  • dojox.gfx.defaultPath

    • type
      Object
    • summary
  • dojox.gfx.defaultPath.type

    • summary
  • dojox.gfx.defaultPath.path

    • summary
  • dojox.gfx.defaultPolyline

    • type
      Object
    • summary
  • dojox.gfx.defaultPolyline.type

    • summary
  • dojox.gfx.defaultPolyline.points

    • summary
  • dojox.gfx.defaultRect

    • type
      Object
    • summary
  • dojox.gfx.defaultRect.type

    • summary
  • dojox.gfx.defaultRect.x

    • summary
  • dojox.gfx.defaultEllipse

    • type
      Object
    • summary
  • dojox.gfx.defaultEllipse.type

    • summary
  • dojox.gfx.defaultEllipse.cx

    • summary
  • dojox.gfx.defaultCircle

    • type
      Object
    • summary
  • dojox.gfx.defaultCircle.type

    • summary
  • dojox.gfx.defaultCircle.cx

    • summary
  • dojox.gfx.defaultLine

    • type
      Object
    • summary
  • dojox.gfx.defaultLine.type

    • summary
  • dojox.gfx.defaultLine.x1

    • summary
  • dojox.gfx.defaultImage

    • type
      Object
    • summary
  • dojox.gfx.defaultImage.type

    • summary
  • dojox.gfx.defaultImage.x

    • summary
  • dojox.gfx.defaultText

    • type
      Object
    • summary
  • dojox.gfx.defaultText.type

    • summary
  • dojox.gfx.defaultText.x

    • summary
  • dojox.gfx.defaultText.decoration

    • summary
  • dojox.gfx.defaultTextPath

    • type
      Object
    • summary
  • dojox.gfx.defaultTextPath.type

    • summary
  • dojox.gfx.defaultTextPath.text

    • summary
  • dojox.gfx.defaultTextPath.decoration

    • summary
  • dojox.gfx.defaultStroke

    • type
      Object
    • summary
  • dojox.gfx.defaultStroke.type

    • summary
  • dojox.gfx.defaultStroke.color

    • summary
  • dojox.gfx.defaultStroke.cap

    • summary
  • dojox.gfx.defaultLinearGradient

    • type
      Object
    • summary
  • dojox.gfx.defaultLinearGradient.type

    • summary
  • dojox.gfx.defaultLinearGradient.colors

    • summary
  • dojox.gfx.defaultRadialGradient

    • type
      Object
    • summary
  • dojox.gfx.defaultRadialGradient.type

    • summary
  • dojox.gfx.defaultRadialGradient.colors

    • summary
  • dojox.gfx.defaultPattern

    • type
      Object
    • summary
  • dojox.gfx.defaultPattern.type

    • summary
  • dojox.gfx.defaultPattern.x

    • summary
  • dojox.gfx.defaultFont

    • type
      Object
    • summary
  • dojox.gfx.defaultFont.type

    • summary
  • dojox.gfx.defaultFont.style

    • summary
  • dojox.gfx.defaultFont.weight

    • summary
  • dojox.gfx.getDefault

    • summary
  • dojox.gfx.normalizeColor

    • type
      Function
    • parameters:
      • color: (typeof Color)
    • source: [view]
        return (color instanceof dojo.Color) ? color : new dojo.Color(color); // dojo.Color
    • summary
      converts any legal color representation to normalized
      dojo.Color object
    • returns
      dojo.Color
  • dojox.gfx.normalizeParameters

    • type
      Function
    • parameters:
      • existed: (typeof Object)
        the "target" object to be updated
      • update: (typeof Object)
        the "update" object, whose properties will be used to update
        the existed object
    • source: [view]
        if(update){
         var empty = {};
         for(var x in existed){
          if(x in update && !(x in empty)){
           existed[x] = update[x];
          }
         }
        }
        return existed; // Object
    • summary
      updates an existing object with properties from an "update"
      object
    • returns
      Object
  • dojox.gfx.makeParameters

    • type
      Function
    • parameters:
      • defaults: (typeof Object)
        the object to be cloned before updating
      • update: (typeof Object)
        the object, which properties are to be cloned during updating
    • source: [view]
        if(!update){
         // return dojo.clone(defaults);
         return dojo.delegate(defaults);
        }
        var result = {};
        for(var i in defaults){
         if(!(i in result)){
          result[i] = dojo.clone((i in update) ? update[i] : defaults[i]);
         }
        }
        return result; // Object
    • summary
      copies the original object, and all copied properties from the
      "update" object
    • returns
      Object
  • dojox.gfx.formatNumber

    • type
      Function
    • parameters:
      • x: (typeof Number)
        	number to be converted
      • addSpace: (typeof Boolean)
        if it is true, add a space before a positive number
    • source: [view]
        var val = x.toString();
        if(val.indexOf("e") >= 0){
         val = x.toFixed(4);
        }else{
         var point = val.indexOf(".");
         if(point >= 0 && val.length - point > 5){
          val = x.toFixed(4);
         }
        }
        if(x < 0){
         return val; // String
        }
        return addSpace ? " " + val : val; // String
    • summary
      converts a number to a string using a fixed notation
    • returns
      String
  • dojox.gfx.makeFontString

    • type
      Function
    • parameters:
      • font: (typeof Object)
        font object (see dojox.gfx.defaultFont)
    • source: [view]
        return font.style + " " + font.variant + " " + font.weight + " " + font.size + " " + font.family; // Object
    • summary
      converts a font object to a CSS font string
    • returns
      Object
  • dojox.gfx.splitFontString

    • type
      Function
    • parameters:
      • str: (typeof String)
        a CSS font string
    • source: [view]
        var font = dojox.gfx.getDefault("Font");
        var t = str.split(/\s+/);
        do{
         if(t.length < 5){ break; }
         font.style = t[0];
         font.variant = t[1];
         font.weight = t[2];
         var i = t[3].indexOf("/");
         font.size = i < 0 ? t[3] : t[3].substring(0, i);
         var j = 4;
         if(i < 0){
          if(t[4] == "/"){
           j = 6;
          }else if(t[4].charAt(0) == "/"){
           j = 5;
          }
         }
         if(j < t.length){
          font.family = t.slice(j).join(" ");
         }
        }while(false);
        return font; // Object
    • summary
      converts a CSS font string to a font object
    • description
      Converts a CSS font string to a gfx font object. The CSS font
      string components should follow the W3C specified order
      (see http://www.w3.org/TR/CSS2/fonts.html#font-shorthand):
      style, variant, weight, size, optional line height (will be
      ignored), and family.
    • returns
      Object
  • dojox.gfx.cm_in_pt

    • summary
  • dojox.gfx.mm_in_pt

    • summary
  • dojox.gfx.px_in_pt

    • type
      Function
    • source: [view]
        return dojox.gfx._base._getCachedFontMeasurements()["12pt"] / 12; // Number
    • summary
      returns a number of pixels per point
    • returns
      Number
  • dojox.gfx.pt2px

    • type
      Function
    • parameters:
      • len: (typeof Number)
        a value in points
    • source: [view]
        return len * dojox.gfx.px_in_pt(); // Number
    • summary
      converts points to pixels
    • returns
      Number
  • dojox.gfx.px2pt

    • type
      Function
    • parameters:
      • len: (typeof Number)
        a value in pixels
    • source: [view]
        return len / dojox.gfx.px_in_pt(); // Number
    • summary
      converts pixels to points
    • returns
      Number
  • dojox.gfx.normalizedLength

    • type
      Function
    • parameters:
      • len: (typeof String)
        a length, e.g., &quot;12pc&quot;
    • source: [view]
        if(len.length == 0) return 0;
        if(len.length > 2){
         var px_in_pt = dojox.gfx.px_in_pt();
         var val = parseFloat(len);
         switch(len.slice(-2)){
          case "px": return val;
          case "pt": return val * px_in_pt;
          case "in": return val * 72 * px_in_pt;
          case "pc": return val * 12 * px_in_pt;
          case "mm": return val * dojox.gfx.mm_in_pt * px_in_pt;
          case "cm": return val * dojox.gfx.cm_in_pt * px_in_pt;
         }
        }
        return parseFloat(len); // Number
    • summary
      converts any length value to pixels
    • returns
      Number
  • dojox.gfx.pathVmlRegExp

    • summary
  • dojox.gfx.pathSvgRegExp

    • summary
  • dojox.gfx.equalSources

    • type
      Function
    • parameters:
      • a: (typeof )
      • b: (typeof )
    • source: [view]
        return a && b && a == b;
    • summary
      compares event sources, returns true if they are equal
  • dojox.gfx.switchTo

    • type
      Function
    • parameters:
      • renderer: (typeof )
    • source: [view]
        var ns = dojox.gfx[renderer];
        if(ns){
         dojo.forEach(["Group", "Rect", "Ellipse", "Circle", "Line",
           "Polyline", "Image", "Text", "Path", "TextPath",
           "Surface", "createSurface"], function(name){
          dojox.gfx[name] = ns[name];
         });
        }
    • summary
  • dojox.gfx._base

    • type
      Object
    • summary
  • dojox.gfx

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary