RelationModule Class
Manage relation rendering and events.
Emitted events:
- clearState: clear all possible states that the environment view can be in as it pertains to actions (building a relation, viewing a service menu, etc.)
- hideServiceMenu: hide the service menu after the 'Add Relation' item was clicked.
- fade: fade services that are not valid endpoints for a pending relation.
- show: show faded services at 100% opacity again.
- resized: ensure that menus are positioned properly.
Item Index
Methods
Methods
action Hides the dialog on click.
-
e
Parameters:
-
eObjectThe click event.
Returns:
clearState
()
Undefined
Clear any states such as building a relation or showing subordinate relations.
Returns:
decorateRelations
-
relations
Parameters:
-
relationsArrayThe relations currently in effect.
Returns:
events.scene.add-relation.click
()
The user clicked on the "Build Relation" menu item.
events.scene.dragline.click
()
The user clicked while the dragline was active.
hideSubordinateRelations
()
Undefined
Hide subordinate relations.
Returns:
mousemove
-
d -
self
If the mouse moves and we are adding a relation, then the dragline needs to be updated.
Parameters:
-
dObjectUnused.
-
selfObjectThe environment view itself.
Returns:
mouseMoveHandler
-
evt
Handler for when the mouse is moved over a service.
Parameters:
-
evtObjectEvent facade.
Returns:
showSubordinateRelations
-
subordinate
Show subordinate relations for a service.
Parameters:
-
subordinateObjectThe sub-rel-block g element in the form of a DOM node.
Returns:
startRelation
-
service
An "add relation" action has been initiated by the user.
Parameters:
-
serviceObjectThe service that is the source of the relation.
Returns:
subRelBlockClick
-
d -
self
Toggle the visibility of subordinate relations for visibility or removal.
Parameters:
-
dObjectThe data-bound object (the subordinate).
-
selfObjectThe view.
updateLinkEndpoints
-
evt
Update relation line endpoints for a given service.
Parameters:
-
evtObjectThe event facade that was fired. This should have a 'service' property mixed in when fired.
Events
addRelationDrag
Ensure the dragline follows the cursor when moved.
addRelationDragEnd
Complete adding a relation when dragging to create it.
Event Payload:
-
boxObjectThe starting service's BoxModel.
addRelationDragStart
Begin the process of adding a relation when dragging to create it.
Event Payload:
-
boxObjectThe ending service's BoxModel.
cancelRelationBuild
Cancel building a relation when dragging to create it.
Event Payload:
-
boxObjectThe starting service's BoxModel.
clearState
Clear view state as pertaining to relations.
mouseMove
Ensure that mousemove events bubble to canvas when moving over a relation line/label.
rendered
Render relations at an appropriate time.
servicesRendered
Update relations after services are rendered.
Event Payload:
-
serviceObjectThe model for the service that was moved.
snapOutOfService
Ensure the dragline follows the cursor outside of services.
snapToService
Ensure the dragline snaps to service when the cursor is inside one.
Event Payload:
-
dObjectThe service model wrapped in a BoxModel object.
-
rectObjectThe SVG rect element for the service.
updateLinkEndpoints
Update the endpoints for relations when services are moved.
Event Payload:
-
serviceObjectThe service which has had its position updated.
