Search in sources :

Example 1 with ArrowStyle

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
}
Also used : LineStyle(org.eclipse.sirius.components.diagrams.LineStyle) ArrowStyle(org.eclipse.sirius.components.diagrams.ArrowStyle)

Aggregations

ArrowStyle (org.eclipse.sirius.components.diagrams.ArrowStyle)1 LineStyle (org.eclipse.sirius.components.diagrams.LineStyle)1