dojox/sketch/Toolbar.js

  • Provides:

    • dojox.sketch.Toolbar
  • Requires:

    • dojox.sketch.Annotation in common
    • dijit.Toolbar in common in project dijit
    • dijit.form.Button in common in project dijit
  • dojox.sketch.ButtonGroup

    • type
      Function
    • source: [view]
        this._childMaps={};
        this._children=[];
    • summary
  • dojox.sketch.ButtonGroup.add

    • type
      Function
    • parameters:
      • plugin: (typeof _Plugin)
    • source: [view]
        this._childMaps[plugin]=plugin.connect(plugin,'onActivate',dojo.hitch(this,'_resetGroup',plugin));
        this._children.push(plugin);
    • summary
  • dojox.sketch.ButtonGroup._resetGroup

    • type
      Function
    • parameters:
      • p: (typeof )
    • source: [view]
        var cs=this._children;
        dojo.forEach(cs,function(c){
         if(p!=c && c['attr']){
          c.attr('checked',false);
         }
        });
    • summary
  • dojox.sketch.ButtonGroup._childMaps

    • summary
  • dojox.sketch.ButtonGroup._children

    • summary
  • dojox.sketch.Toolbar

    • type
      Function
    • chains:
      • dijit.Toolbar: (prototype)
      • dijit.Toolbar: (call)
    • summary
  • dojox.sketch.Toolbar.figure

    • summary
  • dojox.sketch.Toolbar.plugins

    • summary
  • dojox.sketch.Toolbar.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this.shapeGroup=new dojox.sketch.ButtonGroup;


        if(!this.plugins){
         this.plugins=['Lead','SingleArrow','DoubleArrow','Underline','Preexisting','Slider'];
        }
        this._plugins=[];


        dojo.forEach(this.plugins,function(obj){
         var name=dojo.isString(obj)?obj:obj.name;
         var p=new dojox.sketch.tools[name](obj.args||{});
         this._plugins.push(p);
         p.setToolbar(this);
         if(!this._defaultTool && p.button){
          this._defaultTool=p;
         }
        },this);
    • summary
  • dojox.sketch.Toolbar.setFigure

    • type
      Function
    • parameters:
      • f: (typeof )
    • source: [view]
        this.figure = f;
        this.connect(f,'onLoad','reset');
        dojo.forEach(this._plugins, function(p){
         p.setFigure(f);
        });
    • summary
  • dojox.sketch.Toolbar.destroy

    • type
      Function
    • source: [view]
        dojo.forEach(this._plugins,function(p){
         p.destroy();
        });
        this.inherited(arguments);
        delete this._defaultTool;
        delete this._plugins;
    • summary
  • dojox.sketch.Toolbar.addGroupItem

    • type
      Function
    • parameters:
      • item: (typeof _Plugin)
      • group: (typeof )
    • source: [view]
        if(group!='toolsGroup'){
         console.error('not supported group '+group);
         return;
        }


        this.shapeGroup.add(item);
    • summary
  • dojox.sketch.Toolbar.reset

    • type
      Function
    • source: [view]
        this._defaultTool.activate();
    • summary
  • dojox.sketch.Toolbar._setShape

    • type
      Function
    • parameters:
      • s: (typeof )
    • source: [view]
        if(!this.figure.surface) return;
        // now do the action.
        if(this.figure.hasSelections()){
         for(var i=0; i    var before=this.figure.selected[i].serialize();
          this.figure.convert(this.figure.selected[i], s);
          this.figure.history.add(dojox.sketch.CommandTypes.Convert, this.figure.selected[i], before);
         }
        }
    • summary
  • dojox.sketch.Toolbar.shapeGroup

    • summary
  • dojox.sketch.Toolbar._plugins

    • summary
  • dojox.sketch.Toolbar._defaultTool

    • summary
  • dojox.sketch.makeToolbar

    • type
      Function
    • parameters:
      • node: (typeof )
      • figure: (typeof )
    • source: [view]
       var toolbar=new dojox.sketch.Toolbar();
       toolbar.setFigure(figure);
       node.appendChild(toolbar.domNode);
       return toolbar;
    • summary
  • dojox.sketch

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary