UNPKG

@maxgraph/core

Version:

maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.

78 lines (77 loc) 3.17 kB
import Shape from '../Shape.js'; import Rectangle from '../../geometry/Rectangle.js'; import { ColorValue } from '../../../types.js'; import AbstractCanvas2D from '../../canvas/AbstractCanvas2D.js'; /** * Extends {@link Shape} to implement a swimlane shape. * * This shape is registered under `swimlane` in {@link CellRenderer} when using {@link Graph} or calling {@link registerDefaultShapes}. * * Use: * - {@link CellStateStyle.startSize} to define the size of the title region, * - {@link CellStateStyle.swimlaneFillColor} for the content area fill, * - {@link CellStateStyle.separatorColor} to draw an additional vertical separator, * - {@link CellStateStyle.swimlaneLine} to hide the line between the title region and the content area * * {@link CellStateStyle.horizontal} affects the orientation of this shape, not only its label. * * @category Vertex Shapes */ declare class SwimlaneShape extends Shape { constructor(bounds: Rectangle, fill: ColorValue, stroke: ColorValue, strokeWidth?: number); /** * Default image width and image height if an image but no image width and image height are defined in the style. * @default 16 */ imageSize: number; imageSrc: string | null; /** * Adds roundable support. */ isRoundable(c: AbstractCanvas2D, x: number, y: number, w: number, h: number): boolean; /** * Returns the bounding box for the gradient box for this shape. */ getTitleSize(): number; /** * Returns the bounding box for the gradient box for this shape. */ getLabelBounds(rect: Rectangle): Rectangle; /** * Returns the bounding box for the gradient box for this shape. */ getGradientBounds(c: AbstractCanvas2D, x: number, y: number, w: number, h: number): Rectangle; /** * Returns the arc size for the swimlane. */ getSwimlaneArcSize(w: number, h: number, start: number): number; /** * Paints the swimlane vertex shape. */ isHorizontal(): boolean; /** * Paints the swimlane vertex shape. */ paintVertexShape(c: AbstractCanvas2D, x: number, y: number, w: number, h: number): void; /** * Paints the swimlane vertex shape. */ paintSwimlane(c: AbstractCanvas2D, x: number, y: number, w: number, h: number, start: number, fill: ColorValue, swimlaneLine: boolean): void; /** * Paints the swimlane vertex shape. */ paintRoundedSwimlane(c: AbstractCanvas2D, x: number, y: number, w: number, h: number, start: number, r: number, fill: ColorValue, swimlaneLine: boolean): void; /** * Paints the divider between swimlane title and content area. */ paintDivider(c: AbstractCanvas2D, x: number, y: number, w: number, h: number, start: number, shadow: boolean): void; /** * Paints the vertical or horizontal separator line between swimlanes. */ paintSeparator(c: AbstractCanvas2D, x: number, y: number, w: number, h: number, start: number, color: ColorValue): void; /** * Paints the swimlane vertex shape. */ getImageBounds(x: number, y: number, w: number, h: number): Rectangle; } export default SwimlaneShape;