import * as go from '../../../../libs/gojs/release/go'; import { LayerService } from '../layer.service'; export declare class DesignerCommandHandler extends go.CommandHandler { private layerService; diagram: go.Diagram; private _arrowKeyBehavior; private _pasteOffset; private _lastPasteOffset; constructor(layerService: LayerService); /** * 设置diagram属性值 * @this {DrawCommandHandler} */ private setDataProperty; /** * This controls whether or not the user can invoke the {@link #alignLeft}, {@link #alignRight}, * {@link #alignTop}, {@link #alignBottom}, {@link #alignCenterX}, {@link #alignCenterY} commands. * @this {DrawCommandHandler} * @return {boolean} * This returns true: * if the diagram is not {@link Diagram#isReadOnly}, * if the model is not {@link Model#isReadOnly}, and * if there are at least two selected {@link Part}s. */ canAlignSelection(): boolean; /** * Aligns selected parts along the left-most edge of the left-most part. * @this {DrawCommandHandler} */ alignLeft(): void; /** * Aligns selected parts at the right-most edge of the right-most part. * @this {DrawCommandHandler} */ alignRight(): void; /** * Aligns selected parts at the top-most edge of the top-most part. * @this {DrawCommandHandler} */ alignTop(): void; /** * Aligns selected parts at the bottom-most edge of the bottom-most part. * @this {DrawCommandHandler} */ alignBottom(): void; /** * Aligns selected parts at the x-value of the center point of the first selected part. * @this {DrawCommandHandler} */ alignCenterX(): void; /** * Aligns selected parts at the y-value of the center point of the first selected part. * @this {DrawCommandHandler} */ alignCenterY(): void; /** * Aligns selected parts top-to-bottom in order of the order selected. * Distance between parts can be specified. Default distance is 0. * @this {DrawCommandHandler} */ alignColumn(): void; /** * Aligns selected parts left-to-right in order of the order selected. * Distance between parts can be specified. Default distance is 0. * @this {DrawCommandHandler} */ alignRow(): void; /** * This controls whether or not the part can invoke the align commands. * @this {DrawCommandHandler} * @return {boolean} * This returns true: * if the part is not {@link} and not locked{Model#locked} */ private cannotAlign; /** * This controls whether or not the user can invoke the {@link #rotate} command. * @this {DrawCommandHandler} * @param {number=} angle the positive (clockwise) or * negative (counter-clockwise) change in the rotation angle of each Part, in degrees. * @return {boolean} * This returns true: * if the diagram is not {@link Diagram#isReadOnly}, * if the model is not {@link Model#isReadOnly}, and * if there is at least one selected {@link Part}. */ canRotate(): boolean; /** * Change the angle of the parts connected with the given part. This is in the command handler * so it can be easily accessed for the purpose of creating commands that change the rotation of a part. * @this {DrawCommandHandler} * @param {number=} angle the positive (clockwise) or negative * (counter-clockwise) change in the rotation angle of each Part, in degrees. */ rotate(angle: any): void; /** * This implements custom behaviors for arrow key keyboard events. * Set {@link #arrowKeyBehavior} to "select", "move" (the default), "scroll" (the standard behavior), or "none" * to affect the behavior when the user types an arrow key. * @this {DrawCommandHandler}*/ doKeyDown(): void; selectAll(): void; /** * Collects in an Array all of the non-Link Parts currently in the Diagram. * @this {DrawCommandHandler} * @return {Array} */ private _getAllParts; /** * To be called when arrow keys should move the Diagram.selection. * @this {DrawCommandHandler} */ private _arrowKeyMove; /** * To be called when arrow keys should change selection. * @this {DrawCommandHandler} */ private _arrowKeySelect; /** * Finds the nearest Part in the specified direction, based on their center points. * if it doesn't find anything, it just returns the current Part. * @this {DrawCommandHandler} * @param {number} dir the direction, in degrees * @return {Part} the closest Part found in the given direction */ private _findNearestPartTowards; /** * @this {DrawCommandHandler} * @param {number} a * @param {number} dir * @return {number} */ private _angleCloseness; /** * Reset the last offset for pasting. * @override * @this {DrawCommandHandler} * @param {Iterable.} coll a collection of {@link Part}s. */ copyToClipboard(coll: any): void; /** * Paste from the clipboard with an offset incremented on each paste, and reset when copied. * @override * @this {DrawCommandHandler} * @return {Set.} a collection of newly pasted {@link Part}s */ pasteFromClipboard(): go.Set; /** * Gets or sets the arrow key behavior. Possible values are "move", "select", and "scroll". * The default value is "move". * @name DrawCommandHandler#arrowKeyBehavior * @function. * @return {string} */ arrowKeyBehavior: string; /** * Gets or sets the offset at which each repeated pasteSelection() puts the new copied parts from the clipboard. * @name DrawCommandHandler#pasteOffset * @function. * @return {Point} */ pasteOffset: go.Point; /** * 获取选中的(非锁定)部分 * @this {DrawCommandHandler} * @return array */ private getSelectedParts; /** * 获取未选中的部分 * @this {DrawCommandHandler} * @return array */ private getUnselectedParts; /** * 比选中的最大的还大的部分 * @this {DrawCommandHandler} * @return array */ private getLargerUnselectedParts; /** * 获取未选中的,比选中的最小的还小的部分 * @this {DrawCommandHandler} * @return array */ private getSmallerUnselectedParts; /** * 验证上一层及置顶 * @this {DrawCommandHandler} */ private validateFrontAndForward; /** * 验证下一层及置底 * @this {DrawCommandHandler} */ private validateBackAndBackward; /** * 置顶 * @this {DrawCommandHandler} */ bringToFront(): void; /** * 置底 * @this {DrawCommandHandler} */ sendToBack(): void; /** * 上一层 * @this {DrawCommandHandler} */ bringForward(): void; /** * 下一层 * @this {DrawCommandHandler} */ sendBackward(): void; private canChangeZOrder; /** * lock element */ lock(): void; /** * unlock element */ unlock(): void; private updateLockedInternal; sameHeight(): void; sameWidth(): void; sameSize(): void; /** * change view zoom * @this {DrawCommandHandler} */ changeZoom(scale: number): void; cxcommand(val: any): void; findColumnDefinitionForColumn(nodedata: any, idx: any): any; private addColumn; private addRow; private deleteRow; private deleteColumn; }