mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
add intermediate catching event component
This commit is contained in:
parent
2b907348d5
commit
bc1385bfd2
@ -40,6 +40,9 @@
|
||||
<div *ngSwitchCase="'BoundaryEvent'">
|
||||
<diagram-boundary-event [data]="element"></diagram-boundary-event>
|
||||
</div>
|
||||
<div *ngSwitchCase="'IntermediateCatchEvent'">
|
||||
<diagram-intermediate-catching-event [data]="element"></diagram-intermediate-catching-event>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngFor="let flow of diagram.flows">
|
||||
|
@ -22,6 +22,7 @@ import { DIAGRAM_EVENTS_DIRECTIVES } from './events/index';
|
||||
import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index';
|
||||
import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index';
|
||||
import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index';
|
||||
import { DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES } from './intermediate-catching-events/index';
|
||||
|
||||
import { DiagramColorService } from './services/diagram-color.service';
|
||||
|
||||
@ -32,6 +33,7 @@ export * from './activities/index';
|
||||
export * from './icons/index';
|
||||
export * from './diagram-sequence-flow.component';
|
||||
export * from './boundary-events/index';
|
||||
export * from './intermediate-catching-events/index';
|
||||
|
||||
export const DIAGRAM_DIRECTIVES: any[] = [
|
||||
DiagramComponent,
|
||||
@ -40,7 +42,8 @@ export const DIAGRAM_DIRECTIVES: any[] = [
|
||||
DiagramSequenceFlowComponent,
|
||||
DIAGRAM_GATEWAY_DIRECTIVES,
|
||||
DIAGRAM_ICONS_DIRECTIVES,
|
||||
DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES
|
||||
DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES,
|
||||
DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES
|
||||
];
|
||||
|
||||
export const DIAGRAM_PROVIDERS: any[] = [
|
||||
|
@ -0,0 +1,5 @@
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusInner" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="circleRadiusOuter" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
<diagram-container-icon-event [data]="data" [type]="data.eventDefinition.type"></diagram-container-icon-event>
|
@ -0,0 +1,54 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { DiagramColorService } from './../services/diagram-color.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'diagram-intermediate-catching-event',
|
||||
templateUrl: './diagram-intermediate-catching-event.component.html',
|
||||
styleUrls: ['./diagram-intermediate-catching-event.component.css']
|
||||
})
|
||||
export class DiagramIntermediateCatchingEventComponent {
|
||||
@Input()
|
||||
data: any;
|
||||
|
||||
@Output()
|
||||
onError = new EventEmitter();
|
||||
|
||||
center: any = {};
|
||||
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 1};
|
||||
|
||||
circleRadiusInner: number;
|
||||
circleRadiusOuter: number;
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.center.x = this.data.x + (this.data.width / 2);
|
||||
this.center.y = this.data.y + (this.data.height / 2);
|
||||
|
||||
this.circleRadiusInner = 12;
|
||||
this.circleRadiusOuter = 15;
|
||||
|
||||
this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR);
|
||||
this.options.fillColors = this.diagramColorService.getFillColour(this.data.id);
|
||||
this.options.fillOpacity = this.diagramColorService.getFillOpacity();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DiagramIntermediateCatchingEventComponent } from './diagram-intermediate-catching-event.component';
|
||||
|
||||
// primitives
|
||||
export * from './diagram-intermediate-catching-event.component';
|
||||
|
||||
export const DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES: any[] = [
|
||||
DiagramIntermediateCatchingEventComponent
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user