コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >IMetricsManager >getContentMetrics
IMetricsManager.getContentMetrics() メソッド
ピクセル座標またはワークスペース座標でコンテンツ指標を取得します。コンテンツ領域は、ワークスペース上のすべての上限付きの要素(ワークスペースのコメントとブロック)を囲む長方形です。
署名:
getContentMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion;
パラメータ
パラメータ |
型 |
説明 |
opt_getWorkspaceCoordinates |
ブール値 |
(省略可)コンテンツの指標をワークスペース座標で取得する場合は true、ピクセル座標で取得する場合は false に設定します。 |
戻り値:
ContainerRegion
コンテンツ コンテナの指標。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-25 UTC。"],[],["The `getContentMetrics()` method retrieves content metrics, representing a rectangle around all top-level elements (blocks and comments) on the workspace. It accepts an optional boolean parameter, `opt_getWorkspaceCoordinates`. When `true`, it returns metrics in workspace coordinates; when `false` or omitted, it returns metrics in pixel coordinates. The method's output is a `ContainerRegion` object, containing the content container's metrics.\n"]]