_Plugin.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // wrapped by build app
  2. define("dojox/drawing/plugins/_Plugin", ["dijit","dojo","dojox"], function(dijit,dojo,dojox){
  3. dojo.provide("dojox.drawing.plugins._Plugin");
  4. dojox.drawing.plugins._Plugin = dojox.drawing.util.oo.declare(
  5. // summary:
  6. // Base class for plugins.
  7. // description:
  8. // When creating a plugin, use this class as the
  9. // base to ensure full functionality.
  10. function(options){
  11. this._cons = [];
  12. dojo.mixin(this, options);
  13. if(this.button && this.onClick){
  14. this.connect(this.button, "onClick", this, "onClick")
  15. }
  16. },
  17. {
  18. util:null,
  19. keys:null,
  20. mouse:null,
  21. drawing:null,
  22. stencils:null,
  23. anchors:null,
  24. canvas:null,
  25. node:null,
  26. button:null,//gfx button
  27. type:"dojox.drawing.plugins._Plugin",
  28. connect: function(){
  29. this._cons.push(dojo.connect.apply(dojo, arguments));
  30. },
  31. disconnect: function(/*handle | Array*/handles){
  32. // summary:
  33. // Removes connections based on passed
  34. // handles arguments
  35. if(!handles){ return };
  36. if(!dojo.isArray(handles)){ handles=[handles]; }
  37. dojo.forEach(handles, dojo.disconnect, dojo);
  38. }
  39. }
  40. );
  41. });