sprotty
Version:
A next-gen framework for graphical views
55 lines • 2.94 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2023 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 { Action, CenterAction, FitToScreenAction } from 'sprotty-protocol/lib/actions';
import { Viewport } from 'sprotty-protocol/lib/model';
import { Bounds } from 'sprotty-protocol/lib/utils/geometry';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { KeyListener } from '../../base/views/key-tool';
import { ViewerOptions } from '../../base/views/viewer-options';
export declare abstract class BoundsAwareViewportCommand extends Command {
protected readonly animate: boolean;
protected viewerOptions: ViewerOptions;
oldViewport: Viewport;
newViewport?: Viewport;
constructor(animate: boolean);
protected initialize(model: SModelRootImpl): void;
protected boundsInViewport(element: SModelElementImpl, bounds: Bounds, viewport: SModelRootImpl & Viewport): Bounds;
protected abstract getNewViewport(bounds: Bounds, model: SModelRootImpl): Viewport | undefined;
protected abstract getElementIds(): string[];
execute(context: CommandExecutionContext): CommandReturn;
undo(context: CommandExecutionContext): CommandReturn;
redo(context: CommandExecutionContext): CommandReturn;
protected equal(vp1: Viewport, vp2: Viewport): boolean;
}
export declare class CenterCommand extends BoundsAwareViewportCommand {
protected action: CenterAction;
static readonly KIND = "center";
constructor(action: CenterAction);
getElementIds(): string[];
getNewViewport(bounds: Bounds, model: SModelRootImpl): Viewport | undefined;
}
export declare class FitToScreenCommand extends BoundsAwareViewportCommand {
protected readonly action: FitToScreenAction;
static readonly KIND = "fit";
constructor(action: FitToScreenAction);
getElementIds(): string[];
getNewViewport(bounds: Bounds, model: SModelRootImpl): Viewport | undefined;
}
export declare class CenterKeyboardListener extends KeyListener {
keyDown(element: SModelElementImpl, event: KeyboardEvent): Action[];
}
//# sourceMappingURL=center-fit.d.ts.map