sprotty
Version:
A next-gen framework for graphical views
53 lines • 2.45 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2018 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 { interfaces } from "inversify";
import { Bounds } from "sprotty-protocol/lib/utils/geometry";
import { ILogger } from '../../utils/logging';
import { InstanceRegistry } from "../../utils/registry";
import { SParentElementImpl, SModelElementImpl } from "../../base/model/smodel";
import { InternalLayoutContainer } from "./model";
import { BoundsData } from "./hidden-bounds-updater";
export declare class LayoutRegistry extends InstanceRegistry<ILayout> {
logger: ILogger;
constructor(layouts?: (LayoutRegistration)[]);
}
export interface LayoutRegistration {
layoutKind: string;
factory: () => ILayout;
}
export declare class Layouter {
protected layoutRegistry: LayoutRegistry;
protected logger: ILogger;
layout(element2boundsData: Map<SModelElementImpl, BoundsData>): void;
}
export declare class StatefulLayouter {
private readonly element2boundsData;
private readonly layoutRegistry;
readonly log: ILogger;
private toBeLayouted;
constructor(element2boundsData: Map<SModelElementImpl, BoundsData>, layoutRegistry: LayoutRegistry, log: ILogger);
getBoundsData(element: SModelElementImpl): BoundsData;
layout(): void;
protected doLayout(element: SParentElementImpl & InternalLayoutContainer): Bounds;
}
export interface ILayout {
layout(container: SParentElementImpl & InternalLayoutContainer, layouter: StatefulLayouter): void;
}
export declare function configureLayout(context: {
bind: interfaces.Bind;
isBound: interfaces.IsBound;
}, kind: string, constr: interfaces.ServiceIdentifier<ILayout>): void;
//# sourceMappingURL=layout.d.ts.map