UNPKG

bpmn-visualization

Version:

A TypeScript library for visualizing process execution data on BPMN diagrams

157 lines (156 loc) 6.14 kB
/** * Copyright 2020 Bonitasoft S.A. * * 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. */ /// <reference types="typed-mxgraph" /> import { BpmnCanvas } from './BpmnCanvas'; import type { IconStyleConfiguration, ShapeConfiguration, Size } from './render-types'; import type { mxAbstractCanvas2D } from 'mxgraph'; /** * **WARN**: You may use it to customize the BPMN Theme as suggested in the examples. But be aware that the way the default BPMN theme can be modified is subject to change. * * @category BPMN Theme * @experimental */ export interface PaintParameter { canvas: mxAbstractCanvas2D; shapeConfig: ShapeConfiguration; iconStyleConfig: IconStyleConfiguration; ratioFromParent?: number; setIconOriginFunct: (canvas: BpmnCanvas) => void; } /** * Default implementation for the icons. * * **WARN**: You may use it to customize the BPMN Theme as suggested in the examples. But be aware that the way the default BPMN theme can be modified is subject to change. * * @category BPMN Theme * @experimental */ export declare class IconPainter { paintEmptyIcon(): void; /** * Utility paint icon methods to easily instantiate a {@link BpmnCanvas} from a {@link PaintParameter}. * * @param canvas mxgraph `mxAbstractCanvas2D` in charge of performing the paint operations. * @param ratioFromParent the actual size of the icon will be computed from the shape dimensions using this ratio. * @param setIconOriginFunct called function to set the origin of the icon. Generally, it calls a method of {@link BpmnCanvas}. * @param shapeConfig dimension and style of the shape where the icon is painted. * @param iconStyleConfig style of the icon. * @param originalIconSize original size of the icon used to compute the scaling/ratio in {@link BpmnCanvas}. * @protected */ protected newBpmnCanvas({ canvas, ratioFromParent, setIconOriginFunct, shapeConfig, iconStyleConfig }: PaintParameter, originalIconSize: Size): BpmnCanvas; /** * This icon is used by `message event`, `receive task`, `send task`. */ paintEnvelopeIcon(paintParameter: PaintParameter): void; /** * This icon is used by `inclusive gateway` and `terminate event`. */ paintCircleIcon(paintParameter: PaintParameter): void; /** * This icon is used by `timer event`. */ paintClockIcon(paintParameter: PaintParameter): void; /** * This icon is used by `signal event`. */ paintTriangleIcon(paintParameter: PaintParameter): void; /** * This icon is used by `escalation event`. */ paintUpArrowheadIcon(paintParameter: PaintParameter): void; /** * This icon is used by `compensation event`. */ paintDoubleLeftArrowheadsIcon(paintParameter: PaintParameter): void; private drawCrossIcon; /** * This icon is used by `conditional event`. */ paintListIcon(paintParameter: PaintParameter): void; /** * This icon is used by `exclusive gateway`. */ paintXCrossIcon(paintParameter: PaintParameter): void; /** * This icon is used by `parallel gateway` and 'event-based gateway'. */ paintPlusCrossIcon(paintParameter: PaintParameter): void; /** * This icon is used by `user task`. */ paintPersonIcon(paintParameter: PaintParameter): void; /** * This icon is used by `service tasks`. */ paintGearIcon(paintParameter: PaintParameter): void; private static paintGearIconBackground; private static paintGearIconForeground; private static paintGearInnerCircle; /** * This icon is used to render the `expand marker` on `activities`. */ paintExpandIcon(paintParameter: PaintParameter): void; /** * This icon is used to render the `loop marker` on `activities`. */ paintLoopIcon(paintParameter: PaintParameter): void; /** * This icon is used to render the `sequential multi-instance marker` on `activities`. */ paintSequentialMultiInstanceIcon(paintParameter: PaintParameter): void; /** * This icon is used to render the `parallel multi-instance marker` on `activities`. */ paintParallelMultiInstanceIcon(paintParameter: PaintParameter): void; /** * This icon is used by `link event`. */ paintRightArrowIcon(paintParameter: PaintParameter): void; /** * This icon is used by `error event`. */ paintErrorIcon(paintParameter: PaintParameter): void; /** * This icon is used by `manual task`. */ paintHandIcon(paintParameter: PaintParameter): void; /** * This icon is used by `script task`. */ paintScriptIcon(paintParameter: PaintParameter): void; /** * This icon is used by `business rule task`. */ paintTableIcon(paintParameter: PaintParameter): void; /** * This icon is used by `event-based gateway`. */ paintPentagon(paintParameter: PaintParameter): void; } /** * Hold the instance of {@link IconPainter} used by the BPMN Theme. * * **WARN**: You may use it to customize the BPMN Theme as suggested in the examples. But be aware that the way the default BPMN theme can be modified is subject to change. * * @category BPMN Theme * @experimental */ export declare class IconPainterProvider { private static instance; static get(): IconPainter; static set(painter: IconPainter): void; }