From bc1385bfd2a6a1ba9614387c9fc88ea68f8368af Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 10:56:31 +0100 Subject: [PATCH] add intermediate catching event component --- .../diagrams/diagram.component.html | 3 ++ .../src/components/diagrams/index.ts | 5 +- ...intermediate-catching-event.component.html | 5 ++ ...m-intermediate-catching-event.component.ts | 54 +++++++++++++++++++ .../intermediate-catching-events/index.ts | 25 +++++++++ 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index d10c601cc0..b2e9bb0cbd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -40,6 +40,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index a8ac0e0a49..a5e5dfec49 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -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[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html new file mode 100644 index 0000000000..b5eb151f55 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts new file mode 100644 index 0000000000..96cb9bfc2d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts @@ -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(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts new file mode 100644 index 0000000000..bfebc82955 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts @@ -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 +];