widgetSVGBase.js

Summary

No overview generated for 'widgetSVGBase.js'


// Eventually this will probably have an SVG base class in it.
// CVS doesn't really like switching file names, so that's the
// name I go with now. But at the moment, all there is is
// the SVG test class.

/**
  SVG Test

  @summary This Widget is a base widget for SVG-based widgets,
  providing support for SVG as it seems appropriate.

  This: 

  <ul>
    <li>Sets the defaultURI to the SVG namespace in
    <tt>.initData</tt>.</li>
    </ul>
*/
deriveNewWidget("SVGTest", Widget);

/**
  Set the <tt>defaultURI</tt> to the SVG namespace.
*/
SVGTest.prototype.initData = function (atts) {
  Widget.prototype.initData.call(this, atts);
  this.defaultURI = "http://www.w3.org/2000/svg";
}

SVGTest.prototype.content = {
  tagName: "svg", width: 300, height: 110, version: "1.1",
  children: [
    {tagName: "rect", width: 300, height: 100, name: "rect",
     style: "fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"
    }
  ]
};

SVGTest.prototype.onclick_rect = function (event) {
  var oldHeight = parseInt(getAttributeFrom(this.domNode, "height"));
  setAttributeOn(this.domNode, "height", oldHeight + 10);
  oldHeight = parseInt(getAttributeFrom(this.rect, "height"));
  setAttributeOn(this.rect, "height", oldHeight + 10);
}


Documentation generated by JSDoc on Tue May 3 17:16:26 2005