diff --git a/core/renderers/zelos/measurables/bottom_row.js b/core/renderers/zelos/measurables/bottom_row.js new file mode 100644 index 000000000..16aa4c86e --- /dev/null +++ b/core/renderers/zelos/measurables/bottom_row.js @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview An object representing the bottom row of a rendered block. + * @author samelh@google.com (Sam El-Husseini) + */ +'use strict'; + +goog.provide('Blockly.zelos.BottomRow'); + +goog.require('Blockly.blockRendering.BottomRow'); +goog.require('Blockly.utils.object'); + +goog.requireType('Blockly.blockRendering.ConstantProvider'); + + +/** + * An object containing information about what elements are in the bottom row of + * a block as well as spacing information for the top row. + * Elements in a bottom row can consist of corners, spacers and next + * connections. + * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * constants provider. + * @package + * @constructor + * @extends {Blockly.blockRendering.BottomRow} + */ +Blockly.zelos.BottomRow = function(constants) { + Blockly.zelos.BottomRow.superClass_.constructor.call(this, constants); +}; +Blockly.utils.object.inherits(Blockly.zelos.BottomRow, + Blockly.blockRendering.BottomRow); + +/** + * @override + */ +Blockly.zelos.BottomRow.prototype.endsWithElemSpacer = function() { + return false; +}; + +/** + * Render a round corner unless the block has an output connection. + * @override + */ +Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner = function(block) { + return !!block.outputConnection; +}; + +/** + * Render a round corner unless the block has an output connection. + * @override + */ +Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(block) { + return !!block.outputConnection && !block.statementInputCount && + !block.nextConnection; +}; diff --git a/core/renderers/zelos/measurables/rows.js b/core/renderers/zelos/measurables/top_row.js similarity index 56% rename from core/renderers/zelos/measurables/rows.js rename to core/renderers/zelos/measurables/top_row.js index 305d11087..a1817801a 100644 --- a/core/renderers/zelos/measurables/rows.js +++ b/core/renderers/zelos/measurables/top_row.js @@ -5,16 +5,13 @@ */ /** - * @fileoverview An object representing a single row on a rendered block and all - * of its subcomponents. + * @fileoverview An object representing the top row of a rendered block. * @author samelh@google.com (Sam El-Husseini) */ 'use strict'; -goog.provide('Blockly.zelos.BottomRow'); goog.provide('Blockly.zelos.TopRow'); -goog.require('Blockly.blockRendering.BottomRow'); goog.require('Blockly.blockRendering.TopRow'); goog.require('Blockly.utils.object'); @@ -66,44 +63,3 @@ Blockly.zelos.TopRow.prototype.hasRightSquareCorner = function(block) { return !!block.outputConnection && !block.statementInputCount && !block.nextConnection; }; - -/** - * An object containing information about what elements are in the bottom row of - * a block as well as spacing information for the top row. - * Elements in a bottom row can consist of corners, spacers and next - * connections. - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering - * constants provider. - * @package - * @constructor - * @extends {Blockly.blockRendering.BottomRow} - */ -Blockly.zelos.BottomRow = function(constants) { - Blockly.zelos.BottomRow.superClass_.constructor.call(this, constants); -}; -Blockly.utils.object.inherits(Blockly.zelos.BottomRow, - Blockly.blockRendering.BottomRow); - -/** - * @override - */ -Blockly.zelos.BottomRow.prototype.endsWithElemSpacer = function() { - return false; -}; - -/** - * Render a round corner unless the block has an output connection. - * @override - */ -Blockly.zelos.BottomRow.prototype.hasLeftSquareCorner = function(block) { - return !!block.outputConnection; -}; - -/** - * Render a round corner unless the block has an output connection. - * @override - */ -Blockly.zelos.BottomRow.prototype.hasRightSquareCorner = function(block) { - return !!block.outputConnection && !block.statementInputCount && - !block.nextConnection; -}; diff --git a/tests/deps.js b/tests/deps.js index d59ccc233..940499b52 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -181,9 +181,10 @@ goog.addDependency('../../core/renderers/zelos/constants.js', ['Blockly.zelos.Co goog.addDependency('../../core/renderers/zelos/drawer.js', ['Blockly.zelos.Drawer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Drawer', 'Blockly.utils.object', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/zelos/info.js', ['Blockly.zelos.RenderInfo'], ['Blockly.FieldImage', 'Blockly.FieldLabel', 'Blockly.FieldTextInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.constants', 'Blockly.inputTypes', 'Blockly.utils.object', 'Blockly.zelos.BottomRow', 'Blockly.zelos.RightConnectionShape', 'Blockly.zelos.TopRow'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/zelos/marker_svg.js', ['Blockly.zelos.MarkerSvg'], ['Blockly.blockRendering.MarkerSvg', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../core/renderers/zelos/measurables/bottom_row.js', ['Blockly.zelos.BottomRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.utils.object']); goog.addDependency('../../core/renderers/zelos/measurables/inputs.js', ['Blockly.zelos.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object']); goog.addDependency('../../core/renderers/zelos/measurables/row_elements.js', ['Blockly.zelos.RightConnectionShape'], ['Blockly.blockRendering.Measurable', 'Blockly.blockRendering.Types', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/renderers/zelos/measurables/rows.js', ['Blockly.zelos.BottomRow', 'Blockly.zelos.TopRow'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.TopRow', 'Blockly.utils.object']); +goog.addDependency('../../core/renderers/zelos/measurables/top_row.js', ['Blockly.zelos.TopRow'], ['Blockly.blockRendering.TopRow', 'Blockly.utils.object']); goog.addDependency('../../core/renderers/zelos/path_object.js', ['Blockly.zelos.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/zelos/renderer.js', ['Blockly.zelos.Renderer'], ['Blockly.InsertionMarkerManager', 'Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.connectionTypes', 'Blockly.utils.object', 'Blockly.zelos.ConstantProvider', 'Blockly.zelos.Drawer', 'Blockly.zelos.MarkerSvg', 'Blockly.zelos.PathObject', 'Blockly.zelos.RenderInfo'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/requires.js', ['Blockly.requires'], ['Blockly', 'Blockly.Comment', 'Blockly.ContextMenuItems', 'Blockly.FieldAngle', 'Blockly.FieldCheckbox', 'Blockly.FieldColour', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldLabelSerializable', 'Blockly.FieldMultilineInput', 'Blockly.FieldNumber', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.FlyoutButton', 'Blockly.Generator', 'Blockly.HorizontalFlyout', 'Blockly.Mutator', 'Blockly.ShortcutItems', 'Blockly.Themes.Classic', 'Blockly.Toolbox', 'Blockly.Trashcan', 'Blockly.VariablesDynamic', 'Blockly.VerticalFlyout', 'Blockly.Warning', 'Blockly.ZoomControls', 'Blockly.geras.Renderer', 'Blockly.thrasos.Renderer', 'Blockly.zelos.Renderer']);