bubbles.Bubble 類別
抽象彈出式氣泡類別。這會建立類似對話框的 UI,其中的「尾端」會指向區塊,「頭部」則會顯示任意 SVG 元素。
Signature:
export declare abstract class Bubble implements IBubble, ISelectable
實作: IBubble、ISelectable
建構函式
| 建構函式 | 修飾符 | 說明 |
|---|---|---|
| (constructor)(workspace, anchor, ownerRect, overriddenFocusableElement) | 建構 Bubble 類別的新例項 |
屬性
| 屬性 | 修飾符 | 類型 | 說明 |
|---|---|---|---|
| ANCHOR_RADIUS |
|
(未宣告) | 箭頭點和錨點之間的距離。 |
| anchor | protected |
座標 | |
| BORDER_WIDTH |
|
(未宣告) | 泡泡周圍邊框的寬度。 |
| contentContainer | protected |
SVGGElement | 包含氣泡內容的 SVG 群組。 |
| disposed | 布林值 | 如果已處置氣泡,則傳回「是」;否則傳回「否」。 | |
| DOUBLE_BORDER |
|
數字 | 將泡泡周圍的邊框寬度加倍。 |
| id | 字串 | ||
| MIN_SIZE |
|
數字 | 泡泡的最小尺寸。 |
| ownerRect? | protected |
Rect | undefined | (選用) |
| svgRoot | protected |
SVGGElement | 包含氣泡所有部分的 SVG 群組。 |
| TAIL_ANGLE |
|
(未宣告) | 尾巴逆時針彎曲的角度數值。 |
| TAIL_BEND |
|
(未宣告) | 尾巴彎曲的銳利度。數字越大,尾巴就越平滑。 |
| TAIL_THICKNESS |
|
(未宣告) | 尾巴底部的厚度相對於泡泡的大小。數字越高,尾端就越窄。 |
| workspace | readonly |
WorkspaceSvg |
方法
| 方法 | 修飾符 | 說明 |
|---|---|---|
| canBeFocused() | 請參閱 IFocusableNode.canBeFocused。 | |
| dispose() | Dispose 這個對話方塊。 | |
| drag(newLoc) | 將氣泡拖曳至指定位置。 | |
| endDrag() | 結束對氣泡的拖曳動作。 | |
| getColour() | protected |
傳回此氣泡的背景和尾巴顏色。 |
| getFocusableElement() | 請參閱 IFocusableNode.getFocusableElement。 | |
| getFocusableTree() | 請參閱 IFocusableNode.getFocusableTree。 | |
| getSize() | protected |
|
| isMovable() | 傳回此氣泡是否可移動。 | |
| onNodeBlur() | 請參閱 IFocusableNode.onNodeBlur。 | |
| onNodeFocus() | 請參閱 IFocusableNode.onNodeFocus。 | |
| positionByRect(rect) | protected |
將氣泡置於「最佳」位置,讓大部分內容都顯示在畫面上,且不會與矩形 (如有提供) 重疊。 |
| positionRelativeToAnchor() | protected |
將氣泡置於相對於錨點的位置。不會算繪尾巴。 |
| revertDrag() | 將氣泡移回拖曳開始時的位置。 | |
| select() | ||
| setAnchorLocation(anchor, relayout) | 設定這個氣泡尾端指向的位置。 | |
| setColour(colour) | 設定此氣泡的背景和尾巴顏色。 | |
| setDragging(_start) | ||
| setPositionRelativeToAnchor(left, top) | 設定此氣泡相對於錨點的位置。 | |
| setSize(size, relayout) | protected |
設定這個氣泡的大小,包括邊框。 |
| startDrag() | 開始拖曳氣泡。 | |
| unselect() |