Skip to main content

Home > @jsplumbtoolkit/connector-editors > EditorBase

EditorBase class#

Signature:

export declare abstract class EditorBase<ConnectorType extends AbstractConnector> implements ConnectorEditor 

Implements: ConnectorEditor

Constructors#

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the EditorBase class

Properties#

PropertyModifiersTypeDescription
_surfaceSurface
activeboolean
cleanup() => void
currentConnection
currentConnectorConnectorType
currentEdgeEdge
currentOverlaysArray<any>
currentSourceVertexVertex
currentTargetVertexVertex
eventManagerEventManager
jsplumbBrowserJsPlumbInstance
sourceAnchorPlaceholderElement
sourceDimensionsany
targetAnchorPlaceholderElement
targetDimensionsany
update() => void

Methods#

MethodModifiersDescription
_activate(surface, conn, params)
_addDragHandler(o)
_clearGeometry()
_clearHandles()
_elementDragged(p)
_elementDragging(p)
_repaint(args)
_setElementPosition(el, x, y)
_update()
activate(surface, connection, params)Activate the editor, with the given Connection. First we call deactivate, so there's only ever one edit happening at a time. Then we set the current connection, and override its paint method.
deactivate(e)Deactivates the editor, removing all editor handles and anchor placeholders etc.
fireConnectionEditEvent()Fires a connection edit event, passing the current connection, and the current connection's exported geometry.
isActive()
refresh(args)Redraw anchor placeholders and editor handles.
repaintConnection(args)Repaints the current connection, passing some arguments, optionally. These are retrieved inside refresh, and are ultimately handed off to the subclass's repaint method. Subclasses should call this on things like handle dragging, as the existence (and nature of ) args can subsequently be used by their repaint method to decide whether or not to redraw all the handles (such as you would in the event of an external paint event), or just to reposition the existing ones. During a drag, of course, blowing away the current handle would be bad.
reset()