diff --git a/core/block_svg.js b/core/block_svg.js index cc8a5f6c8..57b793be5 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -32,7 +32,7 @@ goog.require('Blockly.utils.dom'); goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Rect'); -goog.requireType('Blockly.IBoundingBox'); +goog.requireType('Blockly.IBoundedElement'); goog.requireType('Blockly.ICopyable'); /** @@ -44,7 +44,7 @@ goog.requireType('Blockly.ICopyable'); * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new ID. * @extends {Blockly.Block} - * @implements {Blockly.IBoundingBox} + * @implements {Blockly.IBoundedElement} * @implements {Blockly.ICopyable} * @constructor */ diff --git a/core/interfaces/i_bounding_box.js b/core/interfaces/i_bounded_element.js similarity index 52% rename from core/interfaces/i_bounding_box.js rename to core/interfaces/i_bounded_element.js index 790aefbee..34b72fb32 100644 --- a/core/interfaces/i_bounding_box.js +++ b/core/interfaces/i_bounded_element.js @@ -5,27 +5,27 @@ */ /** - * @fileoverview The interface for a bounding box. + * @fileoverview The interface for a bounded element. * @author samelh@google.com (Sam El-Husseini) */ 'use strict'; -goog.provide('Blockly.IBoundingBox'); +goog.provide('Blockly.IBoundedElement'); goog.requireType('Blockly.utils.Rect'); /** - * A bounding box interface. + * A bounded element interface. * @interface */ -Blockly.IBoundingBox = function() {}; +Blockly.IBoundedElement = function() {}; /** - * Returns the coordinates of a bounding box describing the dimensions of this + * Returns the coordinates of a bounded element describing the dimensions of the * element. * Coordinate system: workspace coordinates. - * @return {!Blockly.utils.Rect} Object with coordinates of the bounding box. + * @return {!Blockly.utils.Rect} Object with coordinates of the bounded element. */ -Blockly.IBoundingBox.prototype.getBoundingRectangle; +Blockly.IBoundedElement.prototype.getBoundingRectangle; diff --git a/core/workspace_comment_svg.js b/core/workspace_comment_svg.js index 0926c73a5..4190074ba 100644 --- a/core/workspace_comment_svg.js +++ b/core/workspace_comment_svg.js @@ -25,7 +25,7 @@ goog.require('Blockly.utils.object'); goog.require('Blockly.utils.Rect'); goog.require('Blockly.WorkspaceComment'); -goog.requireType('Blockly.IBoundingBox'); +goog.requireType('Blockly.IBoundedElement'); goog.requireType('Blockly.ICopyable'); /** @@ -37,7 +37,7 @@ goog.requireType('Blockly.ICopyable'); * @param {string=} opt_id Optional ID. Use this ID if provided, otherwise * create a new ID. * @extends {Blockly.WorkspaceComment} - * @implements {Blockly.IBoundingBox} + * @implements {Blockly.IBoundedElement} * @implements {Blockly.ICopyable} * @constructor */ diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 4f4f87da2..bfd1057de 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -39,7 +39,7 @@ goog.require('Blockly.WorkspaceDragSurfaceSvg'); goog.require('Blockly.Xml'); goog.requireType('Blockly.blockRendering.Renderer'); -goog.requireType('Blockly.IBoundingBox'); +goog.requireType('Blockly.IBoundedElement'); /** @@ -170,11 +170,11 @@ Blockly.WorkspaceSvg = function(options, this.keyboardAccessibilityMode = false; /** - * The list of top-level bounding boxes on the workspace. - * @type {!Array.} + * The list of top-level bounded elements on the workspace. + * @type {!Array.} * @private */ - this.topBoundingBoxes_ = []; + this.topBoundedElements_ = []; }; Blockly.utils.object.inherits(Blockly.WorkspaceSvg, Blockly.Workspace); @@ -1621,7 +1621,7 @@ Blockly.WorkspaceSvg.prototype.onMouseWheel_ = function(e) { * bounding box containing the blocks on the workspace. */ Blockly.WorkspaceSvg.prototype.getBlocksBoundingBox = function() { - var topElements = this.getTopBoundingBoxes(); + var topElements = this.getTopBoundedElements(); // There are no blocks, return empty rectangle. if (!topElements.length) { return new Blockly.utils.Rect(0, 0, 0, 0); @@ -2497,7 +2497,7 @@ Blockly.WorkspaceSvg.prototype.getTopBlocks = function(ordered) { * @param {!Blockly.Block} block Block to add. */ Blockly.WorkspaceSvg.prototype.addTopBlock = function(block) { - this.addTopBoundingBox(/** @type {!Blockly.BlockSvg} */ (block)); + this.addTopBoundedElement(/** @type {!Blockly.BlockSvg} */ (block)); Blockly.WorkspaceSvg.superClass_.addTopBlock.call(this, block); }; @@ -2506,7 +2506,7 @@ Blockly.WorkspaceSvg.prototype.addTopBlock = function(block) { * @param {!Blockly.Block} block Block to remove. */ Blockly.WorkspaceSvg.prototype.removeTopBlock = function(block) { - this.removeTopBoundingBox(/** @type {!Blockly.BlockSvg} */ (block)); + this.removeTopBoundedElement(/** @type {!Blockly.BlockSvg} */ (block)); Blockly.WorkspaceSvg.superClass_.removeTopBlock.call(this, block); }; @@ -2515,7 +2515,7 @@ Blockly.WorkspaceSvg.prototype.removeTopBlock = function(block) { * @param {!Blockly.WorkspaceComment} comment comment to add. */ Blockly.WorkspaceSvg.prototype.addTopComment = function(comment) { - this.addTopBoundingBox( + this.addTopBoundedElement( /** @type {!Blockly.WorkspaceCommentSvg} */ (comment)); Blockly.WorkspaceSvg.superClass_.addTopComment.call(this, comment); }; @@ -2525,33 +2525,33 @@ Blockly.WorkspaceSvg.prototype.addTopComment = function(comment) { * @param {!Blockly.WorkspaceComment} comment comment to remove. */ Blockly.WorkspaceSvg.prototype.removeTopComment = function(comment) { - this.removeTopBoundingBox( + this.removeTopBoundedElement( /** @type {!Blockly.WorkspaceCommentSvg} */ (comment)); Blockly.WorkspaceSvg.superClass_.removeTopComment.call(this, comment); }; /** - * Adds a bounding box to the list of top bounding boxes. - * @param {!Blockly.IBoundingBox} element Bounding box to add. + * Adds a bounded element to the list of top bounded elements. + * @param {!Blockly.IBoundedElement} element Bounded element to add. */ -Blockly.WorkspaceSvg.prototype.addTopBoundingBox = function(element) { - this.topBoundingBoxes_.push(element); +Blockly.WorkspaceSvg.prototype.addTopBoundedElement = function(element) { + this.topBoundedElements_.push(element); }; /** - * Removes a bounding box from the list of top bounding boxes. - * @param {!Blockly.IBoundingBox} element Bounding box to remove. + * Removes a bounded element from the list of top bounded elements. + * @param {!Blockly.IBoundedElement} element Bounded element to remove. */ -Blockly.WorkspaceSvg.prototype.removeTopBoundingBox = function(element) { - Blockly.utils.arrayRemove(this.topBoundingBoxes_, element); +Blockly.WorkspaceSvg.prototype.removeTopBoundedElement = function(element) { + Blockly.utils.arrayRemove(this.topBoundedElements_, element); }; /** - * Finds the top-level bounding box and returns them. - * @return {!Array.} The top-level bounding boxes. + * Finds the top-level bounded elements and returns them. + * @return {!Array.} The top-level bounded elements. */ -Blockly.WorkspaceSvg.prototype.getTopBoundingBoxes = function() { - return [].concat(this.topBoundingBoxes_); +Blockly.WorkspaceSvg.prototype.getTopBoundedElements = function() { + return [].concat(this.topBoundedElements_); }; /** @@ -2576,7 +2576,7 @@ Blockly.WorkspaceSvg.prototype.setResizesEnabled = function(enabled) { Blockly.WorkspaceSvg.prototype.clear = function() { this.setResizesEnabled(false); Blockly.WorkspaceSvg.superClass_.clear.call(this); - this.topBoundingBoxes_ = []; + this.topBoundedElements_ = []; this.setResizesEnabled(true); };