mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Refactoring options
This commit is contained in:
+2
-2
@@ -1,2 +1,2 @@
|
||||
<raphael-circle [center]="center" [radius]="data.radius" [strokeWidth]="data.strokeWidth" [stroke]="data.stroke"
|
||||
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="options.radius" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>
|
||||
+6
-5
@@ -38,6 +38,7 @@ export class DiagramEventComponent {
|
||||
onError = new EventEmitter();
|
||||
|
||||
center: any = {};
|
||||
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''};
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
@@ -47,10 +48,10 @@ export class DiagramEventComponent {
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
<raphael-rect [leftCorner]="rectLeftCorner" [width]="data.width" [height]="data.height" [radius]="radius" [stroke]="data.stroke" [strokeWidth]="data.strokeWidth"
|
||||
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-rect>
|
||||
<raphael-rect [leftCorner]="rectLeftCorner" [width]="data.width" [height]="data.height" [radius]="options.radius"
|
||||
[stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-rect>
|
||||
<raphael-text [text]="data.name" [position]="textPosition"></raphael-text>
|
||||
+5
-15
@@ -28,33 +28,23 @@ export class DiagramTaskComponent {
|
||||
@Input()
|
||||
data: any;
|
||||
|
||||
options: any = {};
|
||||
|
||||
@Output()
|
||||
onError = new EventEmitter();
|
||||
|
||||
stroke: number;
|
||||
|
||||
rectLeftCorner: any;
|
||||
radius: number = 4;
|
||||
|
||||
textPosition: any;
|
||||
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: 4};
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.elementRef);
|
||||
|
||||
this.data.fillColors = this.diagramColorService.getFillColour(this.data.id);
|
||||
this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR);
|
||||
this.data.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data);
|
||||
this.data.fillOpacity = this.diagramColorService.getFillOpacity();
|
||||
|
||||
this.rectLeftCorner = {x: this.data.x, y: this.data.y};
|
||||
|
||||
this.textPosition = {x: this.data.x + ( this.data.width / 2 ), y: this.data.y + ( this.data.height / 2 )};
|
||||
|
||||
this.options['id'] = this.data.id;
|
||||
this.options.fillColors = this.diagramColorService.getFillColour(this.data.id);
|
||||
this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR);
|
||||
this.options.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data);
|
||||
this.options.fillOpacity = this.diagramColorService.getFillOpacity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<div *ngSwitchCase="'ExclusiveGateway'">
|
||||
<diagram-exclusive-gateway [data]="element"></diagram-exclusive-gateway>
|
||||
</div>
|
||||
<div *ngSwitchCase="'ParallelGateway'">
|
||||
<diagram-parallel-gateway [data]="element"></diagram-parallel-gateway>
|
||||
</div>
|
||||
<div *ngSwitchCase="'EndEvent'">
|
||||
<diagram-event [data]="element" [radius]="14" [strokeWidth]="4"></diagram-event>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
<diagram-gateway [data]="data"></diagram-gateway>
|
||||
<raphael-cross [center]="center" [width]="data.width" [height]="data.height" [stroke]="data.stroke" [strokeWidth]="data.strokeWidth"
|
||||
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-cross>
|
||||
<raphael-cross [center]="center" [width]="width" [height]="height" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-cross>
|
||||
+8
-4
@@ -32,6 +32,9 @@ export class DiagramExclusiveGatewayComponent {
|
||||
onError = new EventEmitter();
|
||||
|
||||
center: any = {};
|
||||
width: any;
|
||||
height: any;
|
||||
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 3};
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
@@ -39,10 +42,11 @@ export class DiagramExclusiveGatewayComponent {
|
||||
ngOnInit() {
|
||||
this.center.x = this.data.x;
|
||||
this.center.y = this.data.y;
|
||||
this.width = this.data.width;
|
||||
this.height = this.data.height;
|
||||
|
||||
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();
|
||||
this.data.strokeWidth = 3;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
<raphael-rhombus [center]="center" [width]="data.width" [height]="data.height" [stroke]="data.stroke" [strokeWidth]="2"
|
||||
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-rhombus>
|
||||
<raphael-rhombus [center]="center" [width]="width" [height]="height" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
|
||||
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-rhombus>
|
||||
+8
-4
@@ -32,6 +32,9 @@ export class DiagramGatewayComponent {
|
||||
onError = new EventEmitter();
|
||||
|
||||
center: any = {};
|
||||
width: any;
|
||||
height: any;
|
||||
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 2};
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
@@ -39,10 +42,11 @@ export class DiagramGatewayComponent {
|
||||
ngOnInit() {
|
||||
this.center.x = this.data.x;
|
||||
this.center.y = this.data.y;
|
||||
this.width = this.data.width;
|
||||
this.height = this.data.height;
|
||||
|
||||
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();
|
||||
this.data.strokeWidth = 2;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user