sprotty
Version:
A next-gen framework for graphical views
50 lines • 3.01 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2022 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 { UpdateModelAction } from 'sprotty-protocol/lib/actions';
import { Animation } from '../../base/animations/animation';
import { CommandExecutionContext, CommandReturn, Command } from '../../base/commands/command';
import { ResolvedElementFade } from '../fade/fade';
import { SModelRootImpl, SModelElementImpl } from '../../base/model/smodel';
import { ResolvedElementMove } from '../move/move';
import { MatchResult, Match } from './model-matching';
import { ResolvedElementResize } from '../bounds/resize';
import { EdgeRouterRegistry, EdgeSnapshot, EdgeMemento } from '../routing/routing';
import { SRoutableElementImpl } from '../routing/model';
export interface UpdateAnimationData {
fades: ResolvedElementFade[];
moves?: ResolvedElementMove[];
resizes?: ResolvedElementResize[];
edgeMementi?: EdgeMemento[];
}
export declare class UpdateModelCommand extends Command {
protected readonly action: UpdateModelAction;
static readonly KIND = "updateModel";
oldRoot: SModelRootImpl;
newRoot: SModelRootImpl;
edgeRouterRegistry?: EdgeRouterRegistry;
constructor(action: UpdateModelAction);
execute(context: CommandExecutionContext): CommandReturn;
protected performUpdate(oldRoot: SModelRootImpl, newRoot: SModelRootImpl, context: CommandExecutionContext): CommandReturn;
protected applyMatches(root: SModelRootImpl, matches: Match[], context: CommandExecutionContext): void;
protected convertToMatchResult(matches: Match[], leftRoot: SModelRootImpl, rightRoot: SModelRootImpl): MatchResult;
protected computeAnimation(newRoot: SModelRootImpl, matchResult: MatchResult, context: CommandExecutionContext): SModelRootImpl | Animation;
protected updateElement(left: SModelElementImpl, right: SModelElementImpl, animationData: UpdateAnimationData): void;
protected takeSnapshot(edge: SRoutableElementImpl): EdgeSnapshot;
protected createAnimations(data: UpdateAnimationData, root: SModelRootImpl, context: CommandExecutionContext): Animation[];
undo(context: CommandExecutionContext): CommandReturn;
redo(context: CommandExecutionContext): CommandReturn;
}
//# sourceMappingURL=update-model.d.ts.map