mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Split classes from core/renderers/zelos/measurables/rows.js into multiple files
This commit is contained in:
60
core/renderers/zelos/measurables/bottom_row.js
Normal file
60
core/renderers/zelos/measurables/bottom_row.js
Normal file
@@ -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;
|
||||
};
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user