sprotty
Version:
A next-gen framework for graphical views
37 lines • 2.8 kB
TypeScript
/********************************************************************************
* Copyright (c) 2017-2024 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 { Bounds, Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SParentElementImpl, SModelElementImpl, SChildElementImpl } from '../../base/model/smodel';
import { InternalLayoutContainer } from './model';
import { ILayout, StatefulLayouter } from './layout';
import { AbstractLayoutOptions } from './layout-options';
import { BoundsData } from './hidden-bounds-updater';
import { HAlignment, VAlignment } from 'sprotty-protocol/lib/model';
export declare abstract class AbstractLayout<T extends AbstractLayoutOptions> implements ILayout {
layout(container: SParentElementImpl & InternalLayoutContainer, layouter: StatefulLayouter): void;
protected abstract layoutChild(child: SChildElementImpl, boundsData: BoundsData, bounds: Bounds, childOptions: T, containerOptions: T, currentOffset: Point, maxWidth: number, maxHeight: number): Point;
protected getFinalContainerBounds(container: SParentElementImpl & InternalLayoutContainer, lastOffset: Point, options: T, maxWidth: number, maxHeight: number): Bounds;
protected getFixedContainerBounds(container: SModelElementImpl, layoutOptions: T, layouter: StatefulLayouter): Bounds;
protected abstract getChildrenSize(container: SParentElementImpl & InternalLayoutContainer, containerOptions: T, layouter: StatefulLayouter): Dimension;
protected layoutChildren(container: SParentElementImpl & InternalLayoutContainer, layouter: StatefulLayouter, containerOptions: T, maxWidth: number, maxHeight: number): Point;
protected getDx(hAlign: HAlignment, bounds: Bounds, maxWidth: number): number;
protected getDy(vAlign: VAlignment, bounds: Bounds, maxHeight: number): number;
protected getChildLayoutOptions(child: SChildElementImpl, containerOptions: T): T;
protected getLayoutOptions(element: SModelElementImpl): T;
protected abstract getDefaultLayoutOptions(): T;
protected abstract spread(a: T, b: T): T;
}
//# sourceMappingURL=abstract-layout.d.ts.map