tracking-code-which-will-go-to-the-HEAD DragComponentAction

Class

DragComponentAction

DragComponentAction(pluginData, viewport, layout)

Action to drag component.
Constructor

# new DragComponentAction(pluginData, viewport, layout)

Default constructor.
Parameters:
Name Type Description
pluginData DefaultData Plugin data storage.
viewport object D3 selection of the view port.
layout DefaultLayout Layout to organise components.

View Source draw/action/DragComponentAction.js, line 6

Members

boolean

# isInit

Whether the action is initialized or not.

View Source draw/action/DragComponentAction.js, line 20

Methods

# dropInWorkflow(event, sources, target) → {boolean}

Drop component into workflow container.
Parameters:
Name Type Description
event object The event containing the target information.
sources Array.<Component> Sources to drop.
target Component Target container.

View Source draw/action/DragComponentAction.js, line 185

Need to call draw at the end.
boolean

# dropOnScene(event, sources) → {boolean}

Drop components on scene, remove referenced parent attribute.
Parameters:
Name Type Description
event object The event containing the target information.
sources Array.<Component> Sources to drop.

View Source draw/action/DragComponentAction.js, line 83

Need to redraw only if sources have container.
boolean

# dropOnTarget(event, sources, target) → {boolean}

Drop components into container.
Parameters:
Name Type Description
event object The event containing the target information.
sources Array.<Component> Sources to drop.
target Component Target container.

View Source draw/action/DragComponentAction.js, line 135

Redraw only if source can be dropped on target.
boolean

# execute(event) → {boolean}

Update position of sources element.
Parameters:
Name Type Description
event object The event containing the target information.

View Source draw/action/DragComponentAction.js, line 28

No need to redraw because, element is directly updated.
boolean

# finalize(event) → {boolean}

Update component position and update parent of component if needed.
Parameters:
Name Type Description
event object The event containing the target information.

View Source draw/action/DragComponentAction.js, line 61

Need to call draw at the end.
boolean

# getParentTypes(sources) → {Array.<string>}

Get all parent types that the sources have in common.
Parameters:
Name Type Description
sources Array.<string> Component ids list.

View Source draw/action/DragComponentAction.js, line 253

Parent types list.
Array.<string>