Stay organized with collections
Save and categorize content based on your preferences.
blockly > blockRendering > PathObject > setClass_
blockRendering.PathObject.setClass_() method
Add or remove the given CSS class on the path object's root SVG element.
Signature:
protected setClass_(className: string, add: boolean): void;
Parameters
Parameter |
Type |
Description |
className |
string |
The name of the class to add or remove |
add |
boolean |
True if the class should be added. False if it should be removed. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `blockRendering.PathObject.setClass_()` method allows you to dynamically add or remove CSS classes on a path object's root SVG element."],["This method accepts two parameters: `className` (string) specifying the class name and `add` (boolean) indicating whether to add or remove the class."],["Utilizing this method enables you to control the styling and appearance of path objects within Blockly's block rendering system."]]],["The `setClass_()` method of the `PathObject` in the `blockRendering` namespace adds or removes a CSS class on the root SVG element. It takes two parameters: `className` (the class name) and `add` (a boolean indicating whether to add or remove the class). If `add` is true, the class is added; if false, it's removed. This method returns void.\n"]]