Constructs an event handler that creates handles for the selection cells.
Reference to the enclosing AbstractGraph.
If live preview is allowed on this system.
Specifies if cloning by control-drag is enabled.
Specifies if drop events are interpreted as new connections if no other drop action is defined.
Stores the x-coordinate of the current mouse move.
Stores the y-coordinate of the current mouse move.
Specifies if events are handled.
Reference to the enclosing AbstractGraph.
Holds the Guide instance that is used for alignment.
Specifies if other cells should be used for snapping the right, center or left side of the current selection.
Whether the handles of the selection are currently visible.
Specifies if drop targets under the mouse should be enabled.
Specifies if the graph container should be used for preview. If this is used then drop target detection relies entirely on AbstractGraph.getCellAt because the HTML preview does not "let events through".
Defines the maximum number of cells to paint sub-handles for.
Set this to 0 if you want an unlimited number of handles to be displayed.
This is only recommended if the number of cells in the graph is limited to a small number, e.g. 500.
Maximum number of cells for which live preview should be used.
0 means no live preview.
Specifies the minimum number of pixels for the width and height of a selection border.
Specifies if moving is enabled.
Specifies the color of the preview shape.
Specifies if cells may be moved out of their parents.
If empty parents should be removed from the model after all child cells have been moved out.
Specifies if the bounding box should allow for rotation.
Specifies if the grid should be scaled.
Specifies if the view should be scrolled so that a moved cell is visible.
Specifies if selecting is enabled.
Reference to the Shape that represents the preview.
Specifies if a move cursor should be shown if the mouse is over a movable cell.
Static ReadonlypluginUpdates the preview if cloning state has changed.
Consumes the given mouse event.
NOTE: This may be used to enable click events for links in labels on iOS as follows as consuming the initial touchStart disables firing the subsequent click event on the link.
consumeMouseEvent(evtName, me) {
const source = eventUtils.getSource(me.getEvent());
if (!eventUtils.isTouchEvent(me.getEvent()) || source.nodeName != 'A') {
me.consume();
}
}
Creates the shape used to draw the preview for the given bounds.
Destroy the preview and highlight shapes.
Returns the union of the CellStates for the given array of Cells.
For vertices, this method uses the bounding box of the corresponding shape if one exists. The bounding box of the corresponding text label and all controls and overlays are ignored. See also: GraphView#getBounds and AbstractGraph.getBoundingBox.
Returns the cells to be modified by this handler.
This implementation returns all selection cells that are movable, or the given initial cell if the given cell is not selected and movable. This handles the case of moving unselectable or unselected cells.
Creates an array of cell states which should be used as guides.
Returns cloneEnabled.
Hook to return true for delayed selections.
Returns enabled.
Returns moveEnabled.
Returns true if the given cell and parent should propagate selection state to the parent.
Returns removeCellsFromParent.
Returns selectEnabled.
Returns true if the given cell is a valid drop target.
Handles the event by selecting the given cell and creating a handle for it. By consuming the event all subsequent events of the gesture are redirected to this handler.
Handles the event by highlighting possible drop targets and updating the preview.
Handles the event by applying the changes to the selection cells.
Destroys the handler and all its resources and DOM nodes.
Hooks for subclassers to hide details when the handler gets inactive.
Resets the state of this handler.
Resets the live preview.
Resumes the live preview.
Hook for rounding the unscaled vector. This uses Math.round and keep only 2 digits.
Selects the given cell for the given MouseEvent.
Implements the delayed selection for the given mouse event.
Sets cloneEnabled.
Boolean that specifies the new clone enabled state.
Sets the color of the rectangle used to highlight drop targets.
String that represents the new highlight color.
Returns true if the given parent should be removed after removal of child cells.
Suspends the live preview.
Hook for subclassers do show details while the handler is active.
Optionalme: InternalMouseEventUpdates the bounds of the preview shape.
Updates the bounds of the preview shape.
Updates the bounds of the preview shape.
Returns true if the guides should be used for the given MouseEvent. This implementation returns Guide#isEnabledForEvent.
Graph event handler that handles selection.
Individual cells are handled separately by SelectionCellsHandler using VertexHandler or one of the EdgeHandlers. When the SelectionCellsHandler plugin is registered in the AbstractGraph, SelectionHandler interacts with this plugin to propagate global selection events to individual cells.
To avoid the container to scroll a moved cell into view, set scrollOnMove to
false.