]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojox/charting/Element.js
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojox / charting / Element.js
1 if(!dojo._hasResource["dojox.charting.Element"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.charting.Element"] = true;
3 dojo.provide("dojox.charting.Element");
4
5 dojo.declare("dojox.charting.Element", null, {
6         constructor: function(chart){
7                 this.chart = chart;
8                 this.group = null;
9                 this.htmlElements = [];
10                 this.dirty = true;
11         },
12         createGroup: function(creator){
13                 if(!creator){ creator = this.chart.surface; }
14                 if(!this.group){
15                         this.group = creator.createGroup();
16                 }
17                 return this;
18         },
19         purgeGroup: function(){
20                 this.destroyHtmlElements();
21                 if(this.group){
22                         this.group.clear();
23                         this.group.removeShape();
24                         this.group = null;
25                 }
26                 this.dirty = true;
27                 return this;
28         },
29         cleanGroup: function(creator){
30                 this.destroyHtmlElements();
31                 if(!creator){ creator = this.chart.surface; }
32                 if(this.group){
33                         this.group.clear();
34                 }else{
35                         this.group = creator.createGroup();
36                 }
37                 this.dirty = true;
38                 return this;
39         },
40         destroyHtmlElements: function(){
41                 dojo.forEach(this.htmlElements, dojo._destroyElement);
42                 this.htmlElements = [];
43         },
44         destroy: function(){
45                 this.purgeGroup();
46         }
47 });
48
49 }