UNPKG

@eclipse-glsp/client

Version:

A sprotty-based client for GLSP

54 lines 3.02 kB
/******************************************************************************** * Copyright (c) 2021-2024 EclipseSource 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, DOMHelper, GModelElement, GModelRoot, Point, PointToPointLine, TypeGuard } from '@eclipse-glsp/sprotty'; import { GEdge } from '../../../model'; import { BoundsAwareModelElement } from '../../../utils/gmodel-util'; import { DrawMarqueeAction } from './marquee-tool-feedback'; export interface IMarqueeBehavior { readonly entireElement: boolean; readonly entireEdge: boolean; } export declare class MarqueeUtil { protected marqueeBehavior: IMarqueeBehavior; protected domHelper: DOMHelper; protected startPoint: Point; protected currentPoint: Point; constructor(marqueeBehavior: IMarqueeBehavior | undefined, domHelper: DOMHelper); isContinuousMode(element: GModelElement, event: MouseEvent): boolean; getMarkableNodes(root: GModelRoot): BoundsAwareModelElement[]; protected isMarkableNode(): TypeGuard<BoundsAwareModelElement>; getMarkableEdges(root: GModelRoot): GEdge[]; protected isMarkableEdge(): TypeGuard<GEdge>; updateStartPoint(position: Point): void; updateCurrentPoint(position: Point): void; isMarked(element: BoundsAwareModelElement | GEdge): boolean; drawMarqueeAction(): DrawMarqueeAction; protected isMarkedEdge(edge: GEdge): boolean; protected isMarkedNode(node: BoundsAwareModelElement): boolean; protected getNodeBounds(node: BoundsAwareModelElement): Bounds; isEdgePathMarked(path: string | null): boolean; isEdgeMarked(points: Point[]): boolean; isNodeMarked(elementBounds: Bounds): boolean; protected isEntireEdgeMarked(points: Point[]): boolean; protected isPartOfEdgeMarked(points: Point[]): boolean; protected isLineMarked(point1: Point, point2: Point): boolean; protected lineIntersect(line: PointToPointLine, p1: Point, p2: Point): boolean; protected pointInRect(point: Point): boolean; protected isElementBetweenXAxis(elementBounds: Bounds, marqueeLeft: number, marqueeRight: number): boolean; protected isElementBetweenYAxis(elementBounds: Bounds, marqueeTop: number, marqueeBottom: number): boolean; protected isBetween(x: number, lower: number, upper: number): boolean; } //# sourceMappingURL=marquee-behavior.d.ts.map