123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- jvm.VMLElement = function(name, config){
- if (!jvm.VMLElement.VMLInitialized) {
- jvm.VMLElement.initializeVML();
- }
- jvm.VMLElement.parentClass.apply(this, arguments);
- };
- jvm.inherits(jvm.VMLElement, jvm.AbstractElement);
- jvm.VMLElement.VMLInitialized = false;
-
-
- jvm.VMLElement.initializeVML = function(){
- try {
- if (!document.namespaces.rvml) {
- document.namespaces.add("rvml","urn:schemas-microsoft-com:vml");
- }
-
- jvm.VMLElement.prototype.createElement = function (tagName) {
- return document.createElement('<rvml:' + tagName + ' class="rvml">');
- };
- } catch (e) {
-
- jvm.VMLElement.prototype.createElement = function (tagName) {
- return document.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
- };
- }
- document.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
- jvm.VMLElement.VMLInitialized = true;
- };
- jvm.VMLElement.prototype.getElementCtr = function( ctr ){
- return jvm['VML'+ctr];
- };
- jvm.VMLElement.prototype.addClass = function( className ){
- jvm.$(this.node).addClass(className);
- };
- jvm.VMLElement.prototype.applyAttr = function( attr, value ){
- this.node[attr] = value;
- };
- jvm.VMLElement.prototype.getBBox = function(){
- var node = jvm.$(this.node);
- return {
- x: node.position().left / this.canvas.scale,
- y: node.position().top / this.canvas.scale,
- width: node.width() / this.canvas.scale,
- height: node.height() / this.canvas.scale
- };
- };
|