Fix diagram event properties color

This commit is contained in:
mauriziovitale84
2016-10-21 10:19:30 +01:00
parent 125065ed6f
commit 5516c8a28b
3 changed files with 22 additions and 4 deletions

View File

@@ -1 +1,2 @@
<raphael-circle [center]="center" [radius]="radius" [strokeWith]="strokeWidth"></raphael-circle>
<raphael-circle [center]="center" [radius]="data.radius" [strokeWidth]="data.strokeWidth" [stroke]="data.stroke"
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-circle>

View File

@@ -16,6 +16,7 @@
*/
import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core';
import { DiagramColorService } from './services/diagram-color.service';
@Component({
moduleId: module.id,
@@ -38,11 +39,18 @@ export class DiagramEventComponent {
center: any = {};
constructor(public elementRef: ElementRef) {}
constructor(public elementRef: ElementRef,
private diagramColorService: DiagramColorService) {}
ngOnInit() {
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.data.radius = this.radius;
this.data.strokeWidth = this.strokeWidth;
this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR);
this.data.fillColors = this.diagramColorService.getFillColour(this.data.id);
this.data.fillOpacity = this.diagramColorService.getFillOpacity();
}
}

View File

@@ -32,7 +32,16 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit {
radius: number;
@Input()
strokeWith: number;
strokeWidth: number;
@Input()
fillColors: any;
@Input()
stroke: any;
@Input()
fillOpacity: any;
@Output()
onError = new EventEmitter();
@@ -44,7 +53,7 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit {
ngOnInit() {
console.log(this.elementRef);
let opts = {'stroke-width': this.strokeWith};
let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity};
this.draw(this.center, this.radius, opts);
}