mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
Add inclusive gatway component
This commit is contained in:
parent
da173d9d1e
commit
66cbc4f64b
@ -7,6 +7,9 @@
|
|||||||
<div *ngSwitchCase="'ExclusiveGateway'">
|
<div *ngSwitchCase="'ExclusiveGateway'">
|
||||||
<diagram-exclusive-gateway [data]="element"></diagram-exclusive-gateway>
|
<diagram-exclusive-gateway [data]="element"></diagram-exclusive-gateway>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngSwitchCase="'InclusiveGateway'">
|
||||||
|
<diagram-inclusive-gateway [data]="element"></diagram-inclusive-gateway>
|
||||||
|
</div>
|
||||||
<div *ngSwitchCase="'ParallelGateway'">
|
<div *ngSwitchCase="'ParallelGateway'">
|
||||||
<diagram-parallel-gateway [data]="element"></diagram-parallel-gateway>
|
<diagram-parallel-gateway [data]="element"></diagram-parallel-gateway>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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>
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -17,15 +17,18 @@
|
|||||||
|
|
||||||
import { DiagramGatewayComponent } from './diagram-gateway.component';
|
import { DiagramGatewayComponent } from './diagram-gateway.component';
|
||||||
import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component';
|
import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component';
|
||||||
|
import { DiagramInclusiveGatewayComponent } from './diagram-inclusive-gateway.component';
|
||||||
import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component';
|
import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component';
|
||||||
|
|
||||||
// primitives
|
// primitives
|
||||||
export * from './diagram-gateway.component';
|
export * from './diagram-gateway.component';
|
||||||
export * from './diagram-exclusive-gateway.component';
|
export * from './diagram-exclusive-gateway.component';
|
||||||
|
export * from './diagram-inclusive-gateway.component';
|
||||||
export * from './diagram-parallel-gateway.component';
|
export * from './diagram-parallel-gateway.component';
|
||||||
|
|
||||||
export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [
|
export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [
|
||||||
DiagramGatewayComponent,
|
DiagramGatewayComponent,
|
||||||
DiagramExclusiveGatewayComponent,
|
DiagramExclusiveGatewayComponent,
|
||||||
|
DiagramInclusiveGatewayComponent,
|
||||||
DiagramParallelGatewayComponent
|
DiagramParallelGatewayComponent
|
||||||
];
|
];
|
||||||
|
@ -43,9 +43,9 @@ export class RaphaelService {
|
|||||||
if (typeof Raphael === 'undefined') {
|
if (typeof Raphael === 'undefined') {
|
||||||
throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory');
|
throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory');
|
||||||
}
|
}
|
||||||
let paper = new Raphael(ctx, 583, 344.08374193550003);
|
let paper = new Raphael(ctx, 1000, 500);
|
||||||
paper.setViewBox(0, 0, 583, 344.08374193550003, false);
|
// paper.setViewBox(0, 0, 583, 344.08374193550003, false);
|
||||||
paper.renderfix();
|
// paper.renderfix();
|
||||||
return paper;
|
return paper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user