@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
73 lines • 4.01 kB
TypeScript
/********************************************************************************
* Copyright (c) 2019-2024 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Action, AnchorComputerRegistry, Args, GModelElement, IActionDispatcher, TriggerEdgeCreationAction } from '@eclipse-glsp/sprotty';
import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
import { GEdge } from '../../../model';
import { Grid } from '../../grid/grid';
import { ITypeHintProvider } from '../../hints/type-hint-provider';
import { BaseCreationTool } from '../base-tools';
/**
* Tool to create connections in a Diagram, by selecting a source and target node.
*/
export declare class EdgeCreationTool extends BaseCreationTool<TriggerEdgeCreationAction> {
static ID: string;
protected anchorRegistry: AnchorComputerRegistry;
protected typeHintProvider: ITypeHintProvider;
protected grid: Grid;
protected isTriggerAction: typeof TriggerEdgeCreationAction.is;
get id(): string;
doEnable(): void;
protected toolFeedback(): void;
protected creationListener(): void;
protected trackFeedbackEdge(): void;
}
export declare class EdgeCreationToolMouseListener extends DragAwareMouseListener {
protected triggerAction: TriggerEdgeCreationAction;
protected actionDispatcher: IActionDispatcher;
protected typeHintProvider: ITypeHintProvider;
protected tool: EdgeCreationTool;
protected dragSensitivity?: number | undefined;
protected source?: string;
protected target?: string;
protected currentTarget?: GModelElement;
protected allowedTarget: boolean;
protected proxyEdge: GEdge;
protected pendingDynamicCheck: boolean;
protected cursorFeedback: FeedbackEmitter;
protected feedbackEdgeFeedback: FeedbackEmitter;
constructor(triggerAction: TriggerEdgeCreationAction, actionDispatcher: IActionDispatcher, typeHintProvider: ITypeHintProvider, tool: EdgeCreationTool, dragSensitivity?: number | undefined);
nonDraggingMouseUp(element: GModelElement, event: MouseEvent): Action[];
/**
* Determines wether the tool should run in continuous mode (also called stamp mode) or not.
* If continuous mode is enabled, the tool will stay after a successful creation.
* The user can then create more elements of the same type without having to re-trigger the tool.
* By default, continuous mode is enabled if the user holds the CTRL key.
* @param element the current model element
* @param event
*/
protected isContinuousMode(element: GModelElement, event: MouseEvent): boolean;
protected getCreateOperation(element: GModelElement, event: MouseEvent, sourceElementId: string, targetElementId: string): Action;
protected getCreateEdgeOperationArgs(ctx: GModelElement, event: MouseEvent): Args | undefined;
protected isSourceSelected(): boolean;
protected isTargetSelected(): boolean;
mouseOver(target: GModelElement, event: MouseEvent): Action[];
protected updateEdgeFeedback(): Action;
protected canConnect(element: GModelElement | undefined, role: 'source' | 'target'): boolean;
protected isDynamic(edgeTypeId: string): boolean;
dispose(): void;
}
//# sourceMappingURL=edge-creation-tool.d.ts.map