F5_函数执行顺序.docx_第1页
F5_函数执行顺序.docx_第2页
F5_函数执行顺序.docx_第3页
F5_函数执行顺序.docx_第4页
F5_函数执行顺序.docx_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

function Algorithm(am)alert(function Algorithm(am);BST.prototype.constructor = BST;BST.superclass = Atotype;function init()alert(function init();var animManag = initCanvas();currentAlg = new BST(animManag, canvas.width, canvas.height);function BST(am, w, h)alert(function BST(am, w, h);this.init(am, w, h);BST.prototype.init = function(am, w, h)alert(BST.prototype.init = function(am, w, h);var sc = BST.superclass;this.startingX = w / 2;this.first_print_pos_y = h - 2 * BST.PRINT_VERTICAL_GAP;this.print_max = w - 10;var fn = sc.init;fn.call(this,am);this.addControls();this.nextIndex = 0;mands = ;this.cmd(CreateLabel, 0, , 20, 10, 0);this.nextIndex = 1;this.animationManager.StartNewAnimation(mands);this.animationManager.skipForward();this.animationManager.clearHistory();BST.prototype.addControls = function()alert(BST.prototype.addControls = function();this.insertField = addControlToAlgorithmBar(Text, );this.insertField.onkeydown = this.returnSubmit(this.insertField, this.insertCallback.bind(this), 4);this.insertButton = addControlToAlgorithmBar(Button, Insert);this.insertButton.onclick = this.insertCallback.bind(this);this.deleteField = addControlToAlgorithmBar(Text, );this.deleteField.onkeydown = this.returnSubmit(this.deleteField, this.deleteCallback.bind(this), 4);this.deleteButton = addControlToAlgorithmBar(Button, Delete);this.deleteButton.onclick = this.deleteCallback.bind(this);this.findField = addControlToAlgorithmBar(Text, );this.findField.onkeydown = this.returnSubmit(this.findField, this.findCallback.bind(this), 4);this.findButton = addControlToAlgorithmBar(Button, Find);this.findButton.onclick = this.findCallback.bind(this);this.printButton = addControlToAlgorithmBar(Button, Print);this.printButton.onclick = this.printCallback.bind(this);function addControlToAlgorithmBar(type, name) alert(function addControlToAlgorithmBar(type, name); var element = document.createElement(input); element.setAttribute(type, type); element.setAttribute(value, name); element.setAttribute(name, name);var tableEntry = document.createElement(td);tableEntry.appendChild(element); var controlBar = document.getElementById(AlgorithmSpecificControls); /Append the element in page (in span). controlBar.appendChild(tableEntry);return element;Atotype.returnSubmit = function(field, funct, maxsize, intOnly)alert(Atotype.returnSubmit = function(field, funct, maxsize, intOnly);if (maxsize != undefined)field.size = maxsize;return function(event)var keyASCII = 0;if(window.event) / IEkeyASCII = event.keyCodeelse if (event.which) / Netscape/Firefox/OperakeyASCII = event.which if (keyASCII = 13)funct();else if (keyASCII = 59 )return false;else if (maxsize != undefined & field.value.length = maxsize) | intOnly & (keyASCII 57)if (!controlKey(keyASCII)return false;function addControlToAlgorithmBar(type, name) alert(function addControlToAlgorithmBar(type, name); var element = document.createElement(input); element.setAttribute(type, type); element.setAttribute(value, name); element.setAttribute(name, name);var tableEntry = document.createElement(td);tableEntry.appendChild(element); var controlBar = document.getElementById(AlgorithmSpecificControls); /Append the element in page (in span). controlBar.appendChild(tableEntry);return element;.Atotype.cmd = function()alert(Jinx the cmd function);if (this.recordAnimation)var command = arguments0;for(i = 1; i arguments.length; i+)command = command + + String(argumentsi);mands.push(command);BST.prototype.disableUI = function(event)alert(BST.prototype.disableUI = function(event);this.insertField.disabled = true;this.insertButton.disabled = true;this.deleteField.disabled = true;this.deleteButton.disabled = true;this.findField.disabled = true;this.findButton.disabled = true;this.printButton.disabled = true;BST.prototype.enableUI = function(event)alert(BST.prototype.enableUI = function(event);this.insertField.disabled = f

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论