dojox/drawing/tools/custom/Vector.js

  • Provides:

    • dojox.drawing.tools.custom.Vector
  • Requires:

    • dojox.drawing.tools.Arrow in common
    • dojox.drawing.util.positioning in common
  • d

    • type
      Object
    • summary
  • d.cx

    • summary
  • d.cy

    • summary
  • d.rx

    • summary
  • d.ry

    • summary
  • obj

    • type
      Object
    • summary
  • obj.start

    • summary
  • obj.y

    • summary
  • this.data

    • type
      Object
    • summary
  • this.data.x1

    • summary
  • this.data.y1

    • summary
  • this.data.x2

    • summary
  • this.data.y2

    • summary
  • this.data.cosphi

    • summary
  • o

    • type
      Object
    • summary
  • o.x1

    • summary
  • o.y1

    • summary
  • o.x2

    • summary
  • o.y2

    • summary
  • o.cosphi

    • summary
  • dojox.drawing.tools.custom.Vector.setup

    • type
      Object
    • summary
      See stencil._Base ToolsSetup
  • dojox.drawing.tools.custom.Vector.setup.name

    • summary
  • dojox.drawing.tools.custom.Vector.setup.tooltip

    • summary
  • dojox.drawing.tools.custom.Vector.setup.iconClass

    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary

    • type
      Object
    • summary
      Creates a secondary tool for the Vector Stencil.
    • description
      See Toolbar.js makeButtons function.  The toolbar
      checks Vector.setup for a secondary tool and requires
      name, label, and funct.  Currently it doesn't accept icon
      and only uses text from label for the button.  Funct is the
      function that fires when the button is clicked.
      
      Setup and postSetup are optional
      and allow tool specific functions to be added to the
      Toolbar object as if they were written there.
  • dojox.drawing.tools.custom.Vector.setup.secondary.name

    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.label

    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.funct

    • type
      Function
    • parameters:
      • button: (typeof )
    • source: [view]
         button.selected ? this.zDeselect(button) : this.zSelect(button);

         
         var stencils = this.drawing.stencils.selectedStencils;
         for(var nm in stencils){
          if(stencils[nm].shortType == "vector" && (stencils[nm].style.zAxis != dojox.drawing.defaults.zAxis)){
           var s = stencils[nm];
           s.changeAxis();
           //Reset anchors
           if(s.style.zAxis){ s.deselect(); s.select(); }
          }
         }
    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup

    • type
      Function
    • source: [view]
         var zAxis = dojox.drawing.defaults.zAxis;
         this.zSelect = function(button){
          if(!button.enabled){ return; }
          zAxis = true;
          dojox.drawing.defaults.zAxis = true;
          button.select();
          this.vectorTest();
          this.zSelected = button;
         };
         this.zDeselect = function(button){
          if(!button.enabled){ return; }
          zAxis = false;
          dojox.drawing.defaults.zAxis = false;
          button.deselect();
          this.vectorTest();
          this.zSelected = null;
         };
         this.vectorTest = function(){
          dojo.forEach(this.buttons, function(b){
           if(b.toolType=="vector" && b.selected){
            this.drawing.currentStencil.style.zAxis = zAxis;
           }
          },this);
         };
         dojo.connect(this, "onRenderStencil", this, function(){ if(this.zSelected){ this.zDeselect(this.zSelected)}});
         var c = dojo.connect(this.drawing, "onSurfaceReady", this, function(){
          dojo.disconnect(c);
          dojo.connect(this.drawing.stencils, "onSelect", this, function(stencil){
           if(stencil.shortType == "vector"){
            if(stencil.style.zAxis){
             //If stencil is on the z-axis, update button to reflect that
             dojo.forEach(this.buttons, function(b){
              if(b.toolType=="vectorSecondary"){
               this.zSelect(b);
              }
             },this);

             
            }else{
             //Update button to not be z-axis
             dojo.forEach(this.buttons, function(b){
              if(b.toolType=="vectorSecondary"){
               this.zDeselect(b);
              }
             },this);
            }
           };
          });
         });
    • summary
      All functions, variables and connections defined here
      are treated as if they were added directly to toolbar.
      They are included with the tool because secondary buttons
      are tool specific.
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup.zSelect

    • type
      Function
    • parameters:
      • button: (typeof )
    • source: [view]
          if(!button.enabled){ return; }
          zAxis = true;
          dojox.drawing.defaults.zAxis = true;
          button.select();
          this.vectorTest();
          this.zSelected = button;
    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup.zSelected

    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup.zDeselect

    • type
      Function
    • parameters:
      • button: (typeof )
    • source: [view]
          if(!button.enabled){ return; }
          zAxis = false;
          dojox.drawing.defaults.zAxis = false;
          button.deselect();
          this.vectorTest();
          this.zSelected = null;
    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup.vectorTest

    • type
      Function
    • source: [view]
          dojo.forEach(this.buttons, function(b){
           if(b.toolType=="vector" && b.selected){
            this.drawing.currentStencil.style.zAxis = zAxis;
           }
          },this);
    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.setup.drawing.currentStencil.style.zAxis

    • summary
  • dojox.drawing.tools.custom.Vector.setup.secondary.postSetup

    • type
      Function
    • parameters:
      • btn: (typeof )
    • source: [view]
         dojo.connect(btn, "enable", function(){ dojox.drawing.defaults.zAxisEnabled = true; });
         dojo.connect(btn, "disable", function(){ dojox.drawing.defaults.zAxisEnabled = false; });
    • summary
      Depending on the secondary tool, it may need
      extra functionality for some of the basic functions.
      Post is passed the button so those connections can
      be made.
  • dojox.drawing.tools.custom.Vector

    • summary
  • this.minimumSize

    • summary
  • cosphi

    • summary
  • this.style.zAxis

    • summary
  • p

    • summary
  • pt

    • summary
  • s

    • summary
  • f

    • summary
  • x1

    • summary
  • y1

    • summary
  • x2

    • summary
  • y2

    • summary
  • dx

    • summary
  • dy

    • summary
  • pts

    • summary
  • radians

    • summary
  • test

    • summary
  • radius

    • summary
  • angle

    • summary
  • this.points

    • summary
  • this._downOnCanvas

    • summary
  • obj.start.x

    • summary
  • this.renderedOnce

    • summary
  • dojox.drawing.tools.custom

    • type
      Object
    • summary
  • dojox.drawing.tools

    • type
      Object
    • summary
  • dojox.drawing

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary