-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for BPMN groups and adapt subprocess visualization (#315)
- Loading branch information
1 parent
b49fbec
commit 81b285f
Showing
36 changed files
with
222 additions
and
172 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
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
4 changes: 2 additions & 2 deletions
4
src/main/packages/bpmn/bpmn-call-activity/bpmn-call-activity.ts
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
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
36 changes: 36 additions & 0 deletions
36
src/main/packages/bpmn/bpmn-group/bpmn-group-component.tsx
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,36 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import { BPMNGroup } from './bpmn-group'; | ||
import { ThemedRect } from '../../../components/theme/themedComponents'; | ||
import { Multiline } from '../../../utils/svg/multiline'; | ||
|
||
export const BPMNGroupComponent: FunctionComponent<Props> = ({ element, children }) => ( | ||
<g> | ||
<ThemedRect | ||
rx={10} | ||
ry={10} | ||
width="100%" | ||
height="100%" | ||
strokeColor={element.strokeColor} | ||
fillColor="transparent" | ||
strokeDasharray="4" | ||
/> | ||
<Multiline | ||
x={element.bounds.width / 2} | ||
y={element.bounds.height / 2} | ||
width={element.bounds.width} | ||
height={element.bounds.height} | ||
fontWeight="bold" | ||
fill={element.textColor} | ||
lineHeight={16} | ||
capHeight={11} | ||
> | ||
{element.name} | ||
</Multiline> | ||
{children} | ||
</g> | ||
); | ||
|
||
interface Props { | ||
element: BPMNGroup; | ||
children?: React.ReactNode; | ||
} |
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,21 @@ | ||
import { BPMNElementType } from '..'; | ||
import { ILayer } from '../../../services/layouter/layer'; | ||
import { ILayoutable } from '../../../services/layouter/layoutable'; | ||
import { UMLPackage } from '../../common/uml-package/uml-package'; | ||
import { calculateNameBounds } from '../../../utils/name-bounds'; | ||
import { UMLElementType } from '../../uml-element-type'; | ||
import { UMLElementFeatures } from '../../../services/uml-element/uml-element-features'; | ||
|
||
export class BPMNGroup extends UMLPackage { | ||
static features: UMLElementFeatures = { | ||
...UMLPackage.features, | ||
connectable: false, | ||
}; | ||
|
||
type: UMLElementType = BPMNElementType.BPMNGroup; | ||
|
||
render(canvas: ILayer, children: ILayoutable[] = []): ILayoutable[] { | ||
this.bounds = calculateNameBounds(this, canvas); | ||
return [this, ...children]; | ||
} | ||
} |
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
Oops, something went wrong.