SelectionFrameList
SelectionFrameList
is an interface for collection of selection frames. It is used by the Selection
to render the frames.
It is not intended for direct use, but could be extended to create custom lists of selection frames.
There are several built-in implementations of the SelectionFrameList
:
- OverlaySelectionFrameList
- SVGSelectionFrameList
- HTMLSelectionFrameList
- HighlighterSelectionFrameList
Methodsβ
add()β
add(cell: dia.Cell): void;
Add a selection frame around the cell.
clear()β
clear(): void;
Remove all selection frames from the list.
count()β
count(): number;
Get the number of selection frames in the list.
destroy()β
destroy(): void;
Remove all selection frames from the list and clean up the resources. It's called when the selection is destroyed.
getCellBBox()β
getCellBBox(cell: dia.Cell): dia.BBox;
Get the bounding box of the selection frame around the cell.
The default implementation returns the rotated model bounding box.
(cell) => cell.getBBox({ rotate: true })
getBBox()β
getBBox(): dia.BBox;
Get the bounding box of all selection frames in the list.
The default implementation returns the union of all cell bounding boxes.
initialize()β
initialize(): void;
The method is called when the selection is initialized.
paperβ
readonly paper: dia.Paper;
The paper the selection is rendered on.
translate()β
translate(tx: number, ty: number): void;
A method that is called when the cells are being translated. It is meant to be used when an optimization is needed (as opposed to calling update() which could be more expensive).
If you do not override this method, the default implementation will call update().
remove()β
remove(cell: dia.Cell): void;
Remove the selection frame around the cell.
selectionβ
readonly selection: ui.Selection;
The selection the frames are associated with.
setSelection()β
setSelection(selection: ui.Selection): void;
Set the selection the frames are associated with.
update()β
update(): void;
Update the selection frames. It's called when the cells change.