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 9c7845ad53..3f2240fcdd 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 @@ -2,7 +2,7 @@
- +
@@ -17,7 +17,7 @@
- +
@@ -49,6 +49,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html new file mode 100644 index 0000000000..ae975d5b9f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts new file mode 100644 index 0000000000..cbd7d2213c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts @@ -0,0 +1,51 @@ +/*! + * @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-end-event', + templateUrl: './diagram-end-event.component.html', + styleUrls: ['./diagram-end-event.component.css'] +}) +export class DiagramEndEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; + iconFillColor: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + console.log(this.elementRef); + + this.options.radius = 14; + this.options.strokeWidth = 4; + 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(); + + this.iconFillColor = 'black'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html index c4de55c9cc..e85a6aee8d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html @@ -1,2 +1,4 @@ \ No newline at end of file + [fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"> + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts index f588272b0f..63682a4366 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts @@ -29,16 +29,15 @@ export class DiagramEventComponent { data: any; @Input() - strokeWidth: number; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; @Input() - radius: number; + iconFillColor: any; @Output() onError = new EventEmitter(); center: any = {}; - options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} @@ -47,11 +46,5 @@ export class DiagramEventComponent { console.log(this.elementRef); this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); - - this.options.radius = this.radius; - this.options.strokeWidth = this.strokeWidth; - 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/events/diagram-start-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html new file mode 100644 index 0000000000..ae975d5b9f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts new file mode 100644 index 0000000000..09dcaaa231 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts @@ -0,0 +1,51 @@ +/*! + * @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-start-event', + templateUrl: './diagram-start-event.component.html', + styleUrls: ['./diagram-start-event.component.css'] +}) +export class DiagramStartEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; + iconFillColor: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + console.log(this.elementRef); + + this.options.radius = 15; + this.options.strokeWidth = 1; + 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(); + + this.iconFillColor = 'none'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts index b879aad332..fe24b0eb39 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts @@ -16,10 +16,16 @@ */ import { DiagramEventComponent } from './diagram-event.component'; +import { DiagramStartEventComponent } from './diagram-start-event.component'; +import { DiagramEndEventComponent } from './diagram-end-event.component'; // primitives export * from './diagram-event.component'; +export * from './diagram-start-event.component'; +export * from './diagram-end-event.component'; export const DIAGRAM_EVENTS_DIRECTIVES: any[] = [ - DiagramEventComponent + DiagramEventComponent, + DiagramStartEventComponent, + DiagramEndEventComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index 391f67b07e..00ffb44abd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -3,7 +3,7 @@
- +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts index 20175ae320..c735603187 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts @@ -28,6 +28,9 @@ export class DiagramIconErrorComponent { @Input() data: any; + @Input() + fillColor: string; + @Output() onError = new EventEmitter(); @@ -42,7 +45,7 @@ export class DiagramIconErrorComponent { this.position = {x: this.data.x - 1, y: this.data.y - 1}; this.options.stroke = 'black'; - this.options.fillColors = 'none'; + this.options.fillColors = this.fillColor; this.options.strokeWidth = 1; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html new file mode 100644 index 0000000000..a3b195375b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts new file mode 100644 index 0000000000..7d7b451e20 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts @@ -0,0 +1,52 @@ +/*! + * @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-event-subprocess', + templateUrl: './diagram-event-subprocess.component.html', + styleUrls: ['./diagram-event-subprocess.component.css'] +}) +export class DiagramEventSubprocessComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + rectLeftCorner: any; + width: any; + height: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: 4}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.rectLeftCorner = {x: this.data.x, y: this.data.y}; + this.width = this.data.width; + this.height = this.data.height; + + this.options.fillColors = 'none'; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts index 1f283e491e..a13ebbc842 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts @@ -16,10 +16,13 @@ */ import { DiagramSubprocessComponent } from './diagram-subprocess.component'; +import { DiagramEventSubprocessComponent } from './diagram-event-subprocess.component'; // primitives export * from './diagram-subprocess.component'; +export * from './diagram-event-subprocess.component'; export const DIAGRAM_STRUCTURAL_DIRECTIVES: any[] = [ - DiagramSubprocessComponent + DiagramSubprocessComponent, + DiagramEventSubprocessComponent ];