use of org.eclipse.sirius.components.diagrams.ArrowStyle in project sirius-components by eclipse-sirius.
the class EdgeMappingStyleProvider method getEdgeStyle.
private EdgeStyle getEdgeStyle(VariableManager variableManager, EdgeStyleDescription style) {
Map<String, Object> variables = variableManager.getVariables();
ColorDescriptionConverter colorDescriptionConverter = new ColorDescriptionConverter(this.interpreter, variables);
LineStyleConverter lineStyleConverter = new LineStyleConverter();
ArrowStyleConverter arrowStyleConverter = new ArrowStyleConverter();
int size = this.interpreter.evaluateExpression(variables, style.getSizeComputationExpression()).asInt().orElse(1);
LineStyle lineStyle = lineStyleConverter.getStyle(style.getLineStyle());
ArrowStyle sourceArrow = arrowStyleConverter.getStyle(style.getSourceArrow());
ArrowStyle targetArrow = arrowStyleConverter.getStyle(style.getTargetArrow());
String color = colorDescriptionConverter.convert(style.getStrokeColor());
// @formatter:off
return EdgeStyle.newEdgeStyle().size(size).lineStyle(lineStyle).sourceArrow(sourceArrow).targetArrow(targetArrow).color(color).build();
// @formatter:on
}
Aggregations