Skip to main content
Version: 4.1

SwimlaneTransform

The SwimlaneTransform element tool allows you to resize lanes in bpmn2.Pool or bpmn2.HeaderedPool shape, from the UI. It renders 4 handles around selected lane which you drag and use to resize lane in particular direction.

See usage of the SwimlaneTransform element tool in the learn section.

constructor​

constructor(opt: SwimlaneTransform.Options);

The elementTools.SwimlaneTransform constructor accepts an Options object that encapsulates multiple parameters:

width​

[optional] The width of the scrollbar thumb. The default value is 8.

laneId​

Specifies the lane group for which the tool should be rendered.

padding​

Specifies how much the boundary area of handles should be visually inflated. Default is 10 ({left: 10, top: 10, right: 10, bottom: 10}).

minSize​

Specifies the minimal height of the lane after which the tool will not allow it to shrink further. Default is 30.

constraintsPadding​

Specifies the padding around constraint points. Default is 10.

minSizeConstraints​

Callback function that is expected to return an array of minimal constraint points (in the form: {x: number, y: number}), relative to the paper. Minimal constraint points are points that should always be kept inside selected lane when resizing. If this option is left undefined, the default minSizeConstraints function is used instead which creates those points automatically from embedded shapes. Callback is called each time a handle starts to be dragged, the arguments passed are:

modeldia.ElementPool shape that the tool was added to.
laneIdstringId of the lane that the tool was initialized with.
handleSide"left" | "top" | "right" | "bottom"Position of the dragged handle (relative to the lane).

maxSizeConstraints​

Callback function that is expected to return an array of maximum constraint points (in the form: {x: number, y: number}), relative to the paper. Maximum constraint points are points that should always be kept outside selected lane when resizing. If this option is left undefined, the default maxSizeConstraints function is used instead which creates those points automatically from embedded shapes. Callback is called each time a handle starts to be dragged, the arguments passed are:

modeldia.ElementPool shape that the tool was added to.
laneIdstringId of the lane that the tool was initialized with.
handleSide"left" | "top" | "right" | "bottom"Position of the dragged handle (relative to the lane).

stopPropagation​

Should be events stopped from propagating to the paper? Default is true.

Types​

Options​

interface Options extends dia.ToolView.Options {
laneId: string;
minSize?: number;
handleClass?: any;
padding?: dia.Sides;
stopPropagation?: boolean;
constraintsPadding?: number;
minSizeConstraints?: (model: Pool, laneId: string, handleSide: dia.OrthogonalDirection) => Array<dia.Point>;
maxSizeConstraints?: (model: Pool, laneId: string, handleSide: dia.OrthogonalDirection) => Array<dia.Point>;
}