source: Dev/trunk/src/client/dojox/drawing/manager/StencilUI.js @ 529

Last change on this file since 529 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.7 KB
Line 
1define(["dojo", "../util/oo"],//, "../defaults"],
2function(dojo, oo){
3        var surface, surfaceNode;
4        //dojox.drawing.manager.StencilUI =
5        return oo.declare(
6                function(options){
7
8                        // TODO: mixin props
9
10                        surface = options.surface;
11                        this.canvas = options.canvas;
12                       
13                        //this.defaults = defaults.copy();
14                        this.mouse = options.mouse;
15                        this.keys = options.keys;
16                        this._mouseHandle = this.mouse.register(this);
17                        this.stencils = {};
18                },
19                {
20                        // summary:
21                        //              Used for handling Stencils as UI components.
22                        // description:
23                        //              Replaces manager.Stencil. Handles basic UI mouse
24                        //              events like onmouseover. Does not handle selections
25                        //              or support delete, etc.
26
27                        register: function(/*Object*/stencil){
28                                this.stencils[stencil.id] = stencil;
29                                return stencil;
30                        },
31                        onUiDown: function(/*EventObject*/obj){
32                                // summary:
33                                //              Event fired on mousedown on a stencil
34
35                                if(!this._isStencil(obj)){ return; }
36                                this.stencils[obj.id].onDown(obj);
37                        },
38                        onUiUp: function(/*EventObject*/obj){
39                                // summary:
40                                //              Event fired on mousedown on a stencil
41
42                                if(!this._isStencil(obj)){ return; }
43                                this.stencils[obj.id].onUp(obj);
44                        },
45                        onOver: function(/*EventObject*/obj){
46                                // summary:
47                                //              Event fired on mousedown on a stencil
48
49                                if(!this._isStencil(obj)){ return; }
50                                this.stencils[obj.id].onOver(obj);
51                        },
52                        onOut: function(/*EventObject*/obj){
53                                // summary:
54                                //              Event fired on mousedown on a stencil
55
56                                if(!this._isStencil(obj)){ return; }
57                                this.stencils[obj.id].onOut(obj);
58                        },
59                        _isStencil: function(/*EventObject*/obj){
60                                return !!obj.id && !!this.stencils[obj.id] && this.stencils[obj.id].type == "drawing.library.UI.Button";
61                        }
62                }
63        );
64       
65});
Note: See TracBrowser for help on using the repository browser.