a:117:{s:9:"#provides";s:15:"dojox.gfx.shape";s:9:"#resource";s:12:"gfx/shape.js";s:9:"#requires";a:1:{i:0;a:2:{i:0;s:6:"common";i:1;s:15:"dojox.gfx._base";}}s:15:"dojox.gfx.Shape";a:5:{s:4:"type";s:8:"Function";s:7:"summary";s:81:"a Shape object, which knows how to apply graphical attributes and transformations";s:6:"source";s:1382:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null;";s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:33:"dojox.gfx.shape._eventsProcessing";}}s:9:"classlike";b:1;}s:23:"dojox.gfx.Shape.getNode";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:30:" return this.rawNode; // Node";s:7:"summary";s:36:"returns the current DOM Node or null";s:7:"returns";s:4:"Node";}s:24:"dojox.gfx.Shape.getShape";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:30:" return this.shape; // Object";s:7:"summary";s:219:"returns the current shape object or null (see dojox.gfx.defaultPath, dojox.gfx.defaultPolyline, dojox.gfx.defaultRect, dojox.gfx.defaultEllipse, dojox.gfx.defaultCircle, dojox.gfx.defaultLine, or dojox.gfx.defaultImage)";s:7:"returns";s:6:"Object";}s:28:"dojox.gfx.Shape.getTransform";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:43:" return this.matrix; // dojox.gfx.Matrix2D";s:7:"summary";s:49:"returns the current transformation matrix or null";s:7:"returns";s:18:"dojox.gfx.Matrix2D";}s:23:"dojox.gfx.Shape.getFill";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:34:" return this.fillStyle; // Object";s:7:"summary";s:151:"returns the current fill object or null (see dojox.gfx.defaultLinearGradient, dojox.gfx.defaultRadialGradient, dojox.gfx.defaultPattern, or dojo.Color)";s:7:"returns";s:6:"Object";}s:25:"dojox.gfx.Shape.getStroke";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:36:" return this.strokeStyle; // Object";s:7:"summary";s:71:"returns the current stroke object or null (see dojox.gfx.defaultStroke)";s:7:"returns";s:6:"Object";}s:25:"dojox.gfx.Shape.getParent";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:31:" return this.parent; // Object";s:7:"summary";s:100:"returns the parent or null (see dojox.gfx.Surface, dojox.gfx.shape.VirtualGroup, or dojox.gfx.Group)";s:7:"returns";s:6:"Object";}s:30:"dojox.gfx.Shape.getBoundingBox";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:42:" return this.bbox; // dojox.gfx.Rectangle";s:7:"summary";s:60:"returns the bounding box or null (see dojox.gfx.defaultRect)";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:41:"dojox.gfx.Shape.getTransformedBoundingBox";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:368:" var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array";s:7:"summary";s:108:"returns an array of four points or null four points represent four corners of the untransformed bounding box";s:7:"returns";s:10:"null|Array";}s:30:"dojox.gfx.Shape.getEventSource";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:3470:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node";s:7:"returns";s:61:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array";s:7:"summary";s:0:"";}s:24:"dojox.gfx.Shape.setShape";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"shape";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:4013:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self";s:7:"summary";s:66:"sets a shape object (the default implementation simply ignores it)";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";}s:23:"dojox.gfx.Shape.setFill";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"fill";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:4971:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self";s:7:"summary";s:65:"sets a fill object (the default implementation simply ignores it)";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";}s:25:"dojox.gfx.Shape.setStroke";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"stroke";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:5610:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self";s:7:"summary";s:67:"sets a stroke object (the default implementation simply ignores it)";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";}s:28:"dojox.gfx.Shape.setTransform";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"matrix";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:6057:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self";s:7:"summary";s:28:"sets a transformation matrix";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";}s:31:"dojox.gfx.Shape._applyTransform";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:6205:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dojox.gfx.Shape.moveToFront";a:5:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:153:" var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self";s:7:"summary";s:53:"moves a shape to front of its parent's list of shapes";s:7:"returns";s:4:"self";}s:26:"dojox.gfx.Shape.moveToBack";a:4:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:143:" var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this;";s:7:"summary";s:52:"moves a shape to back of its parent's list of shapes";}s:28:"dojox.gfx.Shape._moveToFront";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:6870:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER!";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dojox.gfx.Shape._moveToBack";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:7026:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER!";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:7:"private";b:1;s:7:"summary";s:0:"";}s:35:"dojox.gfx.Shape.applyRightTransform";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"matrix";a:2:{s:4:"type";s:18:"dojox.gfx.Matrix2D";s:7:"summary";s:119:"a matrix or a matrix-like object (see an argument of dojox.gfx.Matrix2D constructor for a list of acceptable arguments)";}}s:6:"source";s:74:" return matrix ? this.setTransform([this.matrix, matrix]) : this; // self";s:7:"summary";s:84:"multiplies the existing matrix with an argument on right side (this.matrix * matrix)";s:7:"returns";s:4:"self";}s:34:"dojox.gfx.Shape.applyLeftTransform";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"matrix";a:2:{s:4:"type";s:18:"dojox.gfx.Matrix2D";s:7:"summary";s:119:"a matrix or a matrix-like object (see an argument of dojox.gfx.Matrix2D constructor for a list of acceptable arguments)";}}s:6:"source";s:74:" return matrix ? this.setTransform([matrix, this.matrix]) : this; // self";s:7:"summary";s:83:"multiplies the existing matrix with an argument on left side (matrix * this.matrix)";s:7:"returns";s:4:"self";}s:30:"dojox.gfx.Shape.applyTransform";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"matrix";a:2:{s:4:"type";s:18:"dojox.gfx.Matrix2D";s:7:"summary";s:119:"a matrix or a matrix-like object (see an argument of dojox.gfx.Matrix2D constructor for a list of acceptable arguments)";}}s:6:"source";s:74:" return matrix ? this.setTransform([this.matrix, matrix]) : this; // self";s:7:"summary";s:50:"a shortcut for dojox.gfx.Shape.applyRightTransform";s:7:"returns";s:4:"self";}s:27:"dojox.gfx.Shape.removeShape";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:8:"silently";a:3:{s:4:"type";s:7:"Boolean";s:8:"optional";b:1;s:7:"summary";s:36:"if true, do not redraw a picture yet";}}s:6:"source";s:84:" if(this.parent){ this.parent.remove(this, silently); } return this; // self";s:7:"summary";s:50:"removes the shape from its parent's list of shapes";s:7:"returns";s:4:"self";}s:26:"dojox.gfx.Shape._setParent";a:7:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:6:"parent";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:90:"a parent or null (see dojox.gfx.Surface, dojox.gfx.shape.VirtualGroup, or dojox.gfx.Group)";}s:6:"matrix";a:2:{s:4:"type";s:18:"dojox.gfx.Matrix2D";s:7:"summary";s:35:"a 2D matrix or a matrix-like object";}}s:6:"source";s:74:" this.parent = parent; return this._updateParentMatrix(matrix); // self";s:7:"summary";s:13:"sets a parent";s:7:"returns";s:4:"self";s:7:"private";b:1;}s:35:"dojox.gfx.Shape._updateParentMatrix";a:7:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"matrix";a:2:{s:4:"type";s:18:"dojox.gfx.Matrix2D";s:7:"summary";s:35:"a 2D matrix or a matrix-like object";}}s:6:"source";s:110:" this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self";s:7:"summary";s:41:"updates the parent matrix with new matrix";s:7:"returns";s:4:"self";s:7:"private";b:1;}s:30:"dojox.gfx.Shape._getRealMatrix";a:6:{s:9:"prototype";s:15:"dojox.gfx.Shape";s:4:"type";s:8:"Function";s:6:"source";s:182:" var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D";s:7:"summary";s:120:"returns the cumulative ("real") transformation matrix by combining the shape's matrix with its parent's matrix";s:7:"returns";s:18:"dojox.gfx.Matrix2D";s:7:"private";b:1;}s:21:"dojox.gfx.Shape.shape";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:20:"dojox.gfx.Shape.bbox";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:25:"dojox.gfx.Shape.fillStyle";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:27:"dojox.gfx.Shape.strokeStyle";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:22:"dojox.gfx.Shape.matrix";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:22:"dojox.gfx.Shape.parent";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:33:"dojox.gfx.Shape._setParent.parent";a:3:{s:4:"type";s:6:"Object";s:7:"summary";s:90:"a parent or null (see dojox.gfx.Surface, dojox.gfx.shape.VirtualGroup, or dojox.gfx.Group)";s:14:"private_parent";b:1;}s:28:"dojox.gfx.Shape.parentMatrix";a:2:{s:8:"instance";s:15:"dojox.gfx.Shape";s:7:"summary";s:0:"";}s:23:"dojox.gfx.Shape.rawNode";a:3:{s:8:"instance";s:15:"dojox.gfx.Shape";s:4:"type";s:4:"Node";s:7:"summary";s:15:"underlying node";}s:23:"dojox.gfx.shape.Surface";a:6:{s:4:"type";s:8:"Function";s:7:"summary";s:40:"a surface object to be used for drawings";s:6:"source";s:12201:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, // apply left & right transformation applyRightTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on right side // (this.matrix * matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, applyLeftTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on left side // (matrix * this.matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([matrix, this.matrix]) : this; // self }, applyTransform: function(matrix){ // summary: a shortcut for dojox.gfx.Shape.applyRightTransform // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, // virtual group methods removeShape: function(silently){ // summary: removes the shape from its parent's list of shapes // silently: Boolean?: if true, do not redraw a picture yet if(this.parent){ this.parent.remove(this, silently); } return this; // self }, _setParent: function(parent, matrix){ // summary: sets a parent // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parent = parent; return this._updateParentMatrix(matrix); // self }, _updateParentMatrix: function(matrix){ // summary: updates the parent matrix with new matrix // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self }, _getRealMatrix: function(){ // summary: returns the cumulative ("real") transformation matrix // by combining the shape's matrix with its parent's matrix var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D } }); dojox.gfx.shape._eventsProcessing = { connect: function(name, object, method){ // summary: connects a handler to an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return arguments.length > 2 ? // Object dojo.connect(this.getEventSource(), name, object, method) : dojo.connect(this.getEventSource(), name, object); }, disconnect: function(token){ // summary: connects a handler by token from an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! dojo.disconnect(token); } }; dojo.extend(dojox.gfx.Shape, dojox.gfx.shape._eventsProcessing); dojox.gfx.shape.Container = { // summary: a container of shapes, which can be used // as a foundation for renderer-specific groups, or as a way // to logically group shapes (e.g, to propagate matricies) _init: function() { // children: Array: a list of children this.children = []; }, // group management add: function(shape){ // summary: adds a shape to the list // shape: dojox.gfx.Shape: a shape var oldParent = shape.getParent(); if(oldParent){ oldParent.remove(shape, true); } this.children.push(shape); return shape._setParent(this, this._getRealMatrix()); // self }, remove: function(shape, silently){ // summary: removes a shape from the list // silently: Boolean?: if true, do not redraw a picture yet for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ if(silently){ // skip for now }else{ shape.parent = null; shape.parentMatrix = null; } this.children.splice(i, 1); break; } } return this; // self }, clear: function(){ // summary: removes all shapes from a group/surface this.children = []; return this; // self }, // moving child nodes _moveChildToFront: function(shape){ // summary: moves a shape to front of the list of shapes for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.push(shape); break; } } return this; // self }, _moveChildToBack: function(shape){ // summary: moves a shape to back of the list of shapes for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.unshift(shape); break; } } return this; // self } }; dojo.declare("dojox.gfx.shape.Surface", null, { // summary: a surface object to be used for drawings constructor: function(){ // underlying node this.rawNode = null; // the parent node this._parent = null; // the list of DOM nodes to be deleted in the case of destruction this._nodes = []; // the list of events to be detached in the case of destruction this._events = [];";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:33:"dojox.gfx.shape._eventsProcessing";}}s:9:"classlike";b:1;}s:31:"dojox.gfx.shape.Surface.destroy";a:4:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:4:"type";s:8:"Function";s:6:"source";s:371:" dojo.forEach(this._nodes, dojo.destroy); this._nodes = []; dojo.forEach(this._events, dojo.disconnect); this._events = []; this.rawNode = null; // recycle it in _nodes, if it needs to be recycled if(dojo.isIE){ while(this._parent.lastChild){ dojo.destroy(this._parent.lastChild); } }else{ this._parent.innerHTML = ""; } this._parent = null;";s:7:"summary";s:115:"destroy all relevant external resources and release all external references to make this object garbage-collectible";}s:38:"dojox.gfx.shape.Surface.getEventSource";a:5:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:4:"type";s:8:"Function";s:6:"source";s:30:" return this.rawNode; // Node";s:7:"summary";s:59:"returns a node, which can be used to attach event listeners";s:7:"returns";s:4:"Node";}s:38:"dojox.gfx.shape.Surface._getRealMatrix";a:6:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:4:"type";s:8:"Function";s:6:"source";s:36:" return null; // dojox.gfx.Matrix2D";s:7:"summary";s:34:"always returns the identity matrix";s:7:"returns";s:18:"dojox.gfx.Matrix2D";s:7:"private";b:1;}s:32:"dojox.gfx.shape.Surface.isLoaded";a:2:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:7:"summary";s:0:"";}s:30:"dojox.gfx.shape.Surface.onLoad";a:5:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"surface";a:1:{s:4:"type";s:17:"dojox.gfx.Surface";}}s:6:"source";s:156:" // summary: local event, fired once when the surface is created // asynchronously, used only when isLoaded is false, required // only for Silverlight.";s:7:"summary";s:132:"local event, fired once when the surface is created asynchronously, used only when isLoaded is false, required only for Silverlight.";}s:34:"dojox.gfx.shape.Surface.whenLoaded";a:5:{s:9:"prototype";s:23:"dojox.gfx.shape.Surface";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:7:"context";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Object";}s:6:"method";a:1:{s:4:"type";s:15:"Function|String";}}s:6:"source";s:190:" var f = dojo.hitch(context, method); if(this.isLoaded){ f(this); }else{ var h = dojo.connect(this, "onLoad", function(surface){ dojo.disconnect(h); f(surface); }); }";s:7:"summary";s:0:"";}s:30:"dojox.gfx.shape.Surface._nodes";a:3:{s:8:"instance";s:23:"dojox.gfx.shape.Surface";s:7:"private";b:1;s:7:"summary";s:0:"";}s:31:"dojox.gfx.shape.Surface._events";a:3:{s:8:"instance";s:23:"dojox.gfx.shape.Surface";s:7:"private";b:1;s:7:"summary";s:0:"";}s:31:"dojox.gfx.shape.Surface.rawNode";a:2:{s:8:"instance";s:23:"dojox.gfx.shape.Surface";s:7:"summary";s:0:"";}s:41:"dojox.gfx.shape.Surface._parent.innerHTML";a:3:{s:8:"instance";s:23:"dojox.gfx.shape.Surface";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:31:"dojox.gfx.shape.Surface._parent";a:3:{s:8:"instance";s:23:"dojox.gfx.shape.Surface";s:7:"private";b:1;s:7:"summary";s:0:"";}s:15:"dojox.gfx.Point";a:4:{s:4:"type";s:8:"Function";s:7:"summary";s:56:"a hypothetical 2D point to be used for drawings - {x, y}";s:11:"description";s:105:"This object is defined for documentation purposes. You should use the naked object instead: {x: 1, y: 2}.";s:9:"classlike";b:1;}s:19:"dojox.gfx.Rectangle";a:4:{s:4:"type";s:8:"Function";s:7:"summary";s:48:"a hypothetical rectangle - {x, y, width, height}";s:11:"description";s:130:"This object is defined for documentation purposes. You should use the naked object instead: {x: 1, y: 2, width: 100, height: 200}.";s:9:"classlike";b:1;}s:20:"dojox.gfx.shape.Rect";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:19:"a generic rectangle";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:70:" this.shape = dojox.gfx.getDefault("Rect"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:35:"dojox.gfx.shape.Rect.getBoundingBox";a:5:{s:9:"prototype";s:20:"dojox.gfx.shape.Rect";s:4:"type";s:8:"Function";s:6:"source";s:43:" return this.shape; // dojox.gfx.Rectangle";s:7:"summary";s:49:"returns the bounding box (its shape in this case)";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:26:"dojox.gfx.shape.Rect.shape";a:2:{s:8:"instance";s:20:"dojox.gfx.shape.Rect";s:7:"summary";s:0:"";}s:28:"dojox.gfx.shape.Rect.rawNode";a:3:{s:8:"instance";s:20:"dojox.gfx.shape.Rect";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:23:"dojox.gfx.shape.Ellipse";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:17:"a generic ellipse";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:73:" this.shape = dojox.gfx.getDefault("Ellipse"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:38:"dojox.gfx.shape.Ellipse.getBoundingBox";a:5:{s:9:"prototype";s:23:"dojox.gfx.shape.Ellipse";s:4:"type";s:8:"Function";s:6:"source";s:203:" if(!this.bbox){ var shape = this.shape; this.bbox = {x: shape.cx - shape.rx, y: shape.cy - shape.ry, width: 2 * shape.rx, height: 2 * shape.ry}; } return this.bbox; // dojox.gfx.Rectangle";s:7:"summary";s:24:"returns the bounding box";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:28:"dojox.gfx.shape.Ellipse.bbox";a:2:{s:8:"instance";s:23:"dojox.gfx.shape.Ellipse";s:7:"summary";s:0:"";}s:29:"dojox.gfx.shape.Ellipse.shape";a:2:{s:8:"instance";s:23:"dojox.gfx.shape.Ellipse";s:7:"summary";s:0:"";}s:31:"dojox.gfx.shape.Ellipse.rawNode";a:3:{s:8:"instance";s:23:"dojox.gfx.shape.Ellipse";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:22:"dojox.gfx.shape.Circle";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:76:"a generic circle (this is a helper object, which is defined for convenience)";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:72:" this.shape = dojox.gfx.getDefault("Circle"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:37:"dojox.gfx.shape.Circle.getBoundingBox";a:5:{s:9:"prototype";s:22:"dojox.gfx.shape.Circle";s:4:"type";s:8:"Function";s:6:"source";s:199:" if(!this.bbox){ var shape = this.shape; this.bbox = {x: shape.cx - shape.r, y: shape.cy - shape.r, width: 2 * shape.r, height: 2 * shape.r}; } return this.bbox; // dojox.gfx.Rectangle";s:7:"summary";s:24:"returns the bounding box";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:27:"dojox.gfx.shape.Circle.bbox";a:2:{s:8:"instance";s:22:"dojox.gfx.shape.Circle";s:7:"summary";s:0:"";}s:28:"dojox.gfx.shape.Circle.shape";a:2:{s:8:"instance";s:22:"dojox.gfx.shape.Circle";s:7:"summary";s:0:"";}s:30:"dojox.gfx.shape.Circle.rawNode";a:3:{s:8:"instance";s:22:"dojox.gfx.shape.Circle";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:20:"dojox.gfx.shape.Line";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:74:"a generic line (this is a helper object, which is defined for convenience)";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:70:" this.shape = dojox.gfx.getDefault("Line"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:35:"dojox.gfx.shape.Line.getBoundingBox";a:5:{s:9:"prototype";s:20:"dojox.gfx.shape.Line";s:4:"type";s:8:"Function";s:6:"source";s:274:" if(!this.bbox){ var shape = this.shape; this.bbox = { x: Math.min(shape.x1, shape.x2), y: Math.min(shape.y1, shape.y2), width: Math.abs(shape.x2 - shape.x1), height: Math.abs(shape.y2 - shape.y1) }; } return this.bbox; // dojox.gfx.Rectangle";s:7:"summary";s:24:"returns the bounding box";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:25:"dojox.gfx.shape.Line.bbox";a:2:{s:8:"instance";s:20:"dojox.gfx.shape.Line";s:7:"summary";s:0:"";}s:26:"dojox.gfx.shape.Line.shape";a:2:{s:8:"instance";s:20:"dojox.gfx.shape.Line";s:7:"summary";s:0:"";}s:28:"dojox.gfx.shape.Line.rawNode";a:3:{s:8:"instance";s:20:"dojox.gfx.shape.Line";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:24:"dojox.gfx.shape.Polyline";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:86:"a generic polyline/polygon (this is a helper object, which is defined for convenience)";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:74:" this.shape = dojox.gfx.getDefault("Polyline"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:33:"dojox.gfx.shape.Polyline.setShape";a:7:{s:9:"prototype";s:24:"dojox.gfx.shape.Polyline";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:6:"points";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:31:"a polyline/polygon shape object";}s:6:"closed";a:2:{s:4:"type";s:7:"Boolean";s:7:"summary";s:36:"close the polyline to make a polygon";}}s:6:"source";s:340:" if(points && points instanceof Array){ // points: Array: an array of points dojox.gfx.Shape.prototype.setShape.call(this, {points: points}); if(closed && this.shape.points.length){ this.shape.points.push(this.shape.points[0]); } }else{ dojox.gfx.Shape.prototype.setShape.call(this, points); } return this; // self";s:7:"summary";s:36:"sets a polyline/polygon shape object";s:7:"returns";s:4:"self";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:34:"dojox.gfx.Shape.prototype.setShape";}}}s:39:"dojox.gfx.shape.Polyline.getBoundingBox";a:5:{s:9:"prototype";s:24:"dojox.gfx.shape.Polyline";s:4:"type";s:8:"Function";s:6:"source";s:509:" if(!this.bbox && this.shape.points.length){ var p = this.shape.points; var l = p.length; var t = p[0]; var bbox = {l: t.x, t: t.y, r: t.x, b: t.y}; for(var i = 1; i < l; ++i){ t = p[i]; if(bbox.l > t.x) bbox.l = t.x; if(bbox.r < t.x) bbox.r = t.x; if(bbox.t > t.y) bbox.t = t.y; if(bbox.b < t.y) bbox.b = t.y; } this.bbox = { x: bbox.l, y: bbox.t, width: bbox.r - bbox.l, height: bbox.b - bbox.t }; } return this.bbox; // dojox.gfx.Rectangle";s:7:"summary";s:24:"returns the bounding box";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:29:"dojox.gfx.shape.Polyline.bbox";a:2:{s:8:"instance";s:24:"dojox.gfx.shape.Polyline";s:7:"summary";s:0:"";}s:30:"dojox.gfx.shape.Polyline.shape";a:2:{s:8:"instance";s:24:"dojox.gfx.shape.Polyline";s:7:"summary";s:0:"";}s:32:"dojox.gfx.shape.Polyline.rawNode";a:3:{s:8:"instance";s:24:"dojox.gfx.shape.Polyline";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:21:"dojox.gfx.shape.Image";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:75:"a generic image (this is a helper object, which is defined for convenience)";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:71:" this.shape = dojox.gfx.getDefault("Image"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:36:"dojox.gfx.shape.Image.getBoundingBox";a:5:{s:9:"prototype";s:21:"dojox.gfx.shape.Image";s:4:"type";s:8:"Function";s:6:"source";s:43:" return this.shape; // dojox.gfx.Rectangle";s:7:"summary";s:49:"returns the bounding box (its shape in this case)";s:7:"returns";s:19:"dojox.gfx.Rectangle";}s:31:"dojox.gfx.shape.Image.setStroke";a:5:{s:9:"prototype";s:21:"dojox.gfx.shape.Image";s:4:"type";s:8:"Function";s:6:"source";s:22:" return this; // self";s:7:"summary";s:29:"ignore setting a stroke style";s:7:"returns";s:4:"self";}s:29:"dojox.gfx.shape.Image.setFill";a:5:{s:9:"prototype";s:21:"dojox.gfx.shape.Image";s:4:"type";s:8:"Function";s:6:"source";s:22:" return this; // self";s:7:"summary";s:27:"ignore setting a fill style";s:7:"returns";s:4:"self";}s:27:"dojox.gfx.shape.Image.shape";a:2:{s:8:"instance";s:21:"dojox.gfx.shape.Image";s:7:"summary";s:0:"";}s:29:"dojox.gfx.shape.Image.rawNode";a:3:{s:8:"instance";s:21:"dojox.gfx.shape.Image";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:20:"dojox.gfx.shape.Text";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:15:"dojox.gfx.Shape";}s:4:"call";a:1:{i:0;s:15:"dojox.gfx.Shape";}}s:7:"summary";s:14:"a generic text";s:10:"parameters";a:1:{s:7:"rawNode";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}}s:6:"source";s:95:" this.fontStyle = null; this.shape = dojox.gfx.getDefault("Text"); this.rawNode = rawNode;";s:9:"classlike";b:1;}s:28:"dojox.gfx.shape.Text.getFont";a:5:{s:9:"prototype";s:20:"dojox.gfx.shape.Text";s:4:"type";s:8:"Function";s:6:"source";s:34:" return this.fontStyle; // Object";s:7:"summary";s:39:"returns the current font object or null";s:7:"returns";s:6:"Object";}s:28:"dojox.gfx.shape.Text.setFont";a:6:{s:9:"prototype";s:20:"dojox.gfx.shape.Text";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"newFont";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:58:"a font object (see dojox.gfx.defaultFont) or a font string";}}s:6:"source";s:187:" this.fontStyle = typeof newFont == "string" ? dojox.gfx.splitFontString(newFont) : dojox.gfx.makeParameters(dojox.gfx.defaultFont, newFont); this._setFont(); return this; // self";s:7:"summary";s:20:"sets a font for text";s:7:"returns";s:4:"self";}s:30:"dojox.gfx.shape.Text.fontStyle";a:2:{s:8:"instance";s:20:"dojox.gfx.shape.Text";s:7:"summary";s:0:"";}s:26:"dojox.gfx.shape.Text.shape";a:2:{s:8:"instance";s:20:"dojox.gfx.shape.Text";s:7:"summary";s:0:"";}s:28:"dojox.gfx.shape.Text.rawNode";a:3:{s:8:"instance";s:20:"dojox.gfx.shape.Text";s:4:"type";s:4:"Node";s:7:"summary";s:10:"a DOM Node";}s:33:"dojox.gfx.shape._eventsProcessing";a:3:{s:4:"type";s:6:"Object";s:7:"private";b:1;s:7:"summary";s:0:"";}s:41:"dojox.gfx.shape._eventsProcessing.connect";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"name";a:1:{s:4:"type";s:0:"";}s:6:"object";a:1:{s:4:"type";s:0:"";}s:6:"method";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:9795:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, // apply left & right transformation applyRightTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on right side // (this.matrix * matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, applyLeftTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on left side // (matrix * this.matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([matrix, this.matrix]) : this; // self }, applyTransform: function(matrix){ // summary: a shortcut for dojox.gfx.Shape.applyRightTransform // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, // virtual group methods removeShape: function(silently){ // summary: removes the shape from its parent's list of shapes // silently: Boolean?: if true, do not redraw a picture yet if(this.parent){ this.parent.remove(this, silently); } return this; // self }, _setParent: function(parent, matrix){ // summary: sets a parent // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parent = parent; return this._updateParentMatrix(matrix); // self }, _updateParentMatrix: function(matrix){ // summary: updates the parent matrix with new matrix // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self }, _getRealMatrix: function(){ // summary: returns the cumulative ("real") transformation matrix // by combining the shape's matrix with its parent's matrix var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D } }); dojox.gfx.shape._eventsProcessing = { connect: function(name, object, method){ // summary: connects a handler to an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return arguments.length > 2 ? // Object dojo.connect(this.getEventSource(), name, object, method) : dojo.connect(this.getEventSource(), name, object);";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:44:"dojox.gfx.shape._eventsProcessing.disconnect";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"token";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:9975:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, // apply left & right transformation applyRightTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on right side // (this.matrix * matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, applyLeftTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on left side // (matrix * this.matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([matrix, this.matrix]) : this; // self }, applyTransform: function(matrix){ // summary: a shortcut for dojox.gfx.Shape.applyRightTransform // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, // virtual group methods removeShape: function(silently){ // summary: removes the shape from its parent's list of shapes // silently: Boolean?: if true, do not redraw a picture yet if(this.parent){ this.parent.remove(this, silently); } return this; // self }, _setParent: function(parent, matrix){ // summary: sets a parent // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parent = parent; return this._updateParentMatrix(matrix); // self }, _updateParentMatrix: function(matrix){ // summary: updates the parent matrix with new matrix // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self }, _getRealMatrix: function(){ // summary: returns the cumulative ("real") transformation matrix // by combining the shape's matrix with its parent's matrix var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D } }); dojox.gfx.shape._eventsProcessing = { connect: function(name, object, method){ // summary: connects a handler to an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return arguments.length > 2 ? // Object dojo.connect(this.getEventSource(), name, object, method) : dojo.connect(this.getEventSource(), name, object); }, disconnect: function(token){ // summary: connects a handler by token from an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! dojo.disconnect(token);";s:7:"returns";s:66:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:25:"dojox.gfx.shape.Container";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:154:"a container of shapes, which can be used as a foundation for renderer-specific groups, or as a way to logically group shapes (e.g, to propagate matricies)";}s:31:"dojox.gfx.shape.Container._init";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:10342:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, // apply left & right transformation applyRightTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on right side // (this.matrix * matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, applyLeftTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on left side // (matrix * this.matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([matrix, this.matrix]) : this; // self }, applyTransform: function(matrix){ // summary: a shortcut for dojox.gfx.Shape.applyRightTransform // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, // virtual group methods removeShape: function(silently){ // summary: removes the shape from its parent's list of shapes // silently: Boolean?: if true, do not redraw a picture yet if(this.parent){ this.parent.remove(this, silently); } return this; // self }, _setParent: function(parent, matrix){ // summary: sets a parent // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parent = parent; return this._updateParentMatrix(matrix); // self }, _updateParentMatrix: function(matrix){ // summary: updates the parent matrix with new matrix // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self }, _getRealMatrix: function(){ // summary: returns the cumulative ("real") transformation matrix // by combining the shape's matrix with its parent's matrix var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D } }); dojox.gfx.shape._eventsProcessing = { connect: function(name, object, method){ // summary: connects a handler to an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return arguments.length > 2 ? // Object dojo.connect(this.getEventSource(), name, object, method) : dojo.connect(this.getEventSource(), name, object); }, disconnect: function(token){ // summary: connects a handler by token from an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! dojo.disconnect(token); } }; dojo.extend(dojox.gfx.Shape, dojox.gfx.shape._eventsProcessing); dojox.gfx.shape.Container = { // summary: a container of shapes, which can be used // as a foundation for renderer-specific groups, or as a way // to logically group shapes (e.g, to propagate matricies) _init: function() { // children: Array: a list of children this.children = [];";s:7:"private";b:1;s:7:"summary";s:0:"";}s:40:"dojox.gfx.shape.Container._init.children";a:4:{s:8:"instance";s:31:"dojox.gfx.shape.Container._init";s:4:"type";s:5:"Array";s:7:"summary";s:18:"a list of children";s:14:"private_parent";b:1;}s:29:"dojox.gfx.shape.Container.add";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"shape";a:2:{s:4:"type";s:15:"dojox.gfx.Shape";s:7:"summary";s:7:"a shape";}}s:6:"source";s:184:" var oldParent = shape.getParent(); if(oldParent){ oldParent.remove(shape, true); } this.children.push(shape); return shape._setParent(this, this._getRealMatrix()); // self";s:7:"summary";s:24:"adds a shape to the list";s:7:"returns";s:4:"self";}s:32:"dojox.gfx.shape.Container.remove";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"shape";a:1:{s:4:"type";s:0:"";}s:8:"silently";a:3:{s:4:"type";s:7:"Boolean";s:8:"optional";b:1;s:7:"summary";s:36:"if true, do not redraw a picture yet";}}s:6:"source";s:271:" for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ if(silently){ // skip for now }else{ shape.parent = null; shape.parentMatrix = null; } this.children.splice(i, 1); break; } } return this; // self";s:7:"summary";s:29:"removes a shape from the list";s:7:"returns";s:4:"self";}s:31:"dojox.gfx.shape.Container.clear";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:44:" this.children = []; return this; // self";s:7:"summary";s:39:"removes all shapes from a group/surface";s:7:"returns";s:4:"self";}s:40:"dojox.gfx.shape.Container.clear.children";a:2:{s:8:"instance";s:31:"dojox.gfx.shape.Container.clear";s:7:"summary";s:0:"";}s:43:"dojox.gfx.shape.Container._moveChildToFront";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"shape";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:188:" for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.push(shape); break; } } return this; // self";s:7:"summary";s:44:"moves a shape to front of the list of shapes";s:7:"returns";s:4:"self";s:7:"private";b:1;}s:42:"dojox.gfx.shape.Container._moveChildToBack";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"shape";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:191:" for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.unshift(shape); break; } } return this; // self";s:7:"summary";s:43:"moves a shape to back of the list of shapes";s:7:"returns";s:4:"self";s:7:"private";b:1;}s:23:"dojox.gfx.shape.Creator";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:14:"shape creators";}s:35:"dojox.gfx.shape.Creator.createShape";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"shape";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:25:"a shape descriptor object";}}s:6:"source";s:647:" var gfx = dojox.gfx; switch(shape.type){ case gfx.defaultPath.type: return this.createPath(shape); case gfx.defaultRect.type: return this.createRect(shape); case gfx.defaultCircle.type: return this.createCircle(shape); case gfx.defaultEllipse.type: return this.createEllipse(shape); case gfx.defaultLine.type: return this.createLine(shape); case gfx.defaultPolyline.type: return this.createPolyline(shape); case gfx.defaultImage.type: return this.createImage(shape); case gfx.defaultText.type: return this.createText(shape); case gfx.defaultTextPath.type: return this.createTextPath(shape); } return null;";s:7:"summary";s:86:"creates a shape object based on its type; it is meant to be used by group-like objects";}s:35:"dojox.gfx.shape.Creator.createGroup";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:63:" return this.createObject(dojox.gfx.Group); // dojox.gfx.Group";s:7:"summary";s:21:"creates a group shape";s:7:"returns";s:15:"dojox.gfx.Group";}s:34:"dojox.gfx.shape.Creator.createRect";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"rect";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:41:"a path object (see dojox.gfx.defaultRect)";}}s:6:"source";s:67:" return this.createObject(dojox.gfx.Rect, rect); // dojox.gfx.Rect";s:7:"summary";s:25:"creates a rectangle shape";s:7:"returns";s:14:"dojox.gfx.Rect";}s:37:"dojox.gfx.shape.Creator.createEllipse";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"ellipse";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:48:"an ellipse object (see dojox.gfx.defaultEllipse)";}}s:6:"source";s:76:" return this.createObject(dojox.gfx.Ellipse, ellipse); // dojox.gfx.Ellipse";s:7:"summary";s:24:"creates an ellipse shape";s:7:"returns";s:17:"dojox.gfx.Ellipse";}s:36:"dojox.gfx.shape.Creator.createCircle";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"circle";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:45:"a circle object (see dojox.gfx.defaultCircle)";}}s:6:"source";s:73:" return this.createObject(dojox.gfx.Circle, circle); // dojox.gfx.Circle";s:7:"summary";s:22:"creates a circle shape";s:7:"returns";s:16:"dojox.gfx.Circle";}s:34:"dojox.gfx.shape.Creator.createLine";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"line";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:41:"a line object (see dojox.gfx.defaultLine)";}}s:6:"source";s:67:" return this.createObject(dojox.gfx.Line, line); // dojox.gfx.Line";s:7:"summary";s:20:"creates a line shape";s:7:"returns";s:14:"dojox.gfx.Line";}s:38:"dojox.gfx.shape.Creator.createPolyline";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"points";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:69:"a points object (see dojox.gfx.defaultPolyline) or an Array of points";}}s:6:"source";s:77:" return this.createObject(dojox.gfx.Polyline, points); // dojox.gfx.Polyline";s:7:"summary";s:32:"creates a polyline/polygon shape";s:7:"returns";s:18:"dojox.gfx.Polyline";}s:35:"dojox.gfx.shape.Creator.createImage";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"image";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:44:"an image object (see dojox.gfx.defaultImage)";}}s:6:"source";s:70:" return this.createObject(dojox.gfx.Image, image); // dojox.gfx.Image";s:7:"summary";s:21:"creates a image shape";s:7:"returns";s:15:"dojox.gfx.Image";}s:34:"dojox.gfx.shape.Creator.createText";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"text";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:41:"a text object (see dojox.gfx.defaultText)";}}s:6:"source";s:67:" return this.createObject(dojox.gfx.Text, text); // dojox.gfx.Text";s:7:"summary";s:20:"creates a text shape";s:7:"returns";s:14:"dojox.gfx.Text";}s:34:"dojox.gfx.shape.Creator.createPath";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"path";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:41:"a path object (see dojox.gfx.defaultPath)";}}s:6:"source";s:67:" return this.createObject(dojox.gfx.Path, path); // dojox.gfx.Path";s:7:"summary";s:20:"creates a path shape";s:7:"returns";s:14:"dojox.gfx.Path";}s:38:"dojox.gfx.shape.Creator.createTextPath";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"text";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:49:"a textpath object (see dojox.gfx.defaultTextPath)";}}s:6:"source";s:87:" return this.createObject(dojox.gfx.TextPath, {}).setText(text); // dojox.gfx.TextPath";s:7:"summary";s:20:"creates a text shape";s:7:"returns";s:18:"dojox.gfx.TextPath";}s:36:"dojox.gfx.shape.Creator.createObject";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:9:"shapeType";a:2:{s:4:"type";s:8:"Function";s:7:"summary";s:44:"a class constructor to create an instance of";}s:8:"rawShape";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:22246:"dojo.provide("dojox.gfx.shape"); dojo.require("dojox.gfx._base"); dojo.declare("dojox.gfx.Shape", null, { // summary: a Shape object, which knows how to apply // graphical attributes and transformations constructor: function(){ // rawNode: Node: underlying node this.rawNode = null; // shape: Object: an abstract shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) this.shape = null; // matrix: dojox.gfx.Matrix2D: a transformation matrix this.matrix = null; // fillStyle: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) this.fillStyle = null; // strokeStyle: Object: a stroke object // (see dojox.gfx.defaultStroke) this.strokeStyle = null; // bbox: dojox.gfx.Rectangle: a bounding box of this shape // (see dojox.gfx.defaultRect) this.bbox = null; // virtual group structure // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) this.parent = null; // parentMatrix: dojox.gfx.Matrix2D // a transformation matrix inherited from the parent this.parentMatrix = null; }, // trivial getters getNode: function(){ // summary: returns the current DOM Node or null return this.rawNode; // Node }, getShape: function(){ // summary: returns the current shape object or null // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) return this.shape; // Object }, getTransform: function(){ // summary: returns the current transformation matrix or null return this.matrix; // dojox.gfx.Matrix2D }, getFill: function(){ // summary: returns the current fill object or null // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) return this.fillStyle; // Object }, getStroke: function(){ // summary: returns the current stroke object or null // (see dojox.gfx.defaultStroke) return this.strokeStyle; // Object }, getParent: function(){ // summary: returns the parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) return this.parent; // Object }, getBoundingBox: function(){ // summary: returns the bounding box or null // (see dojox.gfx.defaultRect) return this.bbox; // dojox.gfx.Rectangle }, getTransformedBoundingBox: function(){ // summary: returns an array of four points or null // four points represent four corners of the untransformed bounding box var b = this.getBoundingBox(); if(!b){ return null; // null } var m = this._getRealMatrix(); var r = []; var g = dojox.gfx.matrix; r.push(g.multiplyPoint(m, b.x, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y)); r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); r.push(g.multiplyPoint(m, b.x, b.y + b.height)); return r; // Array }, getEventSource: function(){ // summary: returns a Node, which is used as // a source of events for this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this.rawNode; // Node }, // empty settings setShape: function(shape){ // summary: sets a shape object // (the default implementation simply ignores it) // shape: Object: a shape object // (see dojox.gfx.defaultPath, // dojox.gfx.defaultPolyline, // dojox.gfx.defaultRect, // dojox.gfx.defaultEllipse, // dojox.gfx.defaultCircle, // dojox.gfx.defaultLine, // or dojox.gfx.defaultImage) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.shape = dojox.gfx.makeParameters(this.shape, shape); this.bbox = null; return this; // self }, setFill: function(fill){ // summary: sets a fill object // (the default implementation simply ignores it) // fill: Object: a fill object // (see dojox.gfx.defaultLinearGradient, // dojox.gfx.defaultRadialGradient, // dojox.gfx.defaultPattern, // or dojo.Color) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!fill){ // don't fill this.fillStyle = null; return this; // self } var f = null; if(typeof(fill) == "object" && "type" in fill){ // gradient or pattern switch(fill.type){ case "linear": f = dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient, fill); break; case "radial": f = dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient, fill); break; case "pattern": f = dojox.gfx.makeParameters(dojox.gfx.defaultPattern, fill); break; } }else{ // color object f = dojox.gfx.normalizeColor(fill); } this.fillStyle = f; return this; // self }, setStroke: function(stroke){ // summary: sets a stroke object // (the default implementation simply ignores it) // stroke: Object: a stroke object // (see dojox.gfx.defaultStroke) // COULD BE RE-IMPLEMENTED BY THE RENDERER! if(!stroke){ // don't stroke this.strokeStyle = null; return this; // self } // normalize the stroke if(typeof stroke == "string" || dojo.isArray(stroke) || stroke instanceof dojo.Color){ stroke = {color: stroke}; } var s = this.strokeStyle = dojox.gfx.makeParameters(dojox.gfx.defaultStroke, stroke); s.color = dojox.gfx.normalizeColor(s.color); return this; // self }, setTransform: function(matrix){ // summary: sets a transformation matrix // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) // COULD BE RE-IMPLEMENTED BY THE RENDERER! this.matrix = dojox.gfx.matrix.clone(matrix ? dojox.gfx.matrix.normalize(matrix) : dojox.gfx.matrix.identity); return this._applyTransform(); // self }, _applyTransform: function(){ // summary: physically sets a matrix // COULD BE RE-IMPLEMENTED BY THE RENDERER! return this; // self }, // z-index moveToFront: function(){ // summary: moves a shape to front of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToFront(this); this._moveToFront(); // execute renderer-specific action } return this; // self }, moveToBack: function(){ // summary: moves a shape to back of its parent's list of shapes var p = this.getParent(); if(p){ p._moveChildToBack(this); this._moveToBack(); // execute renderer-specific action } return this; }, _moveToFront: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, _moveToBack: function(){ // summary: renderer-specific hook, see dojox.gfx.shape.Shape.moveToFront() // COULD BE RE-IMPLEMENTED BY THE RENDERER! }, // apply left & right transformation applyRightTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on right side // (this.matrix * matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, applyLeftTransform: function(matrix){ // summary: multiplies the existing matrix with an argument on left side // (matrix * this.matrix) // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([matrix, this.matrix]) : this; // self }, applyTransform: function(matrix){ // summary: a shortcut for dojox.gfx.Shape.applyRightTransform // matrix: dojox.gfx.Matrix2D: a matrix or a matrix-like object // (see an argument of dojox.gfx.Matrix2D // constructor for a list of acceptable arguments) return matrix ? this.setTransform([this.matrix, matrix]) : this; // self }, // virtual group methods removeShape: function(silently){ // summary: removes the shape from its parent's list of shapes // silently: Boolean?: if true, do not redraw a picture yet if(this.parent){ this.parent.remove(this, silently); } return this; // self }, _setParent: function(parent, matrix){ // summary: sets a parent // parent: Object: a parent or null // (see dojox.gfx.Surface, // dojox.gfx.shape.VirtualGroup, // or dojox.gfx.Group) // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parent = parent; return this._updateParentMatrix(matrix); // self }, _updateParentMatrix: function(matrix){ // summary: updates the parent matrix with new matrix // matrix: dojox.gfx.Matrix2D: // a 2D matrix or a matrix-like object this.parentMatrix = matrix ? dojox.gfx.matrix.clone(matrix) : null; return this._applyTransform(); // self }, _getRealMatrix: function(){ // summary: returns the cumulative ("real") transformation matrix // by combining the shape's matrix with its parent's matrix var m = this.matrix; var p = this.parent; while(p){ if(p.matrix){ m = dojox.gfx.matrix.multiply(p.matrix, m); } p = p.parent; } return m; // dojox.gfx.Matrix2D } }); dojox.gfx.shape._eventsProcessing = { connect: function(name, object, method){ // summary: connects a handler to an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! return arguments.length > 2 ? // Object dojo.connect(this.getEventSource(), name, object, method) : dojo.connect(this.getEventSource(), name, object); }, disconnect: function(token){ // summary: connects a handler by token from an event on this shape // COULD BE RE-IMPLEMENTED BY THE RENDERER! dojo.disconnect(token); } }; dojo.extend(dojox.gfx.Shape, dojox.gfx.shape._eventsProcessing); dojox.gfx.shape.Container = { // summary: a container of shapes, which can be used // as a foundation for renderer-specific groups, or as a way // to logically group shapes (e.g, to propagate matricies) _init: function() { // children: Array: a list of children this.children = []; }, // group management add: function(shape){ // summary: adds a shape to the list // shape: dojox.gfx.Shape: a shape var oldParent = shape.getParent(); if(oldParent){ oldParent.remove(shape, true); } this.children.push(shape); return shape._setParent(this, this._getRealMatrix()); // self }, remove: function(shape, silently){ // summary: removes a shape from the list // silently: Boolean?: if true, do not redraw a picture yet for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ if(silently){ // skip for now }else{ shape.parent = null; shape.parentMatrix = null; } this.children.splice(i, 1); break; } } return this; // self }, clear: function(){ // summary: removes all shapes from a group/surface this.children = []; return this; // self }, // moving child nodes _moveChildToFront: function(shape){ // summary: moves a shape to front of the list of shapes for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.push(shape); break; } } return this; // self }, _moveChildToBack: function(shape){ // summary: moves a shape to back of the list of shapes for(var i = 0; i < this.children.length; ++i){ if(this.children[i] == shape){ this.children.splice(i, 1); this.children.unshift(shape); break; } } return this; // self } }; dojo.declare("dojox.gfx.shape.Surface", null, { // summary: a surface object to be used for drawings constructor: function(){ // underlying node this.rawNode = null; // the parent node this._parent = null; // the list of DOM nodes to be deleted in the case of destruction this._nodes = []; // the list of events to be detached in the case of destruction this._events = []; }, destroy: function(){ // summary: destroy all relevant external resources and release all // external references to make this object garbage-collectible dojo.forEach(this._nodes, dojo.destroy); this._nodes = []; dojo.forEach(this._events, dojo.disconnect); this._events = []; this.rawNode = null; // recycle it in _nodes, if it needs to be recycled if(dojo.isIE){ while(this._parent.lastChild){ dojo.destroy(this._parent.lastChild); } }else{ this._parent.innerHTML = ""; } this._parent = null; }, getEventSource: function(){ // summary: returns a node, which can be used to attach event listeners return this.rawNode; // Node }, _getRealMatrix: function(){ // summary: always returns the identity matrix return null; // dojox.gfx.Matrix2D }, isLoaded: true, onLoad: function(/*dojox.gfx.Surface*/ surface){ // summary: local event, fired once when the surface is created // asynchronously, used only when isLoaded is false, required // only for Silverlight. }, whenLoaded: function( /*Object?*/ context, /*Function|String*/ method ){ var f = dojo.hitch(context, method); if(this.isLoaded){ f(this); }else{ var h = dojo.connect(this, "onLoad", function(surface){ dojo.disconnect(h); f(surface); }); } } }); dojo.extend(dojox.gfx.shape.Surface, dojox.gfx.shape._eventsProcessing); dojo.declare("dojox.gfx.Point", null, { // summary: a hypothetical 2D point to be used for drawings - {x, y} // description: This object is defined for documentation purposes. // You should use the naked object instead: {x: 1, y: 2}. }); dojo.declare("dojox.gfx.Rectangle", null, { // summary: a hypothetical rectangle - {x, y, width, height} // description: This object is defined for documentation purposes. // You should use the naked object instead: {x: 1, y: 2, width: 100, height: 200}. }); dojo.declare("dojox.gfx.shape.Rect", dojox.gfx.Shape, { // summary: a generic rectangle constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Rect"); this.rawNode = rawNode; }, getBoundingBox: function(){ // summary: returns the bounding box (its shape in this case) return this.shape; // dojox.gfx.Rectangle } }); dojo.declare("dojox.gfx.shape.Ellipse", dojox.gfx.Shape, { // summary: a generic ellipse constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Ellipse"); this.rawNode = rawNode; }, getBoundingBox: function(){ // summary: returns the bounding box if(!this.bbox){ var shape = this.shape; this.bbox = {x: shape.cx - shape.rx, y: shape.cy - shape.ry, width: 2 * shape.rx, height: 2 * shape.ry}; } return this.bbox; // dojox.gfx.Rectangle } }); dojo.declare("dojox.gfx.shape.Circle", dojox.gfx.Shape, { // summary: a generic circle // (this is a helper object, which is defined for convenience) constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Circle"); this.rawNode = rawNode; }, getBoundingBox: function(){ // summary: returns the bounding box if(!this.bbox){ var shape = this.shape; this.bbox = {x: shape.cx - shape.r, y: shape.cy - shape.r, width: 2 * shape.r, height: 2 * shape.r}; } return this.bbox; // dojox.gfx.Rectangle } }); dojo.declare("dojox.gfx.shape.Line", dojox.gfx.Shape, { // summary: a generic line // (this is a helper object, which is defined for convenience) constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Line"); this.rawNode = rawNode; }, getBoundingBox: function(){ // summary: returns the bounding box if(!this.bbox){ var shape = this.shape; this.bbox = { x: Math.min(shape.x1, shape.x2), y: Math.min(shape.y1, shape.y2), width: Math.abs(shape.x2 - shape.x1), height: Math.abs(shape.y2 - shape.y1) }; } return this.bbox; // dojox.gfx.Rectangle } }); dojo.declare("dojox.gfx.shape.Polyline", dojox.gfx.Shape, { // summary: a generic polyline/polygon // (this is a helper object, which is defined for convenience) constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Polyline"); this.rawNode = rawNode; }, setShape: function(points, closed){ // summary: sets a polyline/polygon shape object // points: Object: a polyline/polygon shape object // closed: Boolean: close the polyline to make a polygon if(points && points instanceof Array){ // points: Array: an array of points dojox.gfx.Shape.prototype.setShape.call(this, {points: points}); if(closed && this.shape.points.length){ this.shape.points.push(this.shape.points[0]); } }else{ dojox.gfx.Shape.prototype.setShape.call(this, points); } return this; // self }, getBoundingBox: function(){ // summary: returns the bounding box if(!this.bbox && this.shape.points.length){ var p = this.shape.points; var l = p.length; var t = p[0]; var bbox = {l: t.x, t: t.y, r: t.x, b: t.y}; for(var i = 1; i < l; ++i){ t = p[i]; if(bbox.l > t.x) bbox.l = t.x; if(bbox.r < t.x) bbox.r = t.x; if(bbox.t > t.y) bbox.t = t.y; if(bbox.b < t.y) bbox.b = t.y; } this.bbox = { x: bbox.l, y: bbox.t, width: bbox.r - bbox.l, height: bbox.b - bbox.t }; } return this.bbox; // dojox.gfx.Rectangle } }); dojo.declare("dojox.gfx.shape.Image", dojox.gfx.Shape, { // summary: a generic image // (this is a helper object, which is defined for convenience) constructor: function(rawNode){ // rawNode: Node: a DOM Node this.shape = dojox.gfx.getDefault("Image"); this.rawNode = rawNode; }, getBoundingBox: function(){ // summary: returns the bounding box (its shape in this case) return this.shape; // dojox.gfx.Rectangle }, setStroke: function(){ // summary: ignore setting a stroke style return this; // self }, setFill: function(){ // summary: ignore setting a fill style return this; // self } }); dojo.declare("dojox.gfx.shape.Text", dojox.gfx.Shape, { // summary: a generic text constructor: function(rawNode){ // rawNode: Node: a DOM Node this.fontStyle = null; this.shape = dojox.gfx.getDefault("Text"); this.rawNode = rawNode; }, getFont: function(){ // summary: returns the current font object or null return this.fontStyle; // Object }, setFont: function(newFont){ // summary: sets a font for text // newFont: Object: a font object (see dojox.gfx.defaultFont) or a font string this.fontStyle = typeof newFont == "string" ? dojox.gfx.splitFontString(newFont) : dojox.gfx.makeParameters(dojox.gfx.defaultFont, newFont); this._setFont(); return this; // self } }); dojox.gfx.shape.Creator = { // summary: shape creators createShape: function(shape){ // summary: creates a shape object based on its type; it is meant to be used // by group-like objects // shape: Object: a shape descriptor object var gfx = dojox.gfx; switch(shape.type){ case gfx.defaultPath.type: return this.createPath(shape); case gfx.defaultRect.type: return this.createRect(shape); case gfx.defaultCircle.type: return this.createCircle(shape); case gfx.defaultEllipse.type: return this.createEllipse(shape); case gfx.defaultLine.type: return this.createLine(shape); case gfx.defaultPolyline.type: return this.createPolyline(shape); case gfx.defaultImage.type: return this.createImage(shape); case gfx.defaultText.type: return this.createText(shape); case gfx.defaultTextPath.type: return this.createTextPath(shape); } return null; }, createGroup: function(){ // summary: creates a group shape return this.createObject(dojox.gfx.Group); // dojox.gfx.Group }, createRect: function(rect){ // summary: creates a rectangle shape // rect: Object: a path object (see dojox.gfx.defaultRect) return this.createObject(dojox.gfx.Rect, rect); // dojox.gfx.Rect }, createEllipse: function(ellipse){ // summary: creates an ellipse shape // ellipse: Object: an ellipse object (see dojox.gfx.defaultEllipse) return this.createObject(dojox.gfx.Ellipse, ellipse); // dojox.gfx.Ellipse }, createCircle: function(circle){ // summary: creates a circle shape // circle: Object: a circle object (see dojox.gfx.defaultCircle) return this.createObject(dojox.gfx.Circle, circle); // dojox.gfx.Circle }, createLine: function(line){ // summary: creates a line shape // line: Object: a line object (see dojox.gfx.defaultLine) return this.createObject(dojox.gfx.Line, line); // dojox.gfx.Line }, createPolyline: function(points){ // summary: creates a polyline/polygon shape // points: Object: a points object (see dojox.gfx.defaultPolyline) // or an Array of points return this.createObject(dojox.gfx.Polyline, points); // dojox.gfx.Polyline }, createImage: function(image){ // summary: creates a image shape // image: Object: an image object (see dojox.gfx.defaultImage) return this.createObject(dojox.gfx.Image, image); // dojox.gfx.Image }, createText: function(text){ // summary: creates a text shape // text: Object: a text object (see dojox.gfx.defaultText) return this.createObject(dojox.gfx.Text, text); // dojox.gfx.Text }, createPath: function(path){ // summary: creates a path shape // path: Object: a path object (see dojox.gfx.defaultPath) return this.createObject(dojox.gfx.Path, path); // dojox.gfx.Path }, createTextPath: function(text){ // summary: creates a text shape // text: Object: a textpath object (see dojox.gfx.defaultTextPath) return this.createObject(dojox.gfx.TextPath, {}).setText(text); // dojox.gfx.TextPath }, createObject: function(shapeType, rawShape){ // summary: creates an instance of the passed shapeType class // shapeType: Function: a class constructor to create an instance of // rawShape: Object: properties to be passed in to the classes "setShape" method // SHOULD BE RE-IMPLEMENTED BY THE RENDERER! return null; // dojox.gfx.Shape";s:7:"summary";s:49:"creates an instance of the passed shapeType class";s:7:"returns";s:247:"Node|Object|dojox.gfx.Matrix2D|dojox.gfx.Rectangle|null|Array|self|dojox.gfx.Group|dojox.gfx.Rect|dojox.gfx.Ellipse|dojox.gfx.Circle|dojox.gfx.Line|dojox.gfx.Polyline|dojox.gfx.Image|dojox.gfx.Text|dojox.gfx.Path|dojox.gfx.TextPath|dojox.gfx.Shape";}s:15:"dojox.gfx.shape";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:9:"dojox.gfx";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}