研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly >blockRendering >ConstantProvider >shapeFor
blockRendering.ConstantProvider.shapeFor() 方法
根据连接类型获取包含连接形状和尺寸信息的对象。
Signature:
shapeFor(connection: RenderedConnection): Shape;
参数
参数 |
类型 |
说明 |
连接 |
RenderedConnection |
为其查找形状对象的连接 |
返回:
形状
连接的形状对象。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-28。
[null,null,["最后更新时间 (UTC):2025-07-28。"],[[["\u003cp\u003eThe \u003ccode\u003eblockRendering.ConstantProvider.shapeFor()\u003c/code\u003e method retrieves the shape and size information for a given connection on a block.\u003c/p\u003e\n"],["\u003cp\u003eThis method accepts a \u003ccode\u003eRenderedConnection\u003c/code\u003e object as input, representing the connection in question.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a \u003ccode\u003eShape\u003c/code\u003e object containing the relevant shape and sizing details for the specified connection.\u003c/p\u003e\n"]]],["The `shapeFor()` method, part of `blockRendering.ConstantProvider`, retrieves shape and sizing data for a given connection. It accepts a `RenderedConnection` as input and returns a `Shape` object. This `Shape` object contains details about the connection's appearance, determined by its type. The method's primary action is mapping a connection to its corresponding visual representation, facilitating block rendering.\n"],null,["[blockly](./blockly.md) \\\u003e [blockRendering](./blockly.blockrendering_namespace.md) \\\u003e [ConstantProvider](./blockly.blockrendering_namespace.constantprovider_class.md) \\\u003e [shapeFor](./blockly.blockrendering_namespace.constantprovider_class.shapefor_1_method.md)\n\nblockRendering.ConstantProvider.shapeFor() method\n-------------------------------------------------\n\nGet an object with connection shape and sizing information based on the type of the connection.\n\n**Signature:** \n\n shapeFor(connection: RenderedConnection): Shape;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|------------|--------------------|-------------------------------------------|\n| connection | RenderedConnection | The connection to find a shape object for |\n\n**Returns:**\n\nShape\n\nThe shape object for the connection."]]