-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename subprocess-navigation -> drilldown * add JSDoc comments
- Loading branch information
Showing
13 changed files
with
132 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...process-navigation/SubprocessCentering.js → lib/features/drilldown/DrilldownCentering.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { getBusinessObject, is } from '../../util/ModelUtil'; | ||
|
||
/** | ||
* Add secondary shape for boundary events on expanded subprocess views. | ||
* The position is determined relative to the primary element. | ||
* | ||
* @param {eventBus} eventBus | ||
* @param {elementRegistry} elementRegistry | ||
* @param {canvas} canvas | ||
* @param {elementFactory} elementFactory | ||
*/ | ||
export default function SubprocessFakeBoundaries( | ||
eventBus, elementRegistry, | ||
canvas, elementFactory) { | ||
|
||
var attachBoundaries = function() { | ||
var secondaryShapes = elementRegistry.filter(function(el) { | ||
return is(el, 'bpmn:SubProcess') && el.isSecondary; | ||
}); | ||
|
||
secondaryShapes.forEach(function(process) { | ||
if (!process.primaryShape || !process.primaryShape.attachers) { | ||
return; | ||
} | ||
|
||
process.primaryShape.attachers.forEach(function(boundary) { | ||
var bo = getBusinessObject(boundary); | ||
|
||
var primary = process.primaryShape; | ||
|
||
var relativeXPos = (boundary.x + 15 - primary.x) / primary.width; | ||
var relativeYPos = (boundary.y + 15 - primary.y) / primary.height; | ||
|
||
var dx = process.x + (process.width * relativeXPos) - 15; | ||
var dy = process.y + (process.height * relativeYPos) - 15; | ||
|
||
var boundaryShape = elementFactory.createShape({ | ||
id: bo.id + '_secondary', | ||
businessObject: bo, | ||
type: 'bpmn:BoundaryEvent', | ||
hidden: false, | ||
x: dx, | ||
y: dy, | ||
width: 30, | ||
height: 30, | ||
isFrame: false, | ||
isSecondary: true, | ||
primaryShape: boundary, | ||
di: boundary.di | ||
}); | ||
|
||
canvas.addShape(boundaryShape, process.parent); | ||
|
||
if (!process.attachers) { | ||
process.attachers = []; | ||
} | ||
|
||
process.attachers.push(boundaryShape); | ||
}); | ||
|
||
}); | ||
}; | ||
|
||
eventBus.on('import.done', attachBoundaries); | ||
} | ||
|
||
|
||
SubprocessFakeBoundaries.$inject = [ | ||
'eventBus', | ||
'elementRegistry', | ||
'canvas', | ||
'elementFactory' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import OverlaysModule from 'diagram-js/lib/features/overlays'; | ||
import ChangeSupportModule from 'diagram-js/lib/features/change-support'; | ||
|
||
import DrilldownOverlays from './DrilldownOverlays'; | ||
import DrilldownCentering from './DrilldownCentering'; | ||
import SubprocessCompatibility from './SubprocessCompatibility'; | ||
import SubprocessFakeBoundaries from './SubprocessFakeBoundaries'; | ||
import SubprocessFakeFlows from './SubprocessFakeFlows'; | ||
|
||
export default { | ||
__depends__: [ OverlaysModule, ChangeSupportModule ], | ||
__init__: [ 'drilldownOverlays', 'drilldownCentering', 'subprocessCompatibility', 'subprocessFakeBoundaries', 'subprocessFakeFlows' ], | ||
drilldownOverlays: [ 'type', DrilldownOverlays ], | ||
drilldownCentering: [ 'type', DrilldownCentering ], | ||
subprocessCompatibility: [ 'type', SubprocessCompatibility ], | ||
subprocessFakeBoundaries: [ 'type', SubprocessFakeBoundaries ], | ||
subprocessFakeFlows: [ 'type', SubprocessFakeFlows ] | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.