Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jan 11, 2025
1 parent 5ceaa57 commit 1a34a1b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions open-bpmn.glsp-client/open-bpmn-glsp/src/bpmn-manhattan-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class BPMNManhattanRouter extends GLSPManhattanEdgeRouter {
elementId,
edgeIds
};
this.debug('├── update currentDelta = ' + delta.x + "," + delta.y + ' for elements: ' + edgeIds.join(', '));
this.debug('├── update currentDelta = ' + delta.x + ', ' + delta.y + ' for elements: ' + edgeIds.join(', '));
}

protected override getOptions(edge: GRoutableElement): ManhattanRouterOptions {
Expand All @@ -84,19 +84,17 @@ export class BPMNManhattanRouter extends GLSPManhattanEdgeRouter {
* 1. Default routing when no movement is happening
* 2. Adjusting the route when the source element is moved
* 3. Adjusting the route when the target element is moved
*
*
* The method preserves the Manhattan-style routing by ensuring that segments remain either
* horizontal or vertical after adjustments.
*
*
* @param edge - the edge to be routed
* @returns Array of points describing the complete route
*/
override route(edge: GRoutableElement): RoutedPoint[] {
if (!edge.source || !edge.target) {
return [];
}


const routedCorners = this.createRoutedCorners(edge);
const sourceRefPoint = routedCorners[0] ||
translatePoint(Bounds.center(edge.target.bounds), edge.target.parent, edge.parent);
Expand Down Expand Up @@ -223,18 +221,18 @@ export class BPMNManhattanRouter extends GLSPManhattanEdgeRouter {

/**
* Helper Debug Methods
*
*
* @param routedPoints
*/
private debugPoints(message: string, points: Point[]) {
private debugPoints(message: string, points: Point[]): void {
if (this.debugMode) {
console.log(message);
points.forEach(point => {
console.log('│ ├── x=' + point.x + ' y=' + point.y);
});
}
}
private debug(message: string) {
private debug(message: string): void {
if (this.debugMode) {
// console.log(message);
}
Expand All @@ -261,13 +259,11 @@ export class BPMNRouterMoveListener extends MouseListener {
* Handles mouse button press. Starts tracking if:
* 1. It's a left mouse button press
* 2. The target is a connectable element
*
*
* @param target The element under the mouse
* @param event Mouse event
*/
override mouseDown(target: GModelElement, event: MouseEvent): Action[] {


if (event.button === 0) { // left mouse button
// Only track connectable elements
let targetElement = target;
Expand Down Expand Up @@ -309,7 +305,7 @@ export class BPMNRouterMoveListener extends MouseListener {
/**
* Handles mouse movement during drag operations. Calculates the movement delta
* and informs the router about the movement.
*
*
* @param target Current element under the mouse
* @param event Mouse event
*/
Expand All @@ -333,7 +329,7 @@ export class BPMNRouterMoveListener extends MouseListener {

/**
* Handles mouse button release. Cleans up tracking state.
*
*
* @param target The element under the mouse
* @param event Mouse event
*/
Expand Down

0 comments on commit 1a34a1b

Please sign in to comment.