-
Hi, My router looks like this: import {
GLSPManhattanEdgeRouter,
GRoutableElement,
ResolvedHandleMove
} from '@eclipse-glsp/client';
export class BPMNManhattanRouter extends GLSPManhattanEdgeRouter {
static readonly BPMNKIND = 'bpmnmanhattan';
override get kind() {
return BPMNManhattanRouter.BPMNKIND;
}
protected override applyInnerHandleMoves(edge: GRoutableElement, moves: ResolvedHandleMove[]): void {
super.applyInnerHandleMoves(edge, moves);
console.log('├── New Routing Points:');
edge.routingPoints.forEach(point => {
console.log('│ ├── x=' + point.x + ' y=' + point.y);
});
}
} And I want to register it in my DiagramModule like this: bind(BPMNManhattanRouter).toSelf().inSingletonScope();
bind(TYPES.IEdgeRouter).toService(BPMNManhattanRouter); But during runtime the router kind is not know :-( I go the following error:
I guess my way to register the router is wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@rsoika No your way to register the router is correct. The problem is since you have introduced a new router kind you also need to configure Is there a specific reason that you want to introduce an entirely new routerkind? Do you plan on supporting both default rebind(GLSPManhattanRouter).to(BPMNManhattanRouter).inSIngletonScope(); This way you don't have to concern yourself with configuring anchor computers since they are already configured by default. |
Beta Was this translation helpful? Give feedback.
-
@tortmayr, Thanks, yes using the default routerkind works with the rebind command you showed me. The only reason for a custom routerkind was the idea to contribute my results later. But that we can discuss after I have some useful new implementation. Can you please explain why the And another problem I came across are the missing sprotty classes. For example if I would like to overwrite the route method, override route(edge: SRoutableElementImpl): RoutedPoint[] {
return super.route(edge);
} how can I import the |
Beta Was this translation helpful? Give feedback.
Looks like this was a workaround for eclipse-sprotty/sprotty#310.
Since this is now fixed directly in sprotty, the override is no longer necessary. Thanks for pointing that out,
we will remove this override