Add inclusive gatway component

This commit is contained in:
mauriziovitale84 2016-10-21 12:15:51 +01:00
parent da173d9d1e
commit 66cbc4f64b
5 changed files with 62 additions and 3 deletions

View File

@ -7,6 +7,9 @@
<div *ngSwitchCase="'ExclusiveGateway'">
<diagram-exclusive-gateway [data]="element"></diagram-exclusive-gateway>
</div>
<div *ngSwitchCase="'InclusiveGateway'">
<diagram-inclusive-gateway [data]="element"></diagram-inclusive-gateway>
</div>
<div *ngSwitchCase="'ParallelGateway'">
<diagram-parallel-gateway [data]="element"></diagram-parallel-gateway>
</div>

View File

@ -0,0 +1,3 @@
<diagram-gateway [data]="data"></diagram-gateway>
<raphael-circle [center]="center" [radius]="options.radius" [strokeWidth]="options.strokeWidth" [stroke]="options.stroke"
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-circle>

View File

@ -0,0 +1,50 @@
/*!
* @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-inclusive-gateway',
templateUrl: './diagram-inclusive-gateway.component.html',
styleUrls: ['./diagram-inclusive-gateway.component.css']
})
export class DiagramInclusiveGatewayComponent {
@Input()
data: any;
@Output()
onError = new EventEmitter();
center: any = {};
width: any;
height: any;
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 2.5, radius: 9.75};
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.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();
}
}

View File

@ -17,15 +17,18 @@
import { DiagramGatewayComponent } from './diagram-gateway.component';
import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component';
import { DiagramInclusiveGatewayComponent } from './diagram-inclusive-gateway.component';
import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component';
// primitives
export * from './diagram-gateway.component';
export * from './diagram-exclusive-gateway.component';
export * from './diagram-inclusive-gateway.component';
export * from './diagram-parallel-gateway.component';
export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [
DiagramGatewayComponent,
DiagramExclusiveGatewayComponent,
DiagramInclusiveGatewayComponent,
DiagramParallelGatewayComponent
];

View File

@ -43,9 +43,9 @@ export class RaphaelService {
if (typeof Raphael === 'undefined') {
throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory');
}
let paper = new Raphael(ctx, 583, 344.08374193550003);
paper.setViewBox(0, 0, 583, 344.08374193550003, false);
paper.renderfix();
let paper = new Raphael(ctx, 1000, 500);
// paper.setViewBox(0, 0, 583, 344.08374193550003, false);
// paper.renderfix();
return paper;
}