sprotty
Version:
A next-gen framework for graphical views
70 lines • 4.22 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2021 TypeFox 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 { VNode } from 'snabbdom';
import { Action, GetSelectionAction, ResponseAction, SelectAction, SelectAllAction } from 'sprotty-protocol/lib/actions';
import { Selectable } from 'sprotty-protocol/lib/model';
import { Command, CommandExecutionContext } from '../../base/commands/command';
import { ModelRequestCommand } from '../../base/commands/request-command';
import { SChildElementImpl, SModelElementImpl, SModelRootImpl, SParentElementImpl } from '../../base/model/smodel';
import { KeyListener } from '../../base/views/key-tool';
import { MouseListener } from '../../base/views/mouse-tool';
import { ButtonHandlerRegistry } from '../button/button-handler';
export declare class SelectCommand extends Command {
action: SelectAction;
static readonly KIND = "elementSelected";
protected selected: (SChildElementImpl & Selectable)[];
protected deselected: (SChildElementImpl & Selectable)[];
constructor(action: SelectAction);
execute(context: CommandExecutionContext): SModelRootImpl;
undo(context: CommandExecutionContext): SModelRootImpl;
redo(context: CommandExecutionContext): SModelRootImpl;
}
export declare class SelectAllCommand extends Command {
protected readonly action: SelectAllAction;
static readonly KIND = "allSelected";
protected previousSelection: Record<string, boolean>;
constructor(action: SelectAllAction);
execute(context: CommandExecutionContext): SModelRootImpl;
protected selectAll(element: SParentElementImpl, newState: boolean): void;
undo(context: CommandExecutionContext): SModelRootImpl;
redo(context: CommandExecutionContext): SModelRootImpl;
}
export declare class SelectMouseListener extends MouseListener {
protected buttonHandlerRegistry: ButtonHandlerRegistry;
wasSelected: boolean;
hasDragged: boolean;
isMouseDown: boolean;
mouseDown(target: SModelElementImpl, event: MouseEvent): (Action | Promise<Action>)[];
protected collectElementsToDeselect(target: SModelElementImpl, selectableTarget: (SModelElementImpl & Selectable) | undefined): SModelElementImpl[];
protected handleButton(target: SModelElementImpl, event: MouseEvent): (Action | Promise<Action>)[] | undefined;
protected handleSelectTarget(selectableTarget: SModelElementImpl & Selectable, deselectedElements: SModelElementImpl[], event: MouseEvent): (Action | Promise<Action>)[];
protected handleDeselectTarget(selectableTarget: SModelElementImpl & Selectable, event: MouseEvent): (Action | Promise<Action>)[];
protected handleDeselectAll(deselectedElements: SModelElementImpl[], event: MouseEvent): (Action | Promise<Action>)[];
mouseMove(target: SModelElementImpl, event: MouseEvent): Action[];
mouseUp(target: SModelElementImpl, event: MouseEvent): (Action | Promise<Action>)[];
decorate(vnode: VNode, element: SModelElementImpl): VNode;
}
export declare class GetSelectionCommand extends ModelRequestCommand {
protected readonly action: GetSelectionAction;
static readonly KIND = "getSelection";
protected previousSelection: Record<string, boolean>;
constructor(action: GetSelectionAction);
protected retrieveResult(context: CommandExecutionContext): ResponseAction;
}
export declare class SelectKeyboardListener extends KeyListener {
keyDown(element: SModelElementImpl, event: KeyboardEvent): Action[];
}
//# sourceMappingURL=select.d.ts.map