با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
blockly > blockRendering > Renderer
کلاس blockRendering.Renderer
کلاس پایه برای رندر بلوک.
امضا:
export declare class Renderer implements IRegistrable
پیاده سازی: IRegistrable
سازندگان
سازنده | اصلاح کننده ها | توضیحات |
---|
(سازنده) (نام) | | یک نمونه جدید از کلاس Renderer می سازد |
خواص
اموال | اصلاح کننده ها | تایپ کنید | توضیحات |
---|
ثابت_ | protected | ConstantProvider | ارائه دهنده ثابت رندر. |
نام | protected | رشته | |
لغو می کند | protected | شی | تهی | رندر نادیده گرفتن ثابت، از طریق گزینه ها منتقل می شود. |
روش ها
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe \u003ccode\u003eblockRendering.Renderer\u003c/code\u003e class serves as the foundation for rendering blocks in Blockly, managing their visual representation and interactions.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods for initialization, disposal, refreshing the display based on themes, and creating supporting components like drawers and render info objects.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eblockRendering.Renderer\u003c/code\u003e provides functionalities for handling connection previews and highlighting, allowing for interactive block connections.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can extend this base class to create custom renderers with unique block styles and behaviors using properties such as \u003ccode\u003econstants_\u003c/code\u003e and \u003ccode\u003eoverrides\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [blockRendering](./blockly.blockrendering_namespace.md) \\\u003e [Renderer](./blockly.blockrendering_namespace.renderer_class.md)\n\nblockRendering.Renderer class\n-----------------------------\n\nThe base class for a block renderer.\n\n**Signature:** \n\n export declare class Renderer implements IRegistrable \n\n**Implements:** [IRegistrable](./blockly.iregistrable_interface.md)\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|---------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------|\n| [(constructor)(name)](./blockly.blockrendering_namespace.renderer_class._constructor__1_constructor.md) | | Constructs a new instance of the `Renderer` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|----------------------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------------|----------------------------------------------------------|\n| [constants_](./blockly.blockrendering_namespace.renderer_class.constants__property.md) | `protected` | [ConstantProvider](./blockly.blockrendering_namespace.constantprovider_class.md) | The renderer's constant provider. |\n| [name](./blockly.blockrendering_namespace.renderer_class.name_property.md) | `protected` | string | |\n| [overrides](./blockly.blockrendering_namespace.renderer_class.overrides_property.md) | `protected` | object \\| null | Rendering constant overrides, passed in through options. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|------------------------------------------------------------------------------------------------------------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [dispose()](./blockly.blockrendering_namespace.renderer_class.dispose_1_method.md) | | Dispose of this renderer. Delete all DOM elements that this renderer and its constants created. |\n| [getClassName()](./blockly.blockrendering_namespace.renderer_class.getclassname_1_method.md) | | Gets the class name that identifies this renderer. |\n| [getConstants()](./blockly.blockrendering_namespace.renderer_class.getconstants_1_method.md) | | Get the current renderer's constant provider. We assume that when this is called, the renderer has already been initialized. |\n| [init(theme, opt_rendererOverrides)](./blockly.blockrendering_namespace.renderer_class.init_1_method.md) | | Initialize the renderer. |\n| [makeConstants_()](./blockly.blockrendering_namespace.renderer_class.makeconstants__1_method.md) | `protected` | Create a new instance of the renderer's constant provider. |\n| [makeDrawer_(block, info)](./blockly.blockrendering_namespace.renderer_class.makedrawer__1_method.md) | `protected` | Create a new instance of the renderer's drawer. |\n| [makePathObject(root, style)](./blockly.blockrendering_namespace.renderer_class.makepathobject_1_method.md) | | Create a new instance of a renderer path object. |\n| [makeRenderInfo_(block)](./blockly.blockrendering_namespace.renderer_class.makerenderinfo__1_method.md) | `protected` | Create a new instance of the renderer's render info object. |\n| [orphanCanConnectAtEnd(topBlock, orphanBlock, localType)](./blockly.blockrendering_namespace.renderer_class.orphancanconnectatend_1_method.md) | `protected` | Checks if an orphaned block can connect to the \"end\" of the topBlock's block-clump. If the clump is a row the end is the last input. If the clump is a stack, the end is the last next connection. If the clump is neither, then this returns false. |\n| [refreshDom(svg, theme, injectionDivIfIsParent)](./blockly.blockrendering_namespace.renderer_class.refreshdom_1_method.md) | | Refresh the renderer after a theme change. |\n| [shouldHighlightConnection(_conn)](./blockly.blockrendering_namespace.renderer_class.shouldhighlightconnection_1_method.md) | | Determine whether or not to highlight a connection. |"]]