// Generated by CoffeeScript 1.10.0 (function() { var CurrentTool, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; global(CurrentTool = (function(superClass) { extend(CurrentTool, superClass); function CurrentTool(conf) { this.get = bind(this.get, this); this.set = bind(this.set, this); CurrentTool.__super__.constructor.call(this, { events: ['change'] }); this.graph = conf.graph; this.view = conf.view; } CurrentTool.prototype.set = function(name) { if (name !== this.tool_name) { this.tool_name = name; if (this.tool != null) { this.tool.destroy(); } this.tool = new window[this.tool_name + 'Tool']({ graph: this.graph, view: this.view }); this.trigger('change'); } return this; }; CurrentTool.prototype.get = function() { return this.tool_name; }; return CurrentTool; })(EventSource)); }).call(this);