wip layout
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
||||
********************************************************************************/
|
||||
import {BeanNode, ExampleWebsocketDiagramServer, VSCodeWebViewDiagramServer} from "./model";
|
||||
import {ExampleWebsocketDiagramServer, VSCodeWebViewDiagramServer} from "./model";
|
||||
|
||||
console.log("Loading di.config");
|
||||
import "reflect-metadata"
|
||||
@@ -43,9 +43,9 @@ import {
|
||||
SLabel,
|
||||
SLabelView,
|
||||
SCompartment,
|
||||
SCompartmentView, SEdge
|
||||
SCompartmentView, SEdge, RectangularNode
|
||||
} from "sprotty";
|
||||
import {BeanNodeView, CircleNodeView, EdgeView, ExampleGraphView, ChannelNodeView} from "./views";
|
||||
import {IntegrationNodeView, CircleNodeView, EdgeView, ExampleGraphView, ChannelNodeView} from "./views";
|
||||
|
||||
export enum TransportMedium {
|
||||
None,
|
||||
@@ -72,8 +72,8 @@ export default (transport: TransportMedium, clientId: string) => {
|
||||
const context = { bind, unbind, isBound, rebind };
|
||||
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
|
||||
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
|
||||
configureModelElement(context, 'node:bean', BeanNode, BeanNodeView);
|
||||
configureModelElement(context, 'node:channel', BeanNode, ChannelNodeView);
|
||||
configureModelElement(context, 'node:integration_node', RectangularNode, IntegrationNodeView);
|
||||
configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
|
||||
configureModelElement(context, 'node:label', SLabel, SLabelView);
|
||||
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
|
||||
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import {ManhattanEdgeRouter, RectangularNode, SEdge, WebSocketDiagramServer, ActionMessage, DiagramServer} from "sprotty";
|
||||
import {ManhattanEdgeRouter, SEdge, WebSocketDiagramServer, ActionMessage, DiagramServer} from "sprotty";
|
||||
import {injectable} from 'inversify';
|
||||
|
||||
export class BeanNode extends RectangularNode {
|
||||
|
||||
}
|
||||
|
||||
export class OrthogonalEgde extends SEdge {
|
||||
|
||||
routerKind = ManhattanEdgeRouter.KIND;
|
||||
|
||||
@@ -94,7 +94,7 @@ export class EdgeView extends PolylineEdgeView {
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class BeanNodeView extends RectangularNodeView {
|
||||
export class IntegrationNodeView extends RectangularNodeView {
|
||||
render(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode {
|
||||
return <g>
|
||||
<rect class-sprotty-node={node instanceof SNode} class-sprotty-port={node instanceof SPort}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.sprotty.Dimension;
|
||||
import org.eclipse.sprotty.LayoutOptions;
|
||||
import org.eclipse.sprotty.Point;
|
||||
import org.eclipse.sprotty.RequestModelAction;
|
||||
import org.eclipse.sprotty.SCompartment;
|
||||
@@ -130,11 +131,29 @@ public class SIDiagramGenerator implements DiagramGenerator {
|
||||
return node;
|
||||
}
|
||||
|
||||
private static SNode createIntegrationNode(String id, String labelText) {
|
||||
SNode node = createNode(id, labelText, "integration_node");
|
||||
LayoutOptions layoutOptions = new LayoutOptions();
|
||||
layoutOptions.setMinHeight(80D);
|
||||
layoutOptions.setMinWidth(120D);
|
||||
node.setLayoutOptions(layoutOptions);
|
||||
return node;
|
||||
}
|
||||
|
||||
private static SNode createChannelNode(String id, String labelText) {
|
||||
SNode node = createNode(id, labelText, "channel");
|
||||
LayoutOptions layoutOptions = new LayoutOptions();
|
||||
layoutOptions.setMinHeight(80D);
|
||||
layoutOptions.setMinWidth(120D);
|
||||
node.setLayoutOptions(layoutOptions);
|
||||
return node;
|
||||
}
|
||||
|
||||
private static String visualType(String type) {
|
||||
if (channelTypes.contains(type)) {
|
||||
return "channel";
|
||||
} else {
|
||||
return "bean";
|
||||
return "integration_node";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user