bubbles.Bubble class
The abstract pop-up bubble class. This creates a UI that looks like a speech bubble, where it has a "tail" that points to the block, and a "head" that displays arbitrary svg elements.
Signature:
export declare abstract class Bubble implements IBubble, ISelectable, IFocusableNode
Implements: IBubble, ISelectable, IFocusableNode
Constructors
Constructor | Modifiers | Description |
|---|---|---|
(constructor)(workspace, anchor, ownerRect, overriddenFocusableElement, owner) | Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| (not declared) | Distance between arrow point and anchor point. | |
| |||
| (not declared) | The width of the border around the bubble. | |
| SVGGElement | The SVG group containing the contents of the bubble. | |
boolean | True if the bubble has been disposed, false otherwise. | ||
| number | Double the width of the border around the bubble. | |
string | |||
| number | The minimum size the bubble can have. | |
| (IHasBubble & IFocusableNode) | undefined | (Optional) | |
| Rect | undefined | (Optional) | |
| SVGGElement | The SVG group containing all parts of the bubble. | |
| (not declared) | The number of degrees that the tail bends counter-clockwise. | |
| (not declared) | The sharpness of the tail's bend. Higher numbers result in smoother tails. | |
| (not declared) | The thickness of the base of the tail in relation to the size of the bubble. Higher numbers result in thinner tails. | |
|
Methods
Method | Modifiers | Description |
|---|---|---|
See IFocusableNode.canBeFocused. | ||
Dispose of this bubble. | ||
Drags the bubble to the given location. | ||
Ends the drag on the bubble. | ||
| Returns the colour of the background and tail of this bubble. | |
See IFocusableNode.getFocusableElement. | ||
See IFocusableNode.getFocusableTree. | ||
Returns the object that owns/hosts this bubble, if any. | ||
| ||
Returns whether this bubble is movable or not. | ||
| Handles key events when this bubble is focused. By default, closes the bubble on Escape. | |
See IFocusableNode.onNodeBlur. | ||
See IFocusableNode.onNodeFocus. | ||
| Positions the bubble "optimally" so that the most of it is visible and it does not overlap the rect (if provided). | |
| Positions the bubble relative to its anchor. Does not render its tail. | |
Moves the bubble back to where it was at the start of a drag. | ||
Set the location the tail of this bubble points to. | ||
Sets the colour of the background and tail of this bubble. | ||
Sets the position of this bubble relative to its anchor. | ||
| Sets the size of this bubble, including the border. | |
Starts a drag on the bubble. | ||